~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
merged main into pip
LearningCircuitd68f781c3812
diff --cc pyproject.tomlindex 9da8148392,0000000000..488e4e4889mode 100644,000000..100644--- a/pyproject.toml+++ b/pyproject.toml@@@ -1,63 -1,0 +1,63 @@@+[build-system]+requires = ["setuptools>=42", "wheel"]+build-backend = "setuptools.build_meta"++[project]+name = "local-deep-research"+version = "0.1.0"+description = "AI-powered research assistant with deep, iterative analysis using LLMs and web searches"+readme = "README.md"+requires-python = ">=3.8"+license = {file = "LICENSE"}+authors = [+ {name = "LearningCircuit", email = "[email protected]"},- {name = "HashedViking, email = "[email protected]}++ {name = "HashedViking", email = "[email protected]"}+]+classifiers = [+ "Programming Language :: Python :: 3",+ "License :: OSI Approved :: MIT License",+ "Operating System :: OS Independent",+]+dependencies = [+ "langchain>=0.3.18",+ "langchain-community>=0.3.17",+ "langchain-core>=0.3.34",+ "langchain-ollama>=0.2.3",+ "langchain-openai>=0.3.5",+ "langchain_anthropic>=0.3.7",+ "duckduckgo_search>=7.3.2",+ "python-dateutil>=2.9.0",+ "typing_extensions>=4.12.2",+ "justext",+ "playwright",+ "beautifulsoup4",+ "flask>=2.0.1",+ "flask-cors>=3.0.10",+ "flask-socketio>=5.1.1",+ "sqlalchemy>=1.4.23",+ "wikipedia",+ "arxiv>=1.4.3",+ "PyPDF2>=2.0.0",+ "sentence-transformers",+ "faiss-cpu",+ "pydantic>=2.0.0",+ "pydantic-settings>=2.0.0",+ "toml>=0.10.2",+ "platformdirs>=3.0.0",+ "dynaconf"+]++[project.urls]+"Homepage" = "https://github.com/LearningCircuit/local-deep-research"+"Bug Tracker" = "https://github.com/LearningCircuit/local-deep-research/issues"++[project.scripts]+ldr = "local_deep_research.main:main"+ldr-web = "local_deep_research.web.app:main"++[tool.setuptools]+include-package-data = true++[tool.setuptools.package-data]+"local_deep_research.web" = ["templates/*", "static/*", "static/**/*"]+"local_deep_research.defaults" = ["*.toml", "*.py"]diff --cc src/local_deep_research/search_system.pyindex d6d74a705b,a401e85262..77541a8a0b--- a/src/local_deep_research/search_system.py+++ b/src/local_deep_research/search_system.py@@@ -162,11 -152,9 +163,11 @@@ class AdvancedSearchSystemsection_links.extend(links)formatted_links = ""if links:- formatted_links=format_links(links=links)+ formatted_links=format_links(links=links)+- logger.debug(f"Generated questions: {formatted_links}")- results_with_links = str(result["content"]) #+ "\n" + str(formatted_links)++ logger.debug(f"Generated questions: {formatted_links}")if result is not None:+ results_with_links = str(result["content"])findings.append({"phase": f"Follow-up {iteration}.{questions.index(question) + 1}",@@@ -177,9 -165,7 +178,7 @@@})--- if config.KNOWLEDGE_ACCUMULATION != KnowledgeAccumulationApproach.NO_KNOWLEDGE:+ if settings.general.knowledge_accumulation != KnowledgeAccumulationApproach.NO_KNOWLEDGE:current_knowledge = current_knowledge + "\n\n\n New: \n" + results_with_linksprint(current_knowledge)diff --cc src/local_deep_research/web/app.pyindex 38fc8eeba2,d7a9aa7f61..1121b499e5--- a/src/local_deep_research/web/app.py+++ b/src/local_deep_research/web/app.py@@@ -1069,11 -846,52 +1073,57 @@@ def app_serve_static(path)def favicon():return send_from_directory(app.static_folder, 'favicon.ico', mimetype='image/x-icon')+++ # Add this function to app.py+ def convert_debug_to_markdown(raw_text, query):+ """+ Convert the debug-formatted text to clean markdown.++ Args:+ raw_text: The raw formatted findings with debug symbols+ query: Original research query++ Returns:+ Clean markdown formatted text+ """+ # If there's a "DETAILED FINDINGS:" section, extract everything after it+ if "DETAILED FINDINGS:" in raw_text:+ detailed_index = raw_text.index("DETAILED FINDINGS:")+ content = raw_text[detailed_index + len("DETAILED FINDINGS:"):].strip()+ else:+ content = raw_text++ # Remove divider lines with === symbols+ content = "\n".join([line for line in content.split("\n")+ if not line.strip().startswith("===") and not line.strip() == "="*80])++ # If COMPLETE RESEARCH OUTPUT exists, remove that section+ if "COMPLETE RESEARCH OUTPUT" in content:+ content = content.split("COMPLETE RESEARCH OUTPUT")[0].strip()++ # Remove SEARCH QUESTIONS BY ITERATION section+ if "SEARCH QUESTIONS BY ITERATION:" in content:+ search_index = content.index("SEARCH QUESTIONS BY ITERATION:")+ next_major_section = -1+ for marker in ["DETAILED FINDINGS:", "COMPLETE RESEARCH:"]:+ if marker in content[search_index:]:+ marker_pos = content.index(marker, search_index)+ if next_major_section == -1 or marker_pos < next_major_section:+ next_major_section = marker_pos++ if next_major_section != -1:+ content = content[:search_index] + content[next_major_section:]+ else:+ # If no later section, just remove everything from SEARCH QUESTIONS onwards+ content = content[:search_index].strip()++ return content.strip()+def main():+ """+ Entry point for the web application when run as a command.+ This function is needed for the package's entry point to work properly.+ """+-if __name__ == '__main__':# Check for OpenAI availability but don't import it unless necessarytry:import os@@@ -1092,10 -910,5 +1142,8 @@@except Exception as e:print(f"Error checking OpenAI availability: {e}")-- # Run with threading (more stable than eventlet with complex dependencies)- socketio.run(app, debug=True, host='0.0.0.0', port=5000, allow_unsafe_werkzeug=False)-- if __name__ == '__main__':- main()++ socketio.run(app, debug=True, host='0.0.0.0', port=5000, allow_unsafe_werkzeug=True)+++if __name__ == '__main__':++ main()