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.

improved structure

LearningCircuit30c18a18d4be
diff --git a/.cursorrules.template b/.cursorrules.template
deleted file mode 100644
index e83a0dfc23..0000000000
--- a/.cursorrules.template
+++ /dev/null
@@ -1,18 +0,0 @@
-* Only modify code directly relevant to the specific request. Avoid changing unrelated functionality.
-* Break problems into smaller steps. Think through each step separately before implementing.
-* Always provide a complete PLAN with REASONING based on evidence from code and logs before making changes.
-* Explain your OBSERVATIONS clearly, then provide REASONING to identify the exact issue. Add console logs when needed to gather more information.
-* Use the tools that the framework provides. If there is a native way to do something in the framework, do it that way
-* Scan the whole project to better understand structure
-* Don't forget to fix all the UI/UX, always watch for directions of improvement
-* Follow the same dark UI-style
-* Don't break the code that is used in multiple modules
-* Check that all UI, db, backend models, requests, parameters are in sync, to avoid errors
-* Always use `.\.venv\Scripts\python.exe .\kill_servers.py; .\.venv\Scripts\python.exe .\app.py`
-* Wait until server restarts
-* Test everything thoroughly and edge cases
-* Templates should always have unique names
-* Never finish until you tested your code and can verify its working
-* Use PowerShell, we are on Windows
-* Remove all temporary code at the end, make sure the app is functional
-* Never commit to git yourself until I ask explicitly
\ No newline at end of file
diff --git a/examples/programmatic_access.ipynb b/examples/programmatic_access.ipynb
index 49c39048c5..8849f6f26b 100644
--- a/examples/programmatic_access.ipynb
+++ b/examples/programmatic_access.ipynb
@@ -236,7 +236,7 @@
],
"metadata": {
"kernelspec": {
- "display_name": "Python 3",
+ "display_name": "venv",
"language": "python",
"name": "python3"
},
@@ -250,7 +250,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
- "version": "3.8.10"
+ "version": "3.12.3"
}
},
"nbformat": 4,
diff --git a/src/local_deep_research/advanced_search_system/strategies/iterdrag_strategy.py b/src/local_deep_research/advanced_search_system/strategies/iterdrag_strategy.py
index 4866ef612b..6e4dbef9ba 100644
--- a/src/local_deep_research/advanced_search_system/strategies/iterdrag_strategy.py
+++ b/src/local_deep_research/advanced_search_system/strategies/iterdrag_strategy.py
@@ -297,13 +297,16 @@ Initial Search Results:
)
try:
- # Get a formatted version with search questions and sources included
- formatted_findings = self.findings_repository.synthesize_findings(
- query=query,
- sub_queries=sub_queries,
- findings=findings, # Pass full findings list
- accumulated_knowledge=final_answer,
- old_formatting=True, # Use old_formatting to format with questions and sources
+ # First, get just the synthesized content without formatting
+ if not isinstance(final_answer, str):
+ logger.error(
+ "final_answer is not a string, using current_knowledge as fallback"
+ )
+ final_answer = current_knowledge
+
+ # Now format the findings with search questions and sources
+ formatted_findings = self.findings_repository.format_findings_to_text(
+ findings, final_answer
)
except Exception as e:
logger.error(f"Error formatting final findings: {str(e)}")
diff --git a/src/local_deep_research/advanced_search_system/strategies/standard_strategy.py b/src/local_deep_research/advanced_search_system/strategies/standard_strategy.py
index 9fc44c59d8..1bbb4f3f2d 100644
--- a/src/local_deep_research/advanced_search_system/strategies/standard_strategy.py
+++ b/src/local_deep_research/advanced_search_system/strategies/standard_strategy.py
@@ -271,15 +271,22 @@ class StandardSearchStrategy(BaseSearchStrategy):
# Extract content from findings for synthesis
finding_contents = [f["content"] for f in findings if "content" in f]
- formatted_findings = self.findings_repository.synthesize_findings(
+ # First synthesize findings to get coherent content
+ synthesized_content = self.findings_repository.synthesize_findings(
query,
finding_contents,
findings, # Pass the full findings list with search results
accumulated_knowledge=current_knowledge,
- old_formatting=True, # Use old_formatting to format with questions and sources
+ old_formatting=False, # Don't format here, just synthesize content
)
- # Add the formatted findings to the repository
- self.findings_repository.add_finding(query, formatted_findings)
+
+ # Now format the findings with search questions and sources
+ formatted_findings = self.findings_repository.format_findings_to_text(
+ findings, synthesized_content
+ )
+
+ # Add the synthesized content to the repository
+ self.findings_repository.add_finding(query, synthesized_content)
self._update_progress("Research complete", 95, {"phase": "complete"})
diff --git a/src/local_deep_research/search_system.py b/src/local_deep_research/search_system.py
index bbc8027a77..b5bcc36045 100644
--- a/src/local_deep_research/search_system.py
+++ b/src/local_deep_research/search_system.py
@@ -12,7 +12,7 @@ logger = logging.getLogger(__name__)
class AdvancedSearchSystem:
- def __init__(self, strategy_name: str = "iterdrag"):
+ def __init__(self, strategy_name: str = "standard"):
"""
Initialize the advanced search system.