~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
✅ Sync main to dev - sync-main-to-dev-20250826-030710 (#713)
LearningCircuit1084674b032d
diff --git a/.github/workflows/accessibility-compliance-tests.yml b/.github/workflows/accessibility-compliance-tests.ymlindex 0543bae69a..ad3935e31a 100644--- a/.github/workflows/accessibility-compliance-tests.yml+++ b/.github/workflows/accessibility-compliance-tests.yml@@ -13,7 +13,7 @@ jobs:timeout-minutes: 20steps:- - uses: actions/checkout@v3+ - uses: actions/checkout@v5- name: Set up PDMuses: pdm-project/setup-pdm@v4@@ -21,7 +21,7 @@ jobs:python-version: '3.11'- name: Cache pip packages- uses: actions/cache@v3+ uses: actions/cache@v4with:path: ~/.cache/pipkey: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}diff --git a/.github/workflows/check-env-vars.yml b/.github/workflows/check-env-vars.ymlindex 9715b367f5..5413fbb7a8 100644--- a/.github/workflows/check-env-vars.yml+++ b/.github/workflows/check-env-vars.yml@@ -18,7 +18,7 @@ jobs:runs-on: ubuntu-lateststeps:- - uses: actions/checkout@v4+ - uses: actions/checkout@v5- name: Set up Pythonuses: actions/setup-python@v5diff --git a/.github/workflows/critical-ui-tests.yml b/.github/workflows/critical-ui-tests.ymlindex facc9aeecb..2913dd7945 100644--- a/.github/workflows/critical-ui-tests.yml+++ b/.github/workflows/critical-ui-tests.yml@@ -15,7 +15,7 @@ jobs:# No services needed - using SQLite databasessteps:- - uses: actions/checkout@v3+ - uses: actions/checkout@v5- name: Set up PDMuses: pdm-project/setup-pdm@v4@@ -23,7 +23,7 @@ jobs:python-version: '3.11'- name: Cache pip packages- uses: actions/cache@v3+ uses: actions/cache@v4with:path: ~/.cache/pipkey: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}diff --git a/.github/workflows/extended-ui-tests.yml b/.github/workflows/extended-ui-tests.ymlindex cf39f66ada..c27ee23d2e 100644--- a/.github/workflows/extended-ui-tests.yml+++ b/.github/workflows/extended-ui-tests.yml@@ -16,7 +16,7 @@ jobs:name: Extended UI Test Suitesteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@v5- name: Set up Pythonuses: actions/setup-python@v5diff --git a/.github/workflows/followup-research-tests.yml b/.github/workflows/followup-research-tests.ymlindex cfaf0f5127..7cf8e98b46 100644--- a/.github/workflows/followup-research-tests.yml+++ b/.github/workflows/followup-research-tests.yml@@ -23,7 +23,7 @@ jobs:timeout-minutes: 30steps:- - uses: actions/checkout@v4+ - uses: actions/checkout@v5- name: Set up Pythonuses: actions/setup-python@v5@@ -31,7 +31,7 @@ jobs:python-version: '3.11'- name: Install PDM- uses: pdm-project/setup-pdm@v3+ uses: pdm-project/setup-pdm@v4with:python-version: '3.11'cache: truediff --git a/.github/workflows/metrics-analytics-tests.yml b/.github/workflows/metrics-analytics-tests.ymlindex 72d94d3054..b7a289b62c 100644--- a/.github/workflows/metrics-analytics-tests.yml+++ b/.github/workflows/metrics-analytics-tests.yml@@ -21,7 +21,7 @@ jobs:name: Metrics & Analytics Test Suitesteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@v5- name: Set up Pythonuses: actions/setup-python@v5diff --git a/.github/workflows/news-tests.yml b/.github/workflows/news-tests.ymlindex 39a837b31e..53c88d4fa7 100644--- a/.github/workflows/news-tests.yml+++ b/.github/workflows/news-tests.yml@@ -17,7 +17,7 @@ jobs:name: News Feature Test Suitesteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@v5- name: Set up Pythonuses: actions/setup-python@v5diff --git a/.github/workflows/performance-tests.yml b/.github/workflows/performance-tests.ymlindex 879a6aa13a..8ad521a5b2 100644--- a/.github/workflows/performance-tests.yml+++ b/.github/workflows/performance-tests.yml@@ -27,7 +27,7 @@ jobs:- 6379:6379steps:- - uses: actions/checkout@v3+ - uses: actions/checkout@v5- name: Set up PDMuses: pdm-project/setup-pdm@v4@@ -35,7 +35,7 @@ jobs:python-version: '3.11'- name: Cache pip packages- uses: actions/cache@v3+ uses: actions/cache@v4with:path: ~/.cache/pipkey: ${{ runner.os }}-pip-perf-${{ hashFiles('**/requirements.txt') }}diff --git a/.github/workflows/security-tests.yml b/.github/workflows/security-tests.ymlindex 8440469c81..b8169cf909 100644--- a/.github/workflows/security-tests.yml+++ b/.github/workflows/security-tests.yml@@ -31,7 +31,7 @@ jobs:- 5432:5432steps:- - uses: actions/checkout@v3+ - uses: actions/checkout@v5- name: Set up Python 3.11uses: actions/setup-python@v5@@ -39,7 +39,7 @@ jobs:python-version: '3.11'- name: Cache pip packages- uses: actions/cache@v3+ uses: actions/cache@v4with:path: ~/.cache/pipkey: ${{ runner.os }}-pip-security-${{ hashFiles('**/requirements.txt') }}diff --git a/.github/workflows/text-optimization-tests.yml b/.github/workflows/text-optimization-tests.ymlindex a3295b0fec..5cc1b96e8f 100644--- a/.github/workflows/text-optimization-tests.yml+++ b/.github/workflows/text-optimization-tests.yml@@ -19,7 +19,7 @@ jobs:name: Text Optimization Module Testssteps:- - uses: actions/checkout@v4+ - uses: actions/checkout@v5- name: Set up Pythonuses: actions/setup-python@v5@@ -50,7 +50,7 @@ jobs:pdm run pytest tests/text_optimization/ --cov=src/local_deep_research/text_optimization --cov-report=xml --cov-report=term- name: Upload coverage reports- uses: codecov/codecov-action@v3+ uses: codecov/codecov-action@v5with:file: ./coverage.xmlflags: text-optimizationdiff --git a/Dockerfile b/Dockerfileindex 93f6172c90..7f9930810f 100644--- a/Dockerfile+++ b/Dockerfile@@ -136,6 +136,12 @@ RUN playwright install# Create volume for persistent configurationVOLUME /root/.config/local_deep_research+# Create volume for Ollama start script+VOLUME /scripts/+# Copy the Ollama entrypoint script+ADD scripts/ollama_entrypoint.sh /scripts/ollama_entrypoint.sh+RUN chmod +x /scripts/ollama_entrypoint.sh+EXPOSE 5000STOPSIGNAL SIGINTdiff --git a/README.md b/README.mdindex bf1b63e3a4..39ccde18e5 100644--- a/README.md+++ b/README.md@@ -107,6 +107,13 @@ you can get up and running quickly.```bashcurl -O https://raw.githubusercontent.com/LearningCircuit/local-deep-research/main/docker-compose.yml && docker compose up -d```++Use with a different model:++```bash+MODEL=gemma:1b curl -O https://raw.githubusercontent.com/LearningCircuit/local-deep-research/main/docker-compose.yml && docker compose up -d+```+Open http://localhost:5000 after ~30 seconds. This starts LDR with SearXNG and all dependencies.#### Option 2b: DIY docker-composediff --git a/cookiecutter-docker/hooks/post_gen_project.py b/cookiecutter-docker/hooks/post_gen_project.pyindex 069ad7eac0..1ae53867d4 100644--- a/cookiecutter-docker/hooks/post_gen_project.py+++ b/cookiecutter-docker/hooks/post_gen_project.py@@ -14,12 +14,6 @@ def main():output_dir = compose_path.parent.absolute()compose_path.rename(output_dir.parent / COMPOSE_FILE_NAME)- # Move the entrypoint script to the scripts directory.- entrypoint_path = output_dir / "ollama_entrypoint.sh"- entrypoint_path.rename(- output_dir.parent / "scripts" / "ollama_entrypoint.sh"- )-# Delete the directory.shutil.rmtree(output_dir)diff --git a/cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.yml b/cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.ymlindex 881bb79eb7..b63ce0d87f 100644--- a/cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.yml+++ b/cookiecutter-docker/{{cookiecutter.config_name}}/docker-compose.{{cookiecutter.config_name}}.yml@@ -31,6 +31,7 @@ services:- LDR_DATA_DIR=/datavolumes:- ldr_data:/data+ - ldr_scripts:/scripts- ./local_collections/personal_notes:/local_collections/personal_notes/- ./local_collections/project_docs:/local_collections/project_docs/- ./local_collections/research_papers:/local_collections/research_papers/@@ -55,9 +56,9 @@ services:image: ollama/ollama:latest{% endif %}container_name: ollama_service- entrypoint: [ "/scripts/ollama_entrypoint.sh" ]+ entrypoint: "/scripts/ollama_entrypoint.sh ${MODEL:-gemma3:12b}"healthcheck:- test: [ "CMD", "ollama", "show", "{{ cookiecutter._ollama_model }}" ]+ test: [ "CMD", "ollama", "show", "${MODEL:-{{ cookiecutter._ollama_model }}}" ]interval: 10stimeout: 5sstart_period: 10m@@ -66,6 +67,7 @@ services:OLLAMA_KEEP_ALIVE: '30m'volumes:- ollama_data:/root/.ollama+ - ldr_scripts:/scripts- ./scripts/:/scripts/{%- if not cookiecutter.host_network %}networks:@@ -104,6 +106,7 @@ services:volumes:ldr_data:+ ldr_scripts:ollama_data:searxng_data:diff --git a/cookiecutter-docker/{{cookiecutter.config_name}}/ollama_entrypoint.sh b/cookiecutter-docker/{{cookiecutter.config_name}}/ollama_entrypoint.shdeleted file mode 100755index 950ac6e068..0000000000--- a/cookiecutter-docker/{{cookiecutter.config_name}}/ollama_entrypoint.sh+++ /dev/null@@ -1,27 +0,0 @@-#!/bin/bash--set -e--# Start the main Ollama application-ollama serve &--# Wait for the Ollama application to be ready (optional, if necessary)-while ! ollama ls; do- echo "Waiting for Ollama service to be ready..."- sleep 10-done-echo "Ollama service is ready."--# Pull the model using ollama pull-echo "Pulling the {{ cookiecutter._ollama_model }} with ollama pull..."-ollama pull {{ cookiecutter._ollama_model }}-# Check if the model was pulled successfully-if [ $? -eq 0 ]; then- echo "Model pulled successfully."-else- echo "Failed to pull model."- exit 1-fi--# Run ollama forever.-sleep infinitydiff --git a/docker-compose.yml b/docker-compose.ymlindex 9fc9b3159c..d028d4aff6 100644--- a/docker-compose.yml+++ b/docker-compose.yml@@ -20,6 +20,7 @@ services:- LDR_DATA_DIR=/datavolumes:- ldr_data:/data+ - ldr_scripts:/scripts- ./local_collections/personal_notes:/local_collections/personal_notes/- ./local_collections/project_docs:/local_collections/project_docs/- ./local_collections/research_papers:/local_collections/research_papers/@@ -43,9 +44,9 @@ services:capabilities: [ gpu ]container_name: ollama_service- entrypoint: [ "/scripts/ollama_entrypoint.sh" ]+ entrypoint: "/scripts/ollama_entrypoint.sh ${MODEL:-gemma3:4b}"healthcheck:- test: [ "CMD", "ollama", "show", "gemma3:12b" ]+ test: [ "CMD", "ollama", "show", "${MODEL:-gemma3:12b}" ]interval: 10stimeout: 5sstart_period: 10m@@ -54,6 +55,7 @@ services:OLLAMA_KEEP_ALIVE: '30m'volumes:- ollama_data:/root/.ollama+ - ldr_scripts:/scripts- ./scripts/:/scripts/networks:- ldr-network@@ -74,6 +76,7 @@ services:volumes:ldr_data:+ ldr_scripts:ollama_data:searxng_data:networks:diff --git a/docs/DATA_MIGRATION_GUIDE.md b/docs/DATA_MIGRATION_GUIDE.mddeleted file mode 100644index e21bc3c1d4..0000000000--- a/docs/DATA_MIGRATION_GUIDE.md+++ /dev/null@@ -1,178 +0,0 @@-# Data Migration Guide--> **⚠️ Important Note for v1.0**: The upcoming v1.0 release does not support automatic database migration from previous versions. This guide is provided for reference, but users upgrading to v1.0 will need to start with a fresh database. We recommend exporting any important data (API keys, research results) before upgrading.--## Overview--Local Deep Research has updated its data storage locations to improve security and follow platform best practices. Previously, data files were stored alongside the application source code. Now, they are stored in user-specific directories that vary by operating system.--This guide will help you migrate your existing data to the new locations. We recommend creating a backup of your data before proceeding.--## New Storage Locations--The application now stores data in platform-specific user directories:--- **Windows**: `C:\Users\<YourUsername>\AppData\Local\local-deep-research`-- **macOS**: `~/Library/Application Support/local-deep-research`-- **Linux**: `~/.local/share/local-deep-research`--## What Needs to be Migrated--The following data will be migrated automatically when possible:--1. **Database files** (*.db) - Contains your API keys, research history, and settings-2. **Research outputs** - Your generated research reports and findings-3. **Cache files** - Cached pricing information and search results-4. **Log files** - Application logs-5. **Benchmark results** - Performance benchmark data-6. **Optimization results** - LLM optimization data--## Migration Options--> **Note**: These migration options are not available in v1.0. Please see the warning at the top of this document.--### Option 1: Automatic Migration (Recommended for User Installs)--If you installed Local Deep Research with `pip install --user`, the automatic migration should work:--```bash-# Simply run the application-python -m local-deep_research.web.app-```--The application will automatically detect and migrate your data on startup.--### Option 2: Run Application with Administrator Privileges--If you installed with `sudo pip install` or have permission issues, run the application once with administrator privileges:--```bash-# Run the application with sudo to allow migration-sudo python -m local_deep_research.web.app-```--This will:-- Grant the necessary permissions for the automatic migration-- Move all data files to the new user-specific directories-- Complete the migration process-- After this, you can run normally without sudo--### Option 3: Manual Migration--If you prefer to migrate manually or the automatic options don't work:--#### Step 1: Find Your Current Data Location--```bash-# Find where the application is installed-python -c "import local_deep_research; import os; print(os.path.dirname(local_deep_research.__file__))"-```--#### Step 2: Identify Files to Migrate--Look for these files/directories in the installation directory:-- `data/ldr.db` (and any other .db files)-- `research_outputs/` directory-- `data/cache/` directory-- `data/logs/` directory-- `data/benchmark_results/` directory-- `data/optimization_results/` directory--#### Step 3: Create New Directories--```bash-# Linux/macOS-mkdir -p ~/.local/share/local-deep-research--# Windows (PowerShell)-New-Item -ItemType Directory -Force -Path "$env:LOCALAPPDATA\local-deep-research"-```--#### Step 4: Move Your Data--**Important**: Back up your data before moving!--```bash-# Example for Linux/macOS (adjust paths as needed)-# Move databases-sudo mv /usr/local/lib/python*/site-packages/local_deep_research/data/*.db ~/.local/share/local-deep-research/--# Move research outputs-sudo mv /usr/local/lib/python*/site-packages/local_deep_research/research_outputs ~/.local/share/local-deep-research/--# Move other data directories-sudo mv /usr/local/lib/python*/site-packages/local_deep_research/data/cache ~/.local/share/local-deep-research/-sudo mv /usr/local/lib/python*/site-packages/local_deep_research/data/logs ~/.local/share/local-deep-research/-```--### Option 4: Start Fresh--If you don't need your existing data, you can simply:--1. Delete the old data files (requires administrator privileges for system installs)-2. Start using the application - it will create new files in the correct locations--## Troubleshooting--### Permission Denied Errors--If you see "permission denied" errors:--1. You likely have a system-wide installation (installed with `sudo pip install`)-2. Use Option 2 (Migration Helper) or Option 3 (Manual Migration) above-3. Administrator/sudo privileges will be required to move files from system directories--### Files Not Found--If the migration can't find your files:--1. Check if you have multiple Python installations-2. Verify where the application is installed (Step 1 in Manual Migration)-3. Look for data files in your current working directory--### Migration Partially Completed--If some files were migrated but others weren't:--1. Check the application logs for specific errors-2. Manually move any remaining files following Option 3-3. Ensure you have write permissions to the new directories--## Verifying Migration Success--After migration, verify everything worked:--```bash-# Check if files exist in new location (Linux/macOS)-ls -la ~/.local/share/local-deep-research/--# Check if files exist in new location (Windows PowerShell)-Get-ChildItem "$env:LOCALAPPDATA\local-deep-research"-```--You should see:-- `ldr.db` (and possibly other .db files)-- `research_outputs/` directory with your reports-- `cache/` directory-- `logs/` directory--## Security Benefits--This migration provides several security improvements:--1. **User Isolation**: Data is now stored in user-specific directories-2. **Proper Permissions**: User directories have appropriate access controls-3. **Package Updates**: Updates won't affect your data-4. **No System-Wide Access**: Your API keys and research data are private to your user account--## Getting Help--If you encounter issues:--1. Check the application logs in the new logs directory-2. Report issues at: https://github.com/LearningCircuit/local-deep-research/issues-3. Include your operating system and installation method (pip, pip --user, etc.)--## Reverting Migration (Not Recommended)--If you absolutely need to revert to the old behavior, you can set environment variables to override the new paths. However, this is not recommended for security reasons and may not be supported in future versions.diff --git a/scripts/ollama_entrypoint.sh b/scripts/ollama_entrypoint.shindex 631d945ec9..344dc4577b 100755--- a/scripts/ollama_entrypoint.sh+++ b/scripts/ollama_entrypoint.sh@@ -2,6 +2,19 @@set -e+# Function to display usage information+usage() {+ echo "Usage: $0 <model_name>"+ exit 1+}++# Check if a model name is provided as an argument+if [ "$#" -ne 1 ]; then+ usage+fi++MODEL_NAME=$1+# Start the main Ollama applicationollama serve &@@ -13,8 +26,8 @@ doneecho "Ollama service is ready."# Pull the model using ollama pull-echo "Pulling the gemma3:12b with ollama pull..."-ollama pull gemma3:12b+echo "Pulling the $MODEL_NAME with ollama pull..."+ollama pull $MODEL_NAME# Check if the model was pulled successfullyif [ $? -eq 0 ]; thenecho "Model pulled successfully."@@ -25,3 +38,4 @@ fi# Run ollama forever.sleep infinity+```