~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
fix(db): correct misleading comments about cleanup rate-limiting (#3174)
LearningCircuitd69d3da7c781
diff --git a/src/local_deep_research/database/encrypted_db.py b/src/local_deep_research/database/encrypted_db.pyindex 01ae43ba34..da775d8d88 100644--- a/src/local_deep_research/database/encrypted_db.py+++ b/src/local_deep_research/database/encrypted_db.py@@ -772,11 +772,10 @@ class DatabaseManager:Why we sweep anyway:1. Prevents unbounded memory growth in _thread_engines dict- 2. Cleans up associated credentials from thread_local_session- 3. Defense-in-depth: if @thread_cleanup fails to fire (e.g.+ 2. Defense-in-depth: if @thread_cleanup fails to fire (e.g.interpreter crash, daemon thread killed at shutdown), thiscatches the leftovers- 4. Provides observability via log messages+ 3. Provides observability via log messagesKnown limitation: Python recycles thread IDs. A new thread couldget the same ID as a dead thread. The sweep checksdiff --git a/src/local_deep_research/database/thread_local_session.py b/src/local_deep_research/database/thread_local_session.pyindex 32da527419..f01150d127 100644--- a/src/local_deep_research/database/thread_local_session.py+++ b/src/local_deep_research/database/thread_local_session.py@@ -168,7 +168,7 @@ class ThreadLocalSessionManager:Called from:- processor_v2.py: every ~60s in the queue loop- - app_factory.py: in teardown_appcontext (rate-limited)+ - app_factory.py: in teardown_appcontext (engine sweep rate-limited)- connection_cleanup.py: in cleanup_idle_connections (every ~300s)"""alive_ids = {t.ident for t in threading.enumerate()}diff --git a/src/local_deep_research/web/auth/connection_cleanup.py b/src/local_deep_research/web/auth/connection_cleanup.pyindex 1c34343236..c3db0347db 100644--- a/src/local_deep_research/web/auth/connection_cleanup.py+++ b/src/local_deep_research/web/auth/connection_cleanup.py@@ -73,7 +73,8 @@ def cleanup_idle_connections(session_manager, db_manager):# Sweep dead-thread engines and sessions — safety net when neither HTTP# requests nor the queue processor are triggering sweeps.- # Rate-limited internally to at most once per 60 seconds.+ # Engine sweep is rate-limited internally (at most once per 60s);+ # session sweep runs unconditionally but is lightweight.cleanup_dead_threads()