~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
feat: Give refinement LLM more freedom to improve research quality
LearningCircuit6bb5afc18945
diff --git a/src/local_deep_research/advanced_search_system/strategies/iterative_refinement_strategy.py b/src/local_deep_research/advanced_search_system/strategies/iterative_refinement_strategy.pyindex 8111962d49..e2479fa9dc 100644--- a/src/local_deep_research/advanced_search_system/strategies/iterative_refinement_strategy.py+++ b/src/local_deep_research/advanced_search_system/strategies/iterative_refinement_strategy.py@@ -373,35 +373,34 @@ Current Research Findings:Number of sources found: {sources_count}Previous gaps identified: {", ".join(previous_gaps) if previous_gaps else "None"}-Your task:-1. Evaluate if the current research adequately answers the original query-2. Identify any significant gaps, missing information, or areas needing clarification-3. Determine if refinement would meaningfully improve the answer-4. If refinement is needed, create a specific follow-up query--Consider:-- Completeness: Does the research fully address the query?-- Accuracy: Is there conflicting information that needs resolution?-- Specificity: Are there vague areas that need more detail?-- Evidence: Is there sufficient supporting evidence?--IMPORTANT CONSTRAINTS:-- Keep refinement query under 50 words-- Focus on ONE specific gap or aspect-- Be concrete and specific-- DO NOT create long, multi-part queries+Your task is to critically evaluate these research results and decide what would most improve them.++Key questions to consider:+- Are the main entities/companies mentioned still active and correctly described?+- Is the information current and up-to-date?+- Are we missing obvious major players or important aspects?+- Are there any suspicious claims that need verification?+- Does the answer fully address what was asked?+- Are there contradictions or inconsistencies?++You have complete freedom to:+- Ask verification questions ("Is X company still active in this field?")+- Challenge assumptions ("Shouldn't Y also be considered a leader?")+- Request missing perspectives ("What about competitor Z's approach?")+- Seek recent updates ("What's the latest status as of 2024/2025?")+- Explore contradictions ("Source says X but that conflicts with Y")Respond in JSON format:{{"action": "REFINE" or "COMPLETE",- "confidence": 0.0 to 1.0 (how confident you are the research is complete),- "gaps": ["list", "of", "identified", "gaps"],- "reasoning": "Brief explanation of your decision",- "refinement_query": "Specific follow-up question if action is REFINE (MAX 50 WORDS), otherwise null"+ "confidence": 0.0 to 1.0 (your honest assessment of completeness/accuracy),+ "gaps": ["list", "of", "identified", "gaps", "or", "concerns"],+ "reasoning": "Your honest evaluation - what's good, what's problematic, what's missing",+ "refinement_query": "If action is REFINE, ask whatever question would most improve the research - be creative and thorough"}}-Be selective with refinement - only suggest it if it would significantly improve the answer.-Focus refinement queries on the most critical gaps."""+Be critical and thorough. It's better to verify and be sure than to present incorrect information.+Your refinement query can be as long and specific as needed to get good results."""try:response = self.model.invoke(prompt)