~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: Address djpetti's code review feedback
LearningCircuit977f8da17e41
diff --git a/src/local_deep_research/defaults/settings/search_engines/paperless.json b/src/local_deep_research/defaults/settings/search_engines/paperless.jsonindex 27dc06067f..d4cf6f7702 100644--- a/src/local_deep_research/defaults/settings/search_engines/paperless.json+++ b/src/local_deep_research/defaults/settings/search_engines/paperless.json@@ -243,9 +243,9 @@"type": "SEARCH","ui_element": "json","value": [- "limited to your archive",- "no web content",- "requires setup"+ "keyword-based search only",+ "no semantic understanding",+ "limited query operators"],"visible": true}diff --git a/src/local_deep_research/web_search_engines/engines/search_engine_paperless.py b/src/local_deep_research/web_search_engines/engines/search_engine_paperless.pyindex 6b0a14a68a..3d259bbe97 100644--- a/src/local_deep_research/web_search_engines/engines/search_engine_paperless.py+++ b/src/local_deep_research/web_search_engines/engines/search_engine_paperless.py@@ -21,9 +21,9 @@ class PaperlessSearchEngine(BaseSearchEngine):"""Paperless-ngx search engine implementation with full LDR integration."""# Class constants for magic numbers- MAX_SNIPPET_LENGTH = None # No limit on snippet length for better research- SNIPPET_CONTEXT_BEFORE = 2000 # Characters before matched term in snippet- SNIPPET_CONTEXT_AFTER = 8000 # Characters after matched term in snippet+ MAX_SNIPPET_LENGTH = 3000 # Reasonable limit to avoid context window issues+ SNIPPET_CONTEXT_BEFORE = 500 # Characters before matched term in snippet+ SNIPPET_CONTEXT_AFTER = 2500 # Characters after matched term in snippetdef __init__(self,@@ -184,7 +184,9 @@ Convert this query into keywords that would appear in documents.Query: "{query}"Output format: keyword1 OR keyword2 OR "multi word phrase" OR keyword3-Include synonyms, plural forms, and technical terms."""+Include synonyms, plural forms, and technical terms.++IMPORTANT: Output ONLY the search query. No explanations, no additional text."""logger.debug(f"Sending query expansion prompt to LLM for: '{query}'"@@ -477,11 +479,19 @@ Include synonyms, plural forms, and technical terms."""f"Cleaned snippet (first 200 chars): {snippet[:200]}")- # Limit snippet length while preserving context - use 10000 chars for research- if len(snippet) > 10000:- # Try to cut at word boundaries- snippet = snippet[:9997] + "..."- logger.debug("Truncated snippet to 10000 chars")+ # Limit snippet length to avoid context window issues+ if (+ self.MAX_SNIPPET_LENGTH+ and len(snippet) > self.MAX_SNIPPET_LENGTH+ ):+ # Cut at word boundary to avoid mid-word truncation+ snippet = (+ snippet[: self.MAX_SNIPPET_LENGTH].rsplit(" ", 1)[0]+ + "..."+ )+ logger.debug(+ f"Truncated snippet to {self.MAX_SNIPPET_LENGTH} chars"+ )# Get search relevance metadatasearch_score = search_hit.get("score", 0.0)@@ -615,7 +625,7 @@ Include synonyms, plural forms, and technical terms.""")# Check if we have multiple highlights to return as separate results- if "all_highlights" in locals() and len(all_highlights) > 1:+ if len(all_highlights) > 1:# Create multiple previews, one for each highlightpreviews = []for i, highlight in enumerate(all_highlights):