~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
docs: Add comprehensive documentation and update README (#508)
LearningCircuit1350c7022e44
diff --git a/README.md b/README.mdindex dc711cc374..d6caed95ea 100644--- a/README.md+++ b/README.md@@ -7,7 +7,16 @@[](https://discord.gg/ttcqQeFcJ3)[](https://www.reddit.com/r/LocalDeepResearch/)-*AI-powered research assistant that performs deep, iterative analysis using multiple LLMs and web searches*+[](https://github.com/LearningCircuit/local-deep-research/actions/workflows/tests.yml)+[](https://github.com/LearningCircuit/local-deep-research/security/code-scanning)+[](https://hub.docker.com/r/localdeepresearch/local-deep-research)+[](https://pypi.org/project/local-deep-research/)+[](https://pypi.org/project/local-deep-research/)+[](https://github.com/LearningCircuit/local-deep-research/releases)++**AI-powered research assistant for deep, iterative research**++*Performs deep, iterative research using multiple LLMs and search engines with proper citations*<div align="center"><a href="https://www.youtube.com/watch?v=0ISreg9q0p0">@@ -17,21 +26,66 @@</a></div>-</div>-## 📋 Overview+## 🚀 What is Local Deep Research?++LDR is an AI research assistant that performs systematic research by:++- **Breaking down complex questions** into focused sub-queries+- **Searching multiple sources** in parallel (web, academic papers, local documents)+- **Verifying information** across sources for accuracy+- **Creating comprehensive reports** with proper citations++It aims to help researchers, students, and professionals find accurate information quickly while maintaining transparency about sources.++## 🎯 Why Choose LDR?++- **Privacy-Focused**: Run entirely locally with Ollama + SearXNG+- **Flexible**: Use any LLM, any search engine, any vector store+- **Comprehensive**: Multiple research modes from quick summaries to detailed reports+- **Transparent**: Track costs and performance with built-in analytics+- **Open Source**: MIT licensed with an active community++## ✨ Key Features++### 🔍 Research Modes+- **Quick Summary** - Get answers in 30 seconds to 3 minutes with citations+- **Detailed Research** - Comprehensive analysis with structured findings+- **Report Generation** - Professional reports with sections and table of contents+- **Document Analysis** - Search your private documents with AI-Local Deep Research is a powerful AI research assistant that:+### 🛠️ Advanced Capabilities+- **[LangChain Integration](docs/LANGCHAIN_RETRIEVER_INTEGRATION.md)** - Use any vector store as a search engine+- **[REST API](docs/api-quickstart.md)** - Language-agnostic HTTP access+- **[Benchmarking](docs/BENCHMARKING.md)** - Test and optimize your configuration+- **[Analytics Dashboard](docs/analytics-dashboard.md)** - Track costs, performance, and usage metrics+- **Real-time Updates** - WebSocket support for live research progress+- **Export Options** - Download results as PDF or Markdown+- **Research History** - Save, search, and revisit past research+- **Adaptive Rate Limiting** - Intelligent retry system that learns optimal wait times+- **Keyboard Shortcuts** - Navigate efficiently (ESC, Ctrl+Shift+1-5)-1. **Performs iterative, multi-source research** on any topic-2. **Creates comprehensive reports or quick summaries** with proper citations-3. **Runs locally** for complete privacy when using local LLMs-4. **Searches across multiple sources** including academic databases & the web-5. **Processes your own documents** with vector search (RAG)-6. **Optimized for speed** with parallel search processing+### 🌐 Search Sources-Local Deep Research combines the power of large language models with intelligent search strategies to provide well-researched, properly cited answers to complex questions. It can process queries in just seconds with the Quick Summary option, or create detailed reports with proper section organization for more comprehensive analysis.+#### Free Search Engines+- **Academic**: arXiv, PubMed, Semantic Scholar+- **General**: Wikipedia, SearXNG, DuckDuckGo+- **Technical**: GitHub, Elasticsearch+- **Historical**: Wayback Machine+- **News**: The Guardian++#### Premium Search Engines+- **Tavily** - AI-powered search+- **Google** - Via SerpAPI or Programmable Search Engine+- **Brave Search** - Privacy-focused web search++#### Custom Sources+- **Local Documents** - Search your files with AI+- **LangChain Retrievers** - Any vector store or database+- **Meta Search** - Combine multiple engines intelligently++[Full Search Engines Guide →](docs/search-engines.md)## ⚡ Quick Start@@ -46,296 +100,177 @@ docker run -d -p 8080:8080 --name searxng searxng/searxngdocker pull localdeepresearch/local-deep-researchdocker run -d -p 5000:5000 --network host --name local-deep-research localdeepresearch/local-deep-research-# Start containers - Required after each reboot (can be automated with this flag in run command --restart unless-stopped)+# Start containers - Required after each reboot (can be automated with --restart unless-stopped)docker start searxngdocker start local-deep-research-```### Option 2: Docker Compose (Recommended)-LDR uses Docker compose to bundle the web app and all it's dependencies so-you can get up and running quickly.--### Prerequisites--- [Docker](https://docs.docker.com/engine/install/)-- [Docker Compose](https://docs.docker.com/compose/install/)-- `cookiecutter`: Run `pip install --user cookiecutter`--Clone the repository:-```bashgit clone https://github.com/LearningCircuit/local-deep-research.gitcd local-deep-research-```--### Configuring with Docker Compose--In the LDR repository, run the following command-to do generate the compose file:--```bash+pip install --user cookiecuttercookiecutter cookiecutter-docker/-```--This will prompt you to answer a series of questions. Hit Enter repeatedly-to accept the default values. It should generate a file in the repository called `docker-compose.default.yml`. To run LDR, use the following command:--```bashdocker compose -f docker-compose.default.yml up```-Then visit `http://127.0.0.1:5000` to start researching!--See [here](https://github.com/LearningCircuit/local-deep-research/wiki/Installation#docker-installation-recommended) for more information about-using Docker.+[Docker Compose Guide →](docs/docker-compose-guide.md)-### Option 3: Python Package (mostly for programmatic access)+### Option 3: Python Package```bash-# Install the package+# Step 1: Install the packagepip install local-deep-research-# Setup SearXNG for best results+# Step 2: Setup SearXNG for best resultsdocker pull searxng/searxngdocker run -d -p 8080:8080 --name searxng searxng/searxng-# Install Ollama and pull a model-# Download from https://ollama.ai and run:+# Step 3: Install Ollama from https://ollama.ai++# Step 4: Download a modelollama pull gemma3:12b-# Start the web interface+# Step 5: Start the web interfacepython -m local_deep_research.web.app```-For programmatic use in your Python code:+[Full Installation Guide →](https://github.com/LearningCircuit/local-deep-research/wiki/Installation)-```python-from local_deep_research import quick_summary+## 💻 Usage Examples-results = quick_summary(- query="advances in fusion energy",- search_tool="auto",- iterations=1+### Python API+```python+from local_deep_research.api import quick_summary++# Simple usage+result = quick_summary("What are the latest advances in quantum computing?")+print(result["summary"])++# Advanced usage with custom configuration+result = quick_summary(+ query="Impact of AI on healthcare",+ search_tool="searxng",+ search_strategy="focused-iteration",+ iterations=2)-print(results["summary"])```-### Additional Installation Options--**Windows**: Docker is the easiest option for Windows users. If preferred, a [Windows Installer](https://github.com/LearningCircuit/local-deep-research/releases/download/v0.1.0/LocalDeepResearch_Setup.exe) is also available.--For more information on installation options, see [the wiki](https://github.com/LearningCircuit/local-deep-research/wiki/Installation).--## 🔍 Research Capabilities--### Two Research Modes--- **Quick Summary**: Fast results (30s-3min) with key information and proper citations- - Perfect for rapid exploration and answering straightforward questions- - Supports multiple search engines in parallel for maximum efficiency- - Tables and structured information can be included when relevant--- **Detailed Report**: Comprehensive analysis with structured sections, table of contents, and in-depth exploration- - Creates professional-grade reports with proper organization- - Conducts separate research for each section to ensure comprehensive coverage- - Integrates information across sections for a cohesive analysis- - Includes proper citations and reference tracking--### Performance Optimization--- **Use Direct SearXNG**: For maximum speed (bypasses LLM calls needed for engine selection)-- **Adjust Iteration Depth**:- - 1 iteration: Quick factual questions (~30 seconds)- - 2-3 iterations: Complex topics requiring deeper exploration (2-3 minutes)- - 3-5 iterations: Comprehensive research with follow-up investigation (5+ minutes)-- **Choose Appropriate Models**:- - 12B-30B parameter models offer good balance of quality and speed- - For complex research, larger models may provide better synthesis-- **For Detailed Reports**: Expect multiple research cycles (one per section) and longer processing times--### Multi-Source Integration--- **Auto-Engine Selection**: The system intelligently selects the most appropriate search engines for your query-- **Academic Sources**: Direct access to Wikipedia, arXiv, PubMed, Semantic Scholar, and more-- **Web Search**: Via SearXNG, Brave Search, SerpAPI (for Google results), and more-- **Local Document Search**: Search through your private document collections with vector embeddings-- **Cross-Engine Filtering**: Smart result ranking across search engines for better information quality-- **Adaptive Rate Limiting**: Intelligent retry system that learns optimal wait times for each search engine, automatically handling rate limits and improving reliability--## 🤖 LLM Support--Local Deep Research works with both local and cloud LLMs:--### Local Models (via Ollama)--Local models provide complete privacy and don't require API keys or internet connection for the LLM component (only search queries go online).-+### HTTP API```bash-# Install Ollama from https://ollama.ai-ollama pull gemma3:12b # Recommended model+curl -X POST http://localhost:5000/api/v1/quick_summary \+ -H "Content-Type: application/json" \+ -d '{"query": "Explain CRISPR gene editing"}'```-Recommended local models:-- **Gemma 3 (12B)** - Great balance of quality and speed-- **Mistral (7B/8x7B)** - Fast performance on most hardware-- **Llama 3 (8B/70B)** - Good performance across various tasks+[More Examples →](examples/api_usage/)-### Cloud Models--Cloud models can provide higher quality results for complex research tasks:--API keys can be configured directly through the web interface in the settings panel or via environment variables:+### Command Line Tools```bash-# Cloud LLM providers - add to your .env file if not using the web UI-LDR_LLM_ANTHROPIC_API_KEY=your-api-key-here # For Claude models-LDR_LLM_OPENAI_API_KEY=your-openai-key-here # For GPT models-LDR_LLM_OPENAI_ENDPOINT_API_KEY=your-key-here # For OpenRouter or similar services--# Set your preferred provider and model-LDR_LLM_PROVIDER=ollama # Options: ollama, openai, anthropic, etc.-LDR_LLM_MODEL=gemma3:12b # Model name to use-```--### Supported Providers--| Provider | Type | Setup | Models |-|----------|------|---------|--------|-| `OLLAMA` | Local | Install from [ollama.ai](https://ollama.ai) | Mistral, Llama, Gemma, etc. |-| `OPENAI` | Cloud | API key required | GPT-3.5, GPT-4, GPT-4o |-| `ANTHROPIC` | Cloud | API key required | Claude 3 Opus, Sonnet, Haiku |-| `OPENAI_ENDPOINT` | Cloud | API key required | Any OpenAI-compatible API |-| `VLLM` | Local | Requires GPU setup | Any supported by vLLM |-| `LMSTUDIO` | Local | Use LM Studio server | Models from LM Studio |-| `LLAMACPP` | Local | Configure model path | GGUF model formats |--You can easily switch between models in the web interface or via environment variables without reinstalling.--## 🌐 Search Engines--The system leverages multiple search engines to find the most relevant information for your queries.+# Run benchmarks from CLI+python -m local_deep_research.benchmarks --dataset simpleqa --examples 50-### Core Free Engines (No API Key Required)--- **`auto`**: Intelligently selects the best engines based on your query (recommended)-- **`wikipedia`**: General knowledge, facts, and encyclopedic information-- **`arxiv`**: Scientific papers and academic research-- **`pubmed`**: Medical and biomedical research and journals-- **`semantic_scholar`**: Academic literature across all fields-- **`github`**: Code repositories, documentation, and technical discussions-- **`searxng`**: Comprehensive web search via local SearXNG instance-- **`wayback`**: Historical web content from Internet Archive--### Paid Engines (API Key Required)--For enhanced web search capabilities, you can configure these additional engines through the settings interface or via environment variables:--```bash-# Search API keys (if not using the web UI)-LDR_SEARCH_ENGINE_WEB_SERPAPI_API_KEY=your-key-here # Google results via SerpAPI-LDR_SEARCH_ENGINE_WEB_GOOGLE_PSE_API_KEY=your-key-here # Google Programmable Search-LDR_SEARCH_ENGINE_WEB_BRAVE_API_KEY=your-key-here # Brave Search+# Manage rate limiting+python -m local_deep_research.web_search_engines.rate_limiting status+python -m local_deep_research.web_search_engines.rate_limiting reset```-### Search Engine Comparison--| Engine | Specialization | Privacy | Speed | Results Quality |-|--------|----------------|---------|-------|-----------------|-| SearXNG | General web | ★★★★★ | ★★★★★ | ★★★★½ |-| Wikipedia | Facts & concepts | ★★★★★ | ★★★★☆ | ★★★★☆ |-| arXiv | Scientific research | ★★★★★ | ★★★★☆ | ★★★★★ |-| PubMed | Medical research | ★★★★★ | ★★★★☆ | ★★★★★ |-| GitHub | Code & tech | ★★★★★ | ★★★☆☆ | ★★★★☆ |-| SerpAPI | Web (Google) | ★★☆☆☆ | ★★★★☆ | ★★★★★ |-| Brave | Web (privacy-focused) | ★★★★☆ | ★★★★☆ | ★★★★☆ |--## 📚 Local Document Search (RAG)--Local Deep Research includes powerful Retrieval Augmented Generation (RAG) capabilities, allowing you to search and analyze your own private documents using vector embeddings:--### Supported Document Types+## 🔗 Enterprise Integration-- PDF files-- Markdown (.md)-- Plain text (.txt)-- Microsoft Word (.docx, .doc)-- Excel spreadsheets (.xlsx, .xls)-- CSV files-- And more+Connect LDR to your existing knowledge base:-See [this page](https://github.com/LearningCircuit/local-deep-research/wiki/Configuring-Local-Search) for-configuration instructions.+```python+from local_deep_research.api import quick_summary-## 🛠️ Advanced Configuration+# Use your existing LangChain retriever+result = quick_summary(+ query="What are our deployment procedures?",+ retrievers={"company_kb": your_retriever},+ search_tool="company_kb"+)+```-### Web Interface+Works with: FAISS, Chroma, Pinecone, Weaviate, Elasticsearch, and any LangChain-compatible retriever.-The easiest way to configure Local Deep Research is through the web interface, which provides:-- Complete settings management-- Model selection-- Search engine configuration-- Research parameter adjustment-- Local document collection setup+[Integration Guide →](docs/LANGCHAIN_RETRIEVER_INTEGRATION.md)-### Configuration Documentation+## 📊 Performance & Analytics-For detailed configuration options, see our guides:-- [Benchmarking Guide](https://github.com/LearningCircuit/local-deep-research/blob/main/docs/BENCHMARKING.md) - Test and optimize your search configurations-- [Environment Variables Guide](https://github.com/LearningCircuit/local-deep-research/blob/main/docs/env_configuration.md)-- [SearXNG Setup Guide](https://github.com/LearningCircuit/local-deep-research/blob/main/docs/SearXNG-Setup.md)-- [Docker Usage Guide](https://github.com/LearningCircuit/local-deep-research/blob/main/docs/docker-usage-readme.md)-- [Docker Compose Guide](https://github.com/LearningCircuit/local-deep-research/blob/main/docs/docker-compose-guide.md)+### Benchmark Results+Early experiments on small SimpleQA dataset samples:-### Programmatic Access+| Configuration | Accuracy | Notes |+|--------------|----------|--------|+| gpt-4.1-mini + SearXNG + focused_iteration | 90-95% | Limited sample size |+| gpt-4.1-mini + Tavily | Up to 95% | Limited sample size |+| gemini-2.0-flash-001 + SearXNG | 82% | Single test run |-Use the Python API for integration with other tools or scripts:+Note: These are preliminary results from initial testing. Performance varies significantly based on query types, model versions, and configurations. [Run your own benchmarks →](docs/BENCHMARKING.md)-```python-from local_deep_research import quick_summary, generate_report--# Quick research with custom parameters-results = quick_summary(- query="advances in fusion energy",- search_tool="auto",- iterations=1,- questions_per_iteration=2,- max_results=30,- temperature=0.7-)-print(results["summary"])-```--For more examples, see the [programmatic access tutorial](https://github.com/LearningCircuit/local-deep-research/blob/main/examples/programmatic_access.ipynb).+### Built-in Analytics Dashboard+Track costs, performance, and usage with detailed metrics. [Learn more →](docs/analytics-dashboard.md)-## 📊 Examples & Documentation+## 🤖 Supported LLMs-For more information and examples of what Local Deep Research can produce:+### Local Models (via Ollama)+- Llama 3, Mistral, Gemma, DeepSeek+- LLM processing stays local (search queries still go to web)+- No API costs-- [Example Outputs](https://github.com/LearningCircuit/local-deep-research/tree/main/examples)-- [Documentation](https://github.com/LearningCircuit/local-deep-research/tree/main/docs)-- [Wiki](https://github.com/LearningCircuit/local-deep-research/wiki)+### Cloud Models+- OpenAI (GPT-4, GPT-3.5)+- Anthropic (Claude 3)+- Google (Gemini)+- 100+ models via OpenRouter++[Model Setup →](docs/env_configuration.md)++## 📚 Documentation++### Getting Started+- [Installation Guide](https://github.com/LearningCircuit/local-deep-research/wiki/Installation)+- [Frequently Asked Questions](docs/faq.md)+- [API Quickstart](docs/api-quickstart.md)+- [Configuration Guide](docs/env_configuration.md)++### Core Features+- [All Features Guide](docs/features.md)+- [Search Engines Guide](docs/search-engines.md)+- [Analytics Dashboard](docs/analytics-dashboard.md)++### Advanced Features+- [LangChain Integration](docs/LANGCHAIN_RETRIEVER_INTEGRATION.md)+- [Benchmarking System](docs/BENCHMARKING.md)+- [Elasticsearch Setup](docs/elasticsearch_search_engine.md)+- [SearXNG Setup](docs/SearXNG-Setup.md)++### Development+- [Docker Compose Guide](docs/docker-compose-guide.md)+- [Development Guide](docs/developing.md)+- [Security Guide](docs/security/CODEQL_GUIDE.md)+- [Release Guide](docs/RELEASE_GUIDE.md)++### Examples & Tutorials+- [API Examples](examples/api_usage/)+- [Benchmark Examples](examples/benchmarks/)+- [Optimization Examples](examples/optimization/)## 🤝 Community & Support-- [Discord](https://discord.gg/ttcqQeFcJ3): Discuss features, get help, and share research techniques-- [Reddit](https://www.reddit.com/r/LocalDeepResearch/): Announcements, updates, and community showcase-- [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues): Bug reports and feature requests+- [Discord](https://discord.gg/ttcqQeFcJ3) - Get help and share research techniques+- [Reddit](https://www.reddit.com/r/LocalDeepResearch/) - Updates and showcases+- [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues) - Bug reports## 🚀 Contributing-We welcome contributions! Whether you're fixing bugs, adding features, or improving documentation, we'd love to have you as part of our community. Please see our [Contributing Guide](CONTRIBUTING.md) for guidelines on how to get started.+We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) to get started.-## 📄 License & Acknowledgments+## 📄 License-This project is licensed under the MIT License.+MIT License - see [LICENSE](LICENSE) file.-Built with powerful open-source tools:-- [LangChain](https://github.com/hwchase17/langchain) framework for LLM integration-- [Ollama](https://ollama.ai) for local AI model management-- [SearXNG](https://searxng.org/) for privacy-focused web search-- [FAISS](https://github.com/facebookresearch/faiss) for vector similarity search-- [justext](https://github.com/miso-belica/justext) and [Playwright](https://playwright.dev) for web content analysis+Built with: [LangChain](https://github.com/hwchase17/langchain), [Ollama](https://ollama.ai), [SearXNG](https://searxng.org/), [FAISS](https://github.com/facebookresearch/faiss)-> **Support Free Knowledge:** If you frequently use the search engines in this tool, please consider making a donation to organizations like [Wikipedia](https://donate.wikimedia.org), [arXiv](https://arxiv.org/about/give), or [PubMed](https://www.nlm.nih.gov/pubs/donations/donations.html).+> **Support Free Knowledge:** Consider donating to [Wikipedia](https://donate.wikimedia.org), [arXiv](https://arxiv.org/about/give), or [PubMed](https://www.nlm.nih.gov/pubs/donations/donations.html).diff --git a/docs/analytics-dashboard.md b/docs/analytics-dashboard.mdnew file mode 100644index 0000000000..8b228671cc--- /dev/null+++ b/docs/analytics-dashboard.md@@ -0,0 +1,245 @@+# Metrics Dashboard Guide++The Local Deep Research metrics dashboard provides insights into your research activities, costs, and system performance.++> **Note**: This documentation is maintained by the community and may contain inaccuracies. While we strive to keep it up-to-date, please verify critical information and report any errors via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues).++## Overview++The metrics dashboard tracks:+- Token usage and costs across LLM providers+- Search engine performance and health+- Research session statistics+- User satisfaction ratings+- Rate limiting status++## Accessing Metrics++- **Web Interface**: Navigate to `/metrics` in your browser+- **Direct URL**: `http://localhost:5000/metrics`++## Dashboard Components++### System Overview Cards++The main dashboard displays key metrics:++- **Total Tokens Used**: Shows total token consumption with expandable breakdown by model+- **Total Researches**: Number of research sessions conducted+- **Average Response Time**: System performance metric+- **Success Rate**: Percentage of successful operations+- **User Satisfaction**: Average star rating from user feedback+- **Estimated Costs**: Token-based cost estimation with provider breakdown++### Time-based Filtering++Filter analytics by time period:+- Last 7 days+- Last 30 days+- Last 3 months+- Last year+- All time++Additional filters:+- Research mode (Quick Summary / Detailed / All)++## Detailed Analytics Pages++### Star Reviews Analytics++Access via: `/metrics/star-reviews`++**Features:**+- 5-star rating distribution+- Average ratings by time period+- Rating trends visualization+- Breakdown by model and search engine+- User feedback analysis++### Cost Analytics++Access via: `/metrics/costs`++**Tracked Metrics:**+- Cost breakdown by provider (OpenAI, Anthropic, etc.)+- Token usage details (input/output/total)+- Cost trends over time+- Model-specific cost analysis+- Research type cost comparison++### Rate Limiting Dashboard++**Real-time monitoring of:**+- Search engine rate limit status+- Success/failure rates per engine+- Wait time tracking+- Engine health indicators:+ - 🟢 Healthy: >95% success rate+ - 🟡 Degraded: 70-95% success rate+ - 🔴 Poor: <70% success rate++## Metrics Tracked++### Token Metrics+- Total tokens (input + output)+- Token usage by model+- Average tokens per research+- Token consumption trends++### Search Metrics+- Search engine usage frequency+- Response times per engine+- Success/failure rates+- Results count statistics++### Research Metrics+- Total research sessions+- Research duration+- Completion status+- Strategy usage+- Query complexity++### Performance Metrics+- API response times+- System latency+- Error rates+- Throughput statistics++## Data Export++### Research Reports+Export individual research results as:+- **PDF**: Formatted reports with citations+- **Markdown**: Raw markdown with formatting+- **JSON**: Structured data via API++### Analytics Data+Access analytics data via API:++```bash+# Get overall metrics+curl http://localhost:5000/api/metrics++# Get specific research metrics+curl http://localhost:5000/api/metrics/research/<research_id>++# Get enhanced tracking data+curl http://localhost:5000/api/metrics/enhanced++# Get rating analytics+curl http://localhost:5000/api/star-reviews++# Get cost analytics+curl http://localhost:5000/api/cost-analytics++# Get rate limiting status+curl http://localhost:5000/api/rate-limiting+```++## Visualizations++The dashboard uses Chart.js to display:++- **Line Charts**: Token usage and search activity over time+- **Bar Charts**: Model usage comparison, cost breakdown+- **Pie Charts**: Provider distribution, search engine usage+- **Progress Indicators**: Success rates, health status++## Cost Tracking++### Automatic Cost Calculation++Costs are calculated based on:+- Provider pricing (OpenAI, Anthropic, etc.)+- Actual token usage+- Model-specific rates+- Both input and output tokens++### Supported Providers+- OpenAI (GPT-3.5, GPT-4)+- Anthropic (Claude models)+- Google (Gemini models)+- Local models (shown as $0)++## Rate Limiting Analytics++### Monitoring Features+- Real-time rate limit status+- Historical rate limit events+- Automatic wait time optimization+- Per-engine performance tracking++### Managing Rate Limits++Via command line:+```bash+# Check status+python -m local_deep_research.web_search_engines.rate_limiting status++# Reset rate limits+python -m local_deep_research.web_search_engines.rate_limiting reset+```++## Privacy and Data Storage++- All analytics data is stored locally+- No external analytics services used+- Data stored in SQLite databases+- Configurable data retention++## Using Analytics for Optimization++### Identify Cost Drivers+1. Review high-token queries in cost analytics+2. Compare model costs vs. quality ratings+3. Optimize model selection for different tasks++### Improve Search Performance+1. Monitor search engine health status+2. Identify frequently rate-limited engines+3. Adjust search strategy based on success rates++### Enhance Research Quality+1. Analyze user ratings by research type+2. Review low-rated sessions for patterns+3. Adjust parameters based on feedback++## Benchmarking Integration++For advanced users, analytics integrates with the benchmarking system:++- Track performance across different configurations+- Visualize optimization results (when matplotlib available)+- Compare quality vs. speed trade-offs+- Export benchmark data for analysis++## API Reference++### Metrics Endpoints++```bash+# General metrics with optional time filter+curl 'http://localhost:5000/api/metrics?days=30&mode=quick'++# Research-specific metrics+curl http://localhost:5000/api/metrics/research/<id>++# Enhanced metrics (detailed tracking)+curl http://localhost:5000/api/metrics/enhanced++# Star ratings data+curl 'http://localhost:5000/api/star-reviews?days=30'++# Cost breakdown+curl 'http://localhost:5000/api/cost-analytics?provider=openai'++# Rate limit status+curl http://localhost:5000/api/rate-limiting+```++## Related Documentation++- [Features Documentation](features.md)+- [Configuration Guide](env_configuration.md)+- [API Documentation](api-quickstart.md)+- [Benchmarking Guide](BENCHMARKING.md)diff --git a/docs/faq.md b/docs/faq.mdnew file mode 100644index 0000000000..d1558886ea--- /dev/null+++ b/docs/faq.md@@ -0,0 +1,385 @@+# Frequently Asked Questions (FAQ)++> **Note**: This documentation is maintained by the community and may contain inaccuracies. While we strive to keep it up-to-date, please verify critical information and report any errors via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues).++## Table of Contents++1. [General Questions](#general-questions)+2. [Installation & Setup](#installation--setup)+3. [Configuration](#configuration)+4. [Common Errors](#common-errors)+5. [Search Engines](#search-engines)+6. [LLM Configuration](#llm-configuration)+7. [Local Document Search](#local-document-search)+8. [Performance & Optimization](#performance--optimization)+9. [Docker Issues](#docker-issues)+10. [Platform-Specific Issues](#platform-specific-issues)++## General Questions++### What is Local Deep Research (LDR)?++LDR is an open-source AI research assistant that performs systematic research by breaking down complex questions, searching multiple sources in parallel, and creating comprehensive reports with proper citations. It can run entirely locally for complete privacy.++### How is LDR different from ChatGPT or other AI assistants?++LDR focuses specifically on research with real-time information retrieval. Key differences:+- Provides citations and sources for claims+- Searches multiple databases including academic papers+- Can run completely offline with local models+- Open source and customizable+- Searches your own documents++### Is LDR really free?++Yes! LDR is open source (MIT license). Costs only apply if you:+- Use cloud LLM providers (OpenAI, Anthropic)+- Use premium search APIs (Tavily, SerpAPI)+- Need cloud hosting infrastructure++Local models (Ollama) and free search engines have no costs.++### Can I use LDR completely offline?++Partially. You can:+- Use local LLMs (Ollama) offline+- Search local documents offline+- But web search requires internet++For intranet/offline environments, configure LDR to use only local documents and disable web search.++## Installation & Setup++### What are the system requirements?++- **Python**: 3.10 or newer+- **RAM**: 8GB minimum (16GB recommended for larger models)+- **GPU VRAM** (for Ollama):+ - 7B models: 4GB VRAM minimum+ - 13B models: 8GB VRAM minimum+ - 30B models: 16GB VRAM minimum+ - 70B models: 48GB VRAM minimum+- **Disk Space**:+ - 100MB for LDR+ - 1-2GB for SearXNG+ - 5-15GB per Ollama model+- **OS**: Windows, macOS, Linux++### Do I need Docker?++Docker is recommended but not required. You can:+- Use Docker Compose (easiest)+- Use Docker containers individually+- Install via pip without Docker++### Which installation method should I use?++- **Docker Compose**: Best for production use+- **Docker**: Good for quick testing+- **Pip package**: Best for development or Python integration++### How do I set up SearXNG?++SearXNG is a privacy-respecting metasearch engine. Learn more at the [SearXNG repository](https://github.com/searxng/searxng).++```bash+docker pull searxng/searxng+docker run -d -p 8080:8080 --name searxng searxng/searxng+```++Then set the URL to `http://localhost:8080` in LDR settings.++### The cookiecutter command fails on Windows++For Windows users, you can use the generated docker-compose file directly instead of running cookiecutter:+```yaml+services:+ local-deep-research:+ build:+ context: .+ dockerfile: Dockerfile+ ports:+ - "5000:5000"+ environment:+ - SEARXNG_URL=http://searxng:8080+ depends_on:+ - searxng++ searxng:+ image: searxng/searxng:latest+ ports:+ - "8080:8080"+```++## Configuration++### How do I change the LLM model?++1. **Via Web UI**: Settings → LLM Provider → Select model+2. **Via Environment**: Set `LDR_LLM_MODEL` and `LDR_LLM_PROVIDER`+3. **Via API**: Pass model parameters in requests++### Where should I configure settings?++**Important**: The `.env` file method is deprecated. Use the web UI settings instead:+1. Run the web app: `python -m local_deep_research.web.app`+2. Navigate to Settings+3. Configure your preferences+4. Settings are saved to the database++### How do I download Ollama models in Docker?++**Note**: If you use cookiecutter with Ollama, it will automatically download an initial model that you specify during setup.++To manually download additional models:+```bash+# Connect to the Ollama container+docker exec -it ollama ollama pull llama3:8b++# Or if using docker-compose+docker-compose exec ollama ollama pull llama3:8b+```++### Which Ollama model should I use?++Recommended models:+- **Best quality**: `llama3:70b` (requires 48GB+ VRAM)+- **Balanced**: `gemma3:12b` (good quality/speed trade-off)+- **Fastest**: `llama3:8b`, `mistral:7b`, or `gemma:7b`++## Common Errors++### "Error: max_workers must be greater than 0"++This means LDR cannot connect to your LLM. Check:+1. Ollama is running: `ollama list`+2. You have models downloaded: `ollama pull llama3:8b`+3. Correct model name in settings+4. For Docker: Ensure containers can communicate++### "No module named 'local_deep_research'"++Reinstall the package:+```bash+pip uninstall local-deep-research+pip install local-deep-research+```++### "404 Error" when viewing results++This issue should be resolved in versions 0.5.2 and later. If you're still experiencing it:+1. Refresh the page+2. Check if research actually completed in logs+3. Update to the latest version++### Research gets stuck or shows empty headings++Common causes:+- "Search snippets only" disabled (must be enabled for SearXNG)+- Rate limiting from search engines+- LLM connection issues++Solutions:+1. Reset settings to defaults+2. Use fewer iterations (2-3)+3. Limit questions per iteration (3-4)++### "'str' object has no attribute 'items'"++This issue should be fixed in recent versions. If you encounter it, ensure you're using the correct environment variable format. Remove deprecated variables:+- `LDR_SEARCH_ENGINE_WEB`+- `LDR_SEARCH_ENGINE_AUTO`+- `LDR_SEARCH_ENGINE_DEFAULT`++Use `LDR_SEARCH_TOOL` instead if needed.++## Search Engines++### SearXNG connection errors++1. **Verify SearXNG is running**:+ ```bash+ docker ps | grep searxng+ curl http://localhost:8080+ ```++2. **For Docker networking issues**:+ - Use `http://searxng:8080` (container name) not `localhost`+ - Or use `--network host` mode++3. **Check browser access**: Navigate to `http://localhost:8080`++### Rate limit errors++Solutions:+1. Check status: `python -m local_deep_research.web_search_engines.rate_limiting status`+2. Reset limits: `python -m local_deep_research.web_search_engines.rate_limiting reset`+3. Use `auto` search tool for automatic fallbacks+4. Add premium search engines++### "Invalid value" errors from SearXNG++Ensure "Search snippets only" is enabled in settings. This is required for SearXNG.++### Captcha errors++Some search engines detect bot activity. Solutions:+- Use SearXNG instead of direct search engines+- Add delays between searches+- Use premium APIs (Tavily, SerpAPI)++## LLM Configuration++### Cannot connect to Ollama++1. **Verify Ollama installation**:+ ```bash+ ollama --version+ ollama list+ ```++2. **For Docker**: Use correct URL+ - From host: `http://localhost:11434`+ - From container: `http://ollama:11434` or `http://host.docker.internal:11434`++### LM Studio connection issues++For Docker on Mac (#365):+- Use `http://host.docker.internal:1234` instead of `localhost:1234`++### Context length not respected++Known issue with Ollama (#500). Workaround:+- Set context length when pulling model: `ollama pull llama3:8b --context-length 8192`++### Model not in dropdown list++Current limitation (#179). Workarounds:+1. Type the exact model name in the dropdown field+2. Edit database directly+3. Use environment variables++## Local Document Search++### How do I configure local document paths?++1. **In Web UI**:+ - Settings → Search for "local"+ - Edit "Document Collection Paths"+ - Use absolute paths: `["/home/user/documents", "/data/pdfs"]`++2. **For Docker**: Mount volumes+ ```bash+ docker run -v /host/path:/container/path ...+ ```+ Then use container path in settings: `["/container/path"]`++### Local search not finding documents++Common issues:+1. **First search is slow** - Initial indexing takes time+2. **Path format** - Use absolute paths, not relative+3. **File types** - Ensure supported formats (PDF, TXT, MD, DOCX)+4. **Permissions** - Check read permissions++### The @format syntax in settings++This is a UI hint to expand environment variables. Replace with actual paths:+- Change: `"@format ${DOCS_DIR}/personal_notes"`+- To: `"/home/user/documents/personal_notes"`++## Performance & Optimization++### Research is too slow++1. **Reduce complexity**:+ - In the Web UI: Use Settings to reduce iterations and questions per iteration+ - Via API:+ ```python+ quick_summary(+ query="your query",+ iterations=1, # Start with 1+ questions_per_iteration=2 # Limit sub-questions+ )+ ```++2. **Use faster models**:+ - Local: `mistral:7b`+ - Cloud: `gpt-3.5-turbo`++3. **Enable "Search snippets only"** (required for SearXNG)++### High memory usage++- Use smaller models (7B instead of 70B)+- Limit document collection size+- Use quantized models (GGUF format)++## Docker Issues++### Containers can't communicate++1. **Use Docker Compose** (recommended)+2. **Or use host networking**:+ ```bash+ docker run --network host ...+ ```+3. **Check container names** in URLs++### Port 5000 not accessible on Windows++Windows Docker issue. Modify docker-compose.yml:+```yaml+services:+ local-deep-research:+ # ... other config ...+ extra_hosts:+ - "host.docker.internal:host-gateway"+```++### "Database is locked" errors++Stop all containers and restart:+```bash+docker-compose down+docker-compose up -d+```++## Platform-Specific Issues++### Windows filename errors (#339)++LDR may generate invalid filenames. Fixed in recent versions, update to latest.++### macOS M1/M2/M3 issues++- Build your own Docker image for ARM+- Use native Ollama installation+- Some models may not be optimized for Apple Silicon++### WSL2 networking problems++Common on Windows. Solutions:+1. Use `127.0.0.1` instead of `0.0.0.0`+2. Check WSL2 firewall settings+3. Restart WSL: `wsl --shutdown`++## Getting Help++- **Discord**: [Join our community](https://discord.gg/ttcqQeFcJ3)+- **GitHub Issues**: [Report bugs](https://github.com/LearningCircuit/local-deep-research/issues)+- **Reddit**: [r/LocalDeepResearch](https://www.reddit.com/r/LocalDeepResearch/)++When reporting issues, include:+- Error messages and logs+- Your configuration (OS, Docker/pip, models)+- Steps to reproduce+- What you've already tried++## Related Documentation++- [Installation Guide](https://github.com/LearningCircuit/local-deep-research/wiki/Installation)+- [Search Engines Guide](search-engines.md)+- [Features Documentation](features.md)+- [API Documentation](api-quickstart.md)+- [Configuration Guide](env_configuration.md)diff --git a/docs/features.md b/docs/features.mdnew file mode 100644index 0000000000..bff9c8d37f--- /dev/null+++ b/docs/features.md@@ -0,0 +1,337 @@+# Features Documentation++This comprehensive guide covers all features available in Local Deep Research (LDR).++> **Note**: This documentation is maintained by the community and may contain inaccuracies. While we strive to keep it up-to-date, please verify critical information and report any errors via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues).++## Table of Contents++1. [Research Modes](#research-modes)+2. [Search Capabilities](#search-capabilities)+3. [LLM Integration](#llm-integration)+4. [User Interface Features](#user-interface-features)+5. [Advanced Features](#advanced-features)+6. [Developer Features](#developer-features)+7. [Performance Features](#performance-features)++## Research Modes++### Quick Summary Mode++Fast research mode that provides concise answers with citations.++**Features:**+- Automatic query decomposition+- Parallel search execution+- Smart result synthesis+- Citation tracking+- Structured output with tables when relevant++**Usage:**+```python+from local_deep_research.api import quick_summary++result = quick_summary(+ query="Your research question",+ iterations=2, # Number of research iterations+ questions_per_iteration=3 # Sub-questions per iteration+)+```++### Detailed Research Mode++Comprehensive analysis mode for in-depth exploration of topics.++**Features:**+- Section-based research organization+- Multiple research cycles+- Cross-reference validation+- Extended context windows+- Detailed citation management++### Report Generation Mode++Creates professional research reports with proper structure.++**Features:**+- Automatic table of contents+- Section headers and organization+- Executive summary generation+- Bibliography management+- Export to PDF/Markdown++### Document Analysis Mode++Searches and analyzes your private document collections.++**Features:**+- Multiple document formats supported+- Vector-based semantic search+- Collection management+- Incremental indexing+- Privacy-preserved processing++## Search Capabilities++### Multi-Engine Search++Simultaneously query multiple search engines for comprehensive results.++**Supported Engines:**+- Academic: arXiv, PubMed, Semantic Scholar+- General: Wikipedia, SearXNG, DuckDuckGo+- Technical: GitHub, Elasticsearch+- Custom: Local documents, LangChain retrievers++### Intelligent Query Routing++The system automatically selects appropriate search engines based on query type:+- Scientific queries → Academic engines+- Code questions → GitHub + technical sources+- General knowledge → Wikipedia + web search++### Adaptive Rate Limiting++**Features:**+- Learns optimal wait times per engine+- Automatic retry with exponential backoff+- Fallback engine selection+- Rate limit status monitoring++### Search Strategies++27+ search strategies including:+- `simple`: Direct search+- `focused_iteration`: Iterative refinement+- `breadth_first`: Wide exploration+- `depth_first`: Deep topic diving+- `academic_focus`: Scholarly emphasis+- `cross_reference`: Multi-source validation++## LLM Integration++### Local Models (via Ollama)++**Supported Models:**+- Llama 3 (8B, 70B)+- Mistral (7B, 8x7B)+- Gemma (7B, 12B)+- DeepSeek Coder+- Custom GGUF models++**Features:**+- Complete privacy+- No API costs+- Model hot-swapping+- GPU acceleration support++### Cloud Models++**Providers:**+- OpenAI (GPT-3.5, GPT-4)+- Anthropic (Claude 3 family)+- Google (Gemini models)+- OpenRouter (100+ models)++**Features:**+- Automatic fallback+- Cost tracking per model+- Token usage monitoring+- Model comparison tools++## User Interface Features++### Web Interface++**Core Features:**+- Real-time research progress+- Interactive result exploration+- Settings management+- Research history+- Export capabilities++### Keyboard Shortcuts++- `ESC`: Cancel current operation+- `Ctrl+Shift+1`: Quick Summary mode+- `Ctrl+Shift+2`: Detailed Research mode+- `Ctrl+Shift+3`: Report Generation+- `Ctrl+Shift+4`: Settings+- `Ctrl+Shift+5`: Analytics++### Real-time Updates++**WebSocket Features:**+- Live research progress+- Streaming results+- Status notifications+- Error handling+- Connection management++### Export Options++**Formats:**+- PDF with formatting+- Markdown with citations+- JSON for programmatic use+- Plain text+- HTML with styling++## Advanced Features++### LangChain Integration++Connect any LangChain-compatible retriever:++```python+from local_deep_research.api import quick_summary++result = quick_summary(+ query="Internal documentation query",+ retrievers={"company_docs": your_retriever},+ search_tool="company_docs"+)+```++**Supported Vector Stores:**+- FAISS+- Chroma+- Pinecone+- Weaviate+- Elasticsearch+- Custom implementations++### REST API++Full HTTP API for language-agnostic access:++```bash+# Quick summary+POST /api/v1/quick_summary++# Detailed research+POST /api/v1/detailed_research++# Report generation+POST /api/v1/generate_report+```++**Features:**+- OpenAPI specification+- Authentication support+- Rate limiting+- Webhook callbacks+- Batch processing++### Analytics Dashboard++**Metrics Tracked:**+- Cost per research/model+- Token usage patterns+- Response times+- Success rates+- Search engine health+- User ratings++**Time Ranges:**+- Last 7 days+- Last 30 days+- Last 90 days+- All time++### Research History++**Features:**+- Full research archive+- Search within results+- Tagging system+- Sharing capabilities+- Version tracking++## Developer Features++### Python SDK++```python+from local_deep_research import ResearchClient++client = ResearchClient(+ llm_provider="ollama",+ llm_model="llama3:8b",+ search_engines=["searxng", "arxiv"]+)++result = client.research(+ query="Your question",+ strategy="focused_iteration"+)+```++### Benchmarking System++**Features:**+- SimpleQA dataset support+- Custom dataset creation+- Performance metrics+- A/B testing framework+- Configuration optimization++**Usage:**+```bash+python -m local_deep_research.benchmarks \+ --dataset simpleqa \+ --examples 100 \+ --config your_config.json+```+++### Command Line Tools++```bash+# Run benchmarks from CLI+python -m local_deep_research.benchmarks --dataset simpleqa --examples 50++# Manage rate limiting+python -m local_deep_research.web_search_engines.rate_limiting status+python -m local_deep_research.web_search_engines.rate_limiting reset+```++## Performance Features++### Caching System++**Document Embedding Cache:**+- Caches document embeddings for faster subsequent searches++### Parallel Processing++**Optimization:**+- Concurrent search queries+- Parallel LLM calls+- Async result processing+- Thread pool management++### Resource Management++**Features:**+- Token budget enforcement+- Request queuing+- Graceful degradation+++## Security Features++### Privacy Protection++- Local processing options+- No telemetry by default+- Secure credential storage+++## Related Documentation++- [Search Engines Guide](search-engines.md)+- [API Quickstart](api-quickstart.md)+- [Configuration Guide](env_configuration.md)+- [Troubleshooting](troubleshooting.md)+- [Analytics Dashboard](analytics-dashboard.md)diff --git a/docs/search-engines.md b/docs/search-engines.mdnew file mode 100644index 0000000000..3f7939160e--- /dev/null+++ b/docs/search-engines.md@@ -0,0 +1,247 @@+# Search Engines Guide++Local Deep Research integrates with multiple search engines to provide comprehensive research capabilities. This guide covers all available search engines, their specializations, and configuration details.++> **Note**: This documentation is maintained by the community and may contain inaccuracies. While we strive to keep it up-to-date, please verify critical information and report any errors via [GitHub Issues](https://github.com/LearningCircuit/local-deep-research/issues).++## Overview++LDR supports three categories of search engines:+- **Free Search Engines** - No API key required+- **Premium Search Engines** - Require API keys but offer enhanced features+- **Custom Sources** - Your own documents and databases++## Search Engine Selection++### Auto Engine (Recommended)++The `auto` search engine intelligently selects the most appropriate engines based on your query:++```python+result = quick_summary(+ query="What are the latest advances in quantum computing?",+ search_tool="auto" # Automatically selects best engines+)+```++## Free Search Engines++### Academic Search Engines++#### arXiv+- **Specialization**: Scientific papers and preprints+- **Best for**: Physics, mathematics, computer science, biology+- **Results**: Direct access to research papers+- **Rate Limit**: Moderate - automatic retry on limits++#### PubMed+- **Specialization**: Biomedical and life science literature+- **Best for**: Medical research, clinical studies, biology+- **Results**: Abstracts and links to full papers+- **Rate Limit**: Generous - rarely hits limits++#### Semantic Scholar+- **Specialization**: Academic literature across all fields+- **Best for**: Cross-disciplinary research, citation networks+- **Results**: Paper summaries with citation context+- **Rate Limit**: Moderate - adaptive rate limiting handles this++### General Purpose++#### Wikipedia+- **Specialization**: General knowledge and encyclopedic information+- **Best for**: Background information, concepts, facts+- **Results**: Well-structured article content+- **Rate Limit**: Very generous++#### SearXNG (Highly Recommended)+- **Specialization**: Meta-search engine aggregating multiple sources+- **Best for**: Comprehensive web search with privacy+- **Results**: Aggregated results from Google, Bing, DuckDuckGo, etc.+- **Setup**:+ ```bash+ docker pull searxng/searxng+ docker run -d -p 8080:8080 --name searxng searxng/searxng+ ```+- **Configuration**: Set URL to `http://localhost:8080` in settings++#### DuckDuckGo+- **Specialization**: Privacy-focused web search+- **Best for**: General web queries without tracking+- **Results**: Web pages, instant answers+- **Rate Limit**: Strict - use SearXNG for better reliability++### Technical Search++#### GitHub+- **Specialization**: Code repositories and documentation+- **Best for**: Finding code examples, libraries, technical solutions+- **Results**: Repository information, code snippets, issues+- **Rate Limit**: Moderate when unauthenticated++#### Elasticsearch+- **Specialization**: Custom search within your Elasticsearch cluster+- **Best for**: Searching your own indexed data+- **Configuration**: See [Elasticsearch Setup Guide](elasticsearch_search_engine.md)++### Historical Search++#### Wayback Machine+- **Specialization**: Historical web content+- **Best for**: Finding deleted content, tracking changes over time+- **Results**: Archived web pages with timestamps+- **Rate Limit**: Moderate++### News Search++#### The Guardian+- **Specialization**: News articles and journalism+- **Best for**: Current events, news analysis+- **Results**: Recent news articles+- **Note**: Requires API key (free tier available at https://open-platform.theguardian.com/)++## Premium Search Engines++### Tavily+- **Specialization**: AI-optimized search for LLM applications+- **Best for**: High-quality, relevant results for AI research+- **Pricing**: Free tier available, paid plans for higher volume+- **Configuration**:+ ```bash+ # In .env file or web interface+ LDR_SEARCH_ENGINE_TAVILY_API_KEY=your-key-here+ ```++### Google (via SerpAPI)+- **Specialization**: Comprehensive web search+- **Best for**: Most current and comprehensive results+- **Pricing**: Paid service with free trial+- **Configuration**:+ ```bash+ LDR_SEARCH_ENGINE_WEB_SERPAPI_API_KEY=your-key-here+ ```++### Google Programmable Search Engine+- **Specialization**: Customizable Google search+- **Best for**: Searching specific sites or topics+- **Pricing**: Free tier with limits+- **Configuration**:+ ```bash+ LDR_SEARCH_ENGINE_WEB_GOOGLE_PSE_API_KEY=your-key-here+ LDR_SEARCH_ENGINE_WEB_GOOGLE_PSE_ENGINE_ID=your-engine-id+ ```++### Brave Search+- **Specialization**: Independent search index with privacy focus+- **Best for**: Web search without big tech tracking+- **Pricing**: Free tier available+- **Configuration**:+ ```bash+ LDR_SEARCH_ENGINE_WEB_BRAVE_API_KEY=your-key-here+ ```++## Custom Sources++### Local Documents+- **Specialization**: Search your private documents+- **Supported formats**: PDF, TXT, MD, DOCX, CSV, and more+- **Configuration**: See [Configuring Local Search](https://github.com/LearningCircuit/local-deep-research/wiki/Configuring-Local-Search)+- **Setup**:+ 1. Go to Settings → Search for "local"+ 2. Add document collection paths+ 3. Choose embedding model (CPU or Ollama)+ 4. First search will index documents++### LangChain Retrievers+- **Specialization**: Any vector store or database+- **Supported**: FAISS, Chroma, Pinecone, Weaviate, Elasticsearch+- **Configuration**: See [LangChain Integration Guide](LANGCHAIN_RETRIEVER_INTEGRATION.md)+++## Search Performance Comparison++| Engine | Speed | Quality | Privacy | Rate Limits |+|--------|-------|---------|---------|-------------|+| SearXNG | ★★★★★ | ★★★★☆ | ★★★★★ | ★★★★★ |+| Wikipedia | ★★★★☆ | ★★★★☆ | ★★★★★ | ★★★★★ |+| arXiv | ★★★★☆ | ★★★★★ | ★★★★★ | ★★★☆☆ |+| PubMed | ★★★★☆ | ★★★★★ | ★★★★★ | ★★★★☆ |+| Tavily | ★★★★☆ | ★★★★★ | ★★★☆☆ | ★★★★☆ |+| Google (SerpAPI) | ★★★★☆ | ★★★★★ | ★★☆☆☆ | ★★★★★ |+| Local Documents | ★★★☆☆ | ★★★★★ | ★★★★★ | ★★★★★ |++## Rate Limiting and Reliability++LDR includes intelligent adaptive rate limiting that:+- Learns optimal wait times for each engine+- Automatically retries failed requests+- Prevents your IP from being blocked+- Maintains high reliability++### Managing Rate Limits++```bash+# Check rate limit status+python -m local_deep_research.web_search_engines.rate_limiting status++# Reset rate limits if needed+python -m local_deep_research.web_search_engines.rate_limiting reset+```++## Search Strategies++LDR supports multiple search strategies that determine how queries are processed:++- **source-based**: Single query, fast results+- **focused_iteration**: Iterative refinement for accuracy (recommended)++## Best Practices++1. **For General Research**: Use `auto` or `searxng`+2. **For Academic Research**: Combine `arxiv`, `pubmed`, and `semantic_scholar`+3. **For Technical Questions**: Use `github` with `searxng`+4. **For Maximum Privacy**: Use `searxng` with local Ollama models+5. **For Best Quality**: Use `tavily` or Google with `focused_iteration` strategy++## Troubleshooting++### SearXNG Not Working+- Verify container is running: `docker ps | grep searxng`+- Check URL in settings: `http://localhost:8080`+- Test directly: `curl http://localhost:8080`+- Check the logs: `docker logs searxng` or view them in the LDR web UI++### Rate Limit Errors+- Wait a few minutes and retry+- Use `auto` engine for automatic fallbacks+- Consider adding premium engines for higher limits++### No Results Found+- Try different search engines+- Broaden your query+- Check internet connectivity+- Verify API keys for premium engines++## Advanced Configuration++### Configuring Search Engines++You can enable/disable specific search engines and adjust their reliability parameters in the settings. This affects which engines are used in 'auto' mode and how the system handles rate limiting.++### Parallel Search Configuration++Adjust parallel search settings:+```python+result = quick_summary(+ query="your query",+ max_parallel_searches=5, # Number of engines to query simultaneously+ timeout_per_engine=30 # Seconds per engine+)+```++## Related Documentation++- [API Quickstart](api-quickstart.md)+- [Configuration Guide](env_configuration.md)+- [LangChain Integration](LANGCHAIN_RETRIEVER_INTEGRATION.md)+- [Elasticsearch Setup](elasticsearch_search_engine.md)