Skip to content

~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.

docs: link auto-generated Configuration Reference across docs & fix stale env var docs (#2472)

LearningCircuit890c84e534a4
diff --git a/docker-compose.yml b/docker-compose.yml
index 19e7b29e7f..115a6ed9c5 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -31,6 +31,8 @@ services:
ports:
- "5000:5000"
environment:
+ # ============================================================================
+ # Full configuration reference: docs/CONFIGURATION.md
# ============================================================================
# IMPORTANT: Almost all settings can be configured through the web interface.
#
diff --git a/docs/CUSTOM_LLM_INTEGRATION.md b/docs/CUSTOM_LLM_INTEGRATION.md
index 8e73359a8b..091d263437 100644
--- a/docs/CUSTOM_LLM_INTEGRATION.md
+++ b/docs/CUSTOM_LLM_INTEGRATION.md
@@ -272,4 +272,5 @@ Ensure your LLM:
- [API Documentation](api-quickstart.md)
- [Configuration Guide](env_configuration.md)
+- [Full Configuration Reference](CONFIGURATION.md)
- [LangChain Retriever Integration](LANGCHAIN_RETRIEVER_INTEGRATION.md)
diff --git a/docs/NOTIFICATIONS.md b/docs/NOTIFICATIONS.md
index aaa0f184b6..c49e41c897 100644
--- a/docs/NOTIFICATIONS.md
+++ b/docs/NOTIFICATIONS.md
@@ -259,3 +259,9 @@ except RateLimitError as e:
**Issue**: Notifications work in main thread but fail in background thread
- **Cause**: Using database session in background thread (not thread-safe)
- **Fix**: Use settings snapshot pattern as shown in migration guide above
+
+## See Also
+
+- [Full Configuration Reference](CONFIGURATION.md) - All notification settings, defaults, and environment variables
+- [News Subscriptions](news-subscriptions.md) - News subscription system
+- [Features](features.md) - Feature overview
diff --git a/docs/analytics-dashboard.md b/docs/analytics-dashboard.md
index 8b228671cc..1d94504444 100644
--- a/docs/analytics-dashboard.md
+++ b/docs/analytics-dashboard.md
@@ -241,5 +241,6 @@ curl http://localhost:5000/api/rate-limiting
- [Features Documentation](features.md)
- [Configuration Guide](env_configuration.md)
+- [Full Configuration Reference](CONFIGURATION.md)
- [API Documentation](api-quickstart.md)
- [Benchmarking Guide](BENCHMARKING.md)
diff --git a/docs/deployment/unraid.md b/docs/deployment/unraid.md
index c52892b9e6..8bdf8dab2a 100644
--- a/docs/deployment/unraid.md
+++ b/docs/deployment/unraid.md
@@ -420,14 +420,14 @@ To access LDR via custom domain on Unraid:
### External LLM and Search Configuration
For configuring external LLM providers or custom search engines, see the main configuration documentation:
-- [LLM Configuration](../configuration.md#llm-providers)
-- [Search Engine Configuration](../configuration.md#search-engines)
+- [Full Configuration Reference](../CONFIGURATION.md)
All WebUI settings work identically on Unraid as on other platforms.
## 📚 Additional Resources
- **Main Documentation:** [https://github.com/LearningCircuit/local-deep-research](https://github.com/LearningCircuit/local-deep-research)
+- **Configuration Reference:** [CONFIGURATION.md](../CONFIGURATION.md)
- **API Documentation:** [docs/api-quickstart.md](../api-quickstart.md)
- **FAQ:** [docs/faq.md](../faq.md)
- **Discord Support:** [https://discord.gg/ttcqQeFcJ3](https://discord.gg/ttcqQeFcJ3)
diff --git a/docs/developing/EXTENDING.md b/docs/developing/EXTENDING.md
index ac4d17946b..a71ac881c8 100644
--- a/docs/developing/EXTENDING.md
+++ b/docs/developing/EXTENDING.md
@@ -617,5 +617,6 @@ llm = get_llm_from_registry("my_factory")
- [Architecture Overview](../architecture/OVERVIEW.md) - System architecture
- [Database Schema](../architecture/DATABASE_SCHEMA.md) - Data models
+- [Full Configuration Reference](../CONFIGURATION.md) - All settings and environment variables
- [Troubleshooting](../troubleshooting.md) - Common issues
- [API Quickstart](../api-quickstart.md) - Using the API
diff --git a/docs/docker-compose-guide.md b/docs/docker-compose-guide.md
index d9ba4b5525..67ca524f7d 100644
--- a/docs/docker-compose-guide.md
+++ b/docs/docker-compose-guide.md
@@ -50,7 +50,7 @@ The base configuration includes:
### Key Environment Variables
-Most settings can be configured through the web UI at http://localhost:5000/settings. Environment variables **override** UI settings and lock them.
+Most settings can be configured through the web UI at http://localhost:5000/settings. Environment variables **override** UI settings and lock them. For the complete list of all environment variables and their defaults, see [CONFIGURATION.md](CONFIGURATION.md).
> **⚠️ Warning:** Setting environment variables causes a hard override—the setting becomes read-only in the UI and cannot be changed until the environment variable is removed. For settings you may want to adjust later, use the web UI instead. Environment variables are best suited for deployment-specific values like `LDR_DATA_DIR` or API keys.
@@ -190,5 +190,6 @@ docker compose down -v
- [README - Full Installation Guide](../README.md#-installation-options)
- [Environment Configuration](env_configuration.md)
+- [Full Configuration Reference](CONFIGURATION.md)
- [SearXNG Setup](SearXNG-Setup.md)
- [Unraid Deployment](deployment/unraid.md)
diff --git a/docs/env_configuration.md b/docs/env_configuration.md
index a3c1963650..0cb2bafd9d 100644
--- a/docs/env_configuration.md
+++ b/docs/env_configuration.md
@@ -13,82 +13,39 @@ You can override any configuration setting in Local Deep Research using environm
## Environment Variable Format
-Local Deep Research uses Dynaconf to manage configuration. The format for environment variables is:
+To override a setting, convert its key to uppercase, replace dots with underscores, and prefix with `LDR_`:
```
-LDR_SECTION__SETTING=value
+setting.key.name → LDR_SETTING_KEY_NAME
```
-Note the **double underscore** (`__`) between the section and setting name.
+For example:
+- `app.debug` → `LDR_APP_DEBUG`
+- `llm.model` → `LDR_LLM_MODEL`
+- `search.tool` → `LDR_SEARCH_TOOL`
-## Using .env Files in the Config Directory
+> **Important:** Environment variables **override** UI settings and lock them — the setting becomes read-only in the UI until the environment variable is removed. For settings you may want to adjust later, use the Web UI instead.
-The easiest way to configure settings is to create a `.env` file in your config directory:
-
-**Config Directory Locations:**
-- Windows: `%USERPROFILE%\Documents\LearningCircuit\local-deep-research\config\.env`
-- Linux/Mac: `~/.config/local_deep_research/config/.env`
-
-Simply create a text file named `.env` in this directory and add your settings:
-
-```
-# Example .env file contents
-LDR_WEB__PORT=8080
-LDR_SEARCH__TOOL=wikipedia
-LDR_GENERAL__ENABLE_FACT_CHECKING=true
-
-# API keys (see important note below)
-OPENAI_API_KEY=your-key-here
-LDR_OPENAI_API_KEY=your-key-here
-```
-
-This file is automatically loaded when Local Deep Research starts, and any settings specified here will override those in the main configuration files.
-
-## Important Note About API Keys
-
-**Known Bug**: Currently, API keys must be set **both with and without** the `LDR_` prefix for search engines to work properly:
-
-```bash
-# You need BOTH of these for each API key
-export OPENAI_API_KEY=your-key-here
-export LDR_OPENAI_API_KEY=your-key-here
-```
-
-This applies to all search-related API keys including:
-- `OPENAI_API_KEY`
-- `ANTHROPIC_API_KEY`
-- `SERP_API_KEY`
-- `BRAVE_API_KEY`
-- `GOOGLE_PSE_API_KEY`
-- `GOOGLE_PSE_ENGINE_ID`
-- `GUARDIAN_API_KEY`
-
-This issue will be fixed in a future update.
-
-## Examples
-
-| Config in settings.toml | Environment Variable | Example |
-|-------------------------|----------------------|---------|
-| `[web]` port = 5000 | `LDR_WEB__PORT` | `LDR_WEB__PORT=8080` |
-| `[search]` tool = "auto" | `LDR_SEARCH__TOOL` | `LDR_SEARCH__TOOL=wikipedia` |
-| `[general]` enable_fact_checking = false | `LDR_GENERAL__ENABLE_FACT_CHECKING` | `LDR_GENERAL__ENABLE_FACT_CHECKING=true` |
+For the complete list of all settings, their environment variable names, and default values, see [CONFIGURATION.md](CONFIGURATION.md).
## API Keys
-API keys are best set using environment variables for security (remember the current requirement for both prefixed and non-prefixed versions):
+API keys are best set using environment variables for security. Only the `LDR_` prefixed version is needed:
```bash
-# Set both versions for each API key
-ANTHROPIC_API_KEY=your-api-key-here
-LDR_ANTHROPIC_API_KEY=your-api-key-here
-
-OPENAI_API_KEY=your-openai-key-here
-LDR_OPENAI_API_KEY=your-openai-key-here
+# LLM API keys
+export LDR_LLM_OPENAI_API_KEY=your-openai-key-here
+export LDR_LLM_ANTHROPIC_API_KEY=your-anthropic-key-here
+export LDR_LLM_OPENROUTER_API_KEY=your-openrouter-key-here
-SERP_API_KEY=your-api-key-here
-LDR_SERP_API_KEY=your-api-key-here
+# Search engine API keys
+export LDR_SEARCH_ENGINE_WEB_BRAVE_API_KEY=your-brave-key-here
+export LDR_SEARCH_ENGINE_WEB_SERPAPI_API_KEY=your-serpapi-key-here
+export LDR_SEARCH_ENGINE_WEB_TAVILY_API_KEY=your-tavily-key-here
```
+For the full list of API key environment variables, see [CONFIGURATION.md](CONFIGURATION.md).
+
## LLM Provider Configuration
### OpenRouter
@@ -150,11 +107,9 @@ export LDR_LLM_MODEL="<your-model-name>"
For Docker deployments, you can pass environment variables when starting containers:
```bash
-docker run -p 8080:8080 \
- -e LDR_WEB__PORT=8080 \
- -e LDR_SEARCH__TOOL=wikipedia \
- -e OPENAI_API_KEY=your-key-here \
- -e LDR_OPENAI_API_KEY=your-key-here \
+docker run -p 5000:5000 \
+ -e LDR_LLM_OPENAI_API_KEY=your-api-key-here \
+ -e LDR_SEARCH_TOOL=wikipedia \
local-deep-research
```
@@ -163,27 +118,25 @@ docker run -p 8080:8080 \
### Changing the Web Port
```bash
-export LDR_WEB__PORT=8080 # Linux/Mac
-set LDR_WEB__PORT=8080 # Windows
+export LDR_APP_PORT=8080 # Linux/Mac
+set LDR_APP_PORT=8080 # Windows
```
-### Setting API Keys (with current dual requirement)
+### Setting API Keys
```bash
# Linux/Mac
-export ANTHROPIC_API_KEY=your-key-here
-export LDR_ANTHROPIC_API_KEY=your-key-here
+export LDR_LLM_ANTHROPIC_API_KEY=your-api-key-here
# Windows
-set ANTHROPIC_API_KEY=your-key-here
-set LDR_ANTHROPIC_API_KEY=your-key-here
+set LDR_LLM_ANTHROPIC_API_KEY=your-api-key-here
```
### Changing Search Engine
```bash
-export LDR_SEARCH__TOOL=wikipedia # Linux/Mac
-set LDR_SEARCH__TOOL=wikipedia # Windows
+export LDR_SEARCH_TOOL=wikipedia # Linux/Mac
+set LDR_SEARCH_TOOL=wikipedia # Windows
```
### Data Directory Location
@@ -208,40 +161,11 @@ All application data will be organized under this directory:
Database encryption settings are configured exclusively via environment variables (they cannot be changed through the Web UI). These settings are applied at database creation time and must remain consistent for the database to be accessible.
-| Setting | Canonical Env Var | Default |
-|---------|-------------------|---------|
-| KDF iterations | `LDR_DB_CONFIG_KDF_ITERATIONS` | `256000` |
-| Page size | `LDR_DB_CONFIG_PAGE_SIZE` | `16384` |
-| HMAC algorithm | `LDR_DB_CONFIG_HMAC_ALGORITHM` | `HMAC_SHA512` |
-| KDF algorithm | `LDR_DB_CONFIG_KDF_ALGORITHM` | `PBKDF2_HMAC_SHA512` |
-| Cache size (MB) | `LDR_DB_CONFIG_CACHE_SIZE_MB` | `64` |
-| Journal mode | `LDR_DB_CONFIG_JOURNAL_MODE` | `WAL` |
-| Synchronous mode | `LDR_DB_CONFIG_SYNCHRONOUS` | `NORMAL` |
-| Allow unencrypted DB | `LDR_BOOTSTRAP_ALLOW_UNENCRYPTED` | `false` |
-
-**Deprecated names:** The following older env var names still work but will be removed in a future release. If you are using them, please migrate to the canonical names above:
-
-| Deprecated Name | Canonical Replacement |
-|-----------------|----------------------|
-| `LDR_DB_KDF_ITERATIONS` | `LDR_DB_CONFIG_KDF_ITERATIONS` |
-| `LDR_DB_PAGE_SIZE` | `LDR_DB_CONFIG_PAGE_SIZE` |
-| `LDR_DB_HMAC_ALGORITHM` | `LDR_DB_CONFIG_HMAC_ALGORITHM` |
-| `LDR_DB_KDF_ALGORITHM` | `LDR_DB_CONFIG_KDF_ALGORITHM` |
-| `LDR_DB_CACHE_SIZE_MB` | `LDR_DB_CONFIG_CACHE_SIZE_MB` |
-| `LDR_DB_JOURNAL_MODE` | `LDR_DB_CONFIG_JOURNAL_MODE` |
-| `LDR_DB_SYNCHRONOUS` | `LDR_DB_CONFIG_SYNCHRONOUS` |
-| `LDR_ALLOW_UNENCRYPTED` | `LDR_BOOTSTRAP_ALLOW_UNENCRYPTED` |
-
-A deprecation warning is logged when a deprecated name is used. If both canonical and deprecated names are set, the canonical name takes precedence.
+For the full list of database configuration variables, defaults, constraints, and deprecated aliases, see the **Pre-Database (Env-Only) Settings** section in [CONFIGURATION.md](CONFIGURATION.md#pre-database-env-only-settings).
### CORS / WebSocket Security
-These settings control Cross-Origin Resource Sharing (CORS) for API routes and WebSocket connections. By default, API CORS is restricted to same-origin, and WebSocket allows all origins for broad compatibility.
-
-| Setting | Env Var | Default | Description |
-|---------|---------|---------|-------------|
-| API CORS origins | `LDR_SECURITY_CORS_ALLOWED_ORIGINS` | `""` (same-origin) | Allowed origins for API routes |
-| WebSocket origins | `LDR_SECURITY_WEBSOCKET_ALLOWED_ORIGINS` | `"*"` (all origins) | Allowed origins for Socket.IO connections |
+These settings control Cross-Origin Resource Sharing (CORS) for API routes and WebSocket connections. For the full list of security environment variables and their defaults, see [CONFIGURATION.md](CONFIGURATION.md#pre-database-env-only-settings).
**Values:**
- `*` — Allow all origins (most permissive)
diff --git a/docs/faq.md b/docs/faq.md
index 9f9a9f9733..f3cff4bad1 100644
--- a/docs/faq.md
+++ b/docs/faq.md
@@ -127,6 +127,8 @@ services:
3. Configure your preferences
4. Settings are saved to the database
+For a complete reference of all settings, defaults, and environment variables, see [CONFIGURATION.md](CONFIGURATION.md).
+
### 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.
@@ -319,7 +321,7 @@ Current limitation (#179). Workarounds:
- **Authentication errors**: Verify your API key is correct and has credits
- **Can't find OpenRouter in provider list**: Select "Custom OpenAI Endpoint" instead
-See also: [Environment Variables Documentation](env_configuration.md#openrouter)
+See also: [Environment Variables Documentation](env_configuration.md#openrouter) | [Full Configuration Reference](CONFIGURATION.md)
## Local Document Search
@@ -507,3 +509,4 @@ When reporting issues, include:
- [Features Documentation](features.md)
- [API Documentation](api-quickstart.md)
- [Configuration Guide](env_configuration.md)
+- [Full Configuration Reference](CONFIGURATION.md)
diff --git a/docs/features.md b/docs/features.md
index 41697d2753..569003becf 100644
--- a/docs/features.md
+++ b/docs/features.md
@@ -335,5 +335,6 @@ python -m local_deep_research.web_search_engines.rate_limiting reset
- [Search Engines Guide](search-engines.md)
- [API Quickstart](api-quickstart.md)
- [Configuration Guide](env_configuration.md)
+- [Full Configuration Reference](CONFIGURATION.md)
- [Troubleshooting](troubleshooting.md)
- [Analytics Dashboard](analytics-dashboard.md)
diff --git a/docs/library-and-rag.md b/docs/library-and-rag.md
index d9804837f2..1084a7bae4 100644
--- a/docs/library-and-rag.md
+++ b/docs/library-and-rag.md
@@ -290,4 +290,5 @@ Uses OpenAI's embedding API.
- [Architecture Overview](architecture/OVERVIEW.md) - System architecture
- [Extension Guide](developing/EXTENDING.md) - Adding custom retrievers
+- [Full Configuration Reference](CONFIGURATION.md) - All settings and environment variables
- [API Quickstart](api-quickstart.md) - Using the API
diff --git a/docs/metrics-dashboard.md b/docs/metrics-dashboard.md
index 8cdb2b0ad5..dc50bbed18 100644
--- a/docs/metrics-dashboard.md
+++ b/docs/metrics-dashboard.md
@@ -285,5 +285,6 @@ POST /metrics/api/ratings/<research_id>
## See Also
- [CLI Tools](cli-tools.md) - Rate limiting CLI
+- [Full Configuration Reference](CONFIGURATION.md) - All settings and environment variables
- [Troubleshooting](troubleshooting.md) - Common issues
- [Architecture Overview](architecture/OVERVIEW.md) - System design
diff --git a/docs/news-subscriptions.md b/docs/news-subscriptions.md
index efd9f2b0d7..3003b62f3d 100644
--- a/docs/news-subscriptions.md
+++ b/docs/news-subscriptions.md
@@ -293,5 +293,6 @@ response = requests.post(
## See Also
- [NOTIFICATIONS.md](NOTIFICATIONS.md) - Notification service setup
+- [Full Configuration Reference](CONFIGURATION.md) - All settings, defaults, and environment variables
- [API Quickstart](api-quickstart.md) - API authentication
- [Features](features.md) - Feature overview
diff --git a/docs/search-engines.md b/docs/search-engines.md
index 4c8ec9a5b9..e7b99a7b14 100644
--- a/docs/search-engines.md
+++ b/docs/search-engines.md
@@ -248,5 +248,6 @@ result = quick_summary(
- [API Quickstart](api-quickstart.md)
- [Configuration Guide](env_configuration.md)
+- [Full Configuration Reference](CONFIGURATION.md)
- [LangChain Integration](LANGCHAIN_RETRIEVER_INTEGRATION.md)
- [Elasticsearch Setup](elasticsearch_search_engine.md)
diff --git a/docs/troubleshooting-openai-api-key.md b/docs/troubleshooting-openai-api-key.md
index 933ecd4136..a53da37bcc 100644
--- a/docs/troubleshooting-openai-api-key.md
+++ b/docs/troubleshooting-openai-api-key.md
@@ -247,3 +247,9 @@ settings_manager.set_setting("llm.openai.organization", "org-your-org-id")
- Use environment variables for production
- Rotate keys regularly
- Set usage limits in OpenAI dashboard
+
+## See Also
+
+- [Full Configuration Reference](CONFIGURATION.md) - All settings, defaults, and environment variables
+- [Configuration Guide](env_configuration.md) - Environment variable setup guide
+- [Troubleshooting](troubleshooting.md) - General troubleshooting
diff --git a/src/local_deep_research/defaults/.env.template b/src/local_deep_research/defaults/.env.template
index 8f82afca53..0ec268e22e 100644
--- a/src/local_deep_research/defaults/.env.template
+++ b/src/local_deep_research/defaults/.env.template
@@ -1,15 +1,24 @@
-# API Keys
-# OPENAI_ENDPOINT_API_KEY=your-api-key-here
-# ANTHROPIC_API_KEY=your-api-key-here
-# OPENAI_API_KEY=your-openai-key-here
+# Local Deep Research - Environment Variables
+# Full Configuration Reference: https://github.com/LearningCircuit/local-deep-research/blob/main/docs/CONFIGURATION.md
+#
+# Environment variables OVERRIDE web UI settings and LOCK them (read-only in UI).
+# Format: LDR_ + setting key with dots replaced by underscores, UPPERCASED
+# Example: app.debug -> LDR_APP_DEBUG
+#
+# For most users, configure settings through the web UI at http://localhost:5000/settings
-# BRAVE_API_KEY=
-# SERP_API_KEY=your-api-key-here
-# GUARDIAN_API_KEY=your-api-key-here
-# GOOGLE_PSE_API_KEY=your-google-api-key-here
-# GOOGLE_PSE_ENGINE_ID=your-programmable-search-engine-id-here
+# LLM API Keys
+# LDR_LLM_OPENAI_ENDPOINT_API_KEY=your-api-key-here
+# LDR_LLM_ANTHROPIC_API_KEY=your-api-key-here
+# LDR_LLM_OPENAI_API_KEY=your-openai-key-here
+# Search Engine API Keys
+# LDR_SEARCH_ENGINE_WEB_BRAVE_API_KEY=
+# LDR_SEARCH_ENGINE_WEB_SERPAPI_API_KEY=your-api-key-here
+# LDR_SEARCH_ENGINE_WEB_GUARDIAN_API_KEY=your-api-key-here
+# LDR_SEARCH_ENGINE_WEB_GOOGLE_PSE_API_KEY=your-google-api-key-here
+# LDR_SEARCH_ENGINE_WEB_GOOGLE_PSE_ENGINE_ID=your-programmable-search-engine-id-here
-# SearXNG Configuration, add at least SEARXNG_INSTANCE to .env file to use this search engine
-# SEARXNG_INSTANCE = "http://localhost:8080"
-# SEARXNG_DELAY = 2.0
+# SearXNG Configuration
+# LDR_SEARCH_ENGINE_WEB_SEARXNG_DEFAULT_PARAMS_INSTANCE_URL=http://localhost:8080
+# LDR_SEARCH_ENGINE_WEB_SEARXNG_DEFAULT_PARAMS_DELAY_BETWEEN_REQUESTS=2.0
diff --git a/src/local_deep_research/web/templates/settings_dashboard.html b/src/local_deep_research/web/templates/settings_dashboard.html
index 45a6aa1be4..e5f1616209 100644
--- a/src/local_deep_research/web/templates/settings_dashboard.html
+++ b/src/local_deep_research/web/templates/settings_dashboard.html
@@ -31,6 +31,10 @@
<i class="fas fa-file-alt"></i> Docs
</a>
·
+ <a href="https://github.com/LearningCircuit/local-deep-research/blob/main/docs/CONFIGURATION.md" target="_blank" title="Complete reference of all settings, defaults, and environment variables">
+ <i class="fas fa-cogs"></i> Config Reference
+ </a>
+ ·
<a href="https://discord.gg/ttcqQeFcJ3" target="_blank" title="Get help from the community">
<i class="fab fa-discord"></i> Discord
</a>