微信扫码
添加专属顾问
我要投稿
一款AI驱动的研究助手,深度迭代分析,保护隐私,支持多种LLMs和搜索集成。 核心内容: 1. 项目简介与高级研究能力 2. 灵活的LLM支持和丰富的输出选项 3. 隐私优先与加强搜索集成 4. 本地文档搜索和示例研究:聚变能源发展 5. 安装指南与依赖项安装
一款强大的 AI 驱动研究助手,使用多个LLMs和网页搜索进行深度、迭代分析。系统可本地运行以保护隐私,或配置为使用基于云的LLMs以增强功能。
? 灵活 LLM 支持
? 丰富的输出选项
? 隐私优先
? 加强搜索集成
? 本地文档搜索(RAG)
本示例展示了系统执行多次研究迭代的能力,跨科学和商业领域追踪证据线索,并从不同来源综合信息,同时保持适当的引用。
git clone https://github.com/yourusername/local-deep-research.gitcd local-deep-research
pip install -r requirements.txt
# Install Ollama from https://ollama.aiollama pull mistral # Default model - many work really well choose best for your hardware (fits in GPU)
# Copy the templatecp .env.template .env# Edit .env with your API keys (if using cloud LLMs)ANTHROPIC_API_KEY=your-api-key-here # For ClaudeOPENAI_API_KEY=your-openai-key-here # For GPT modelsGUARDIAN_API_KEY=your-guardian-api-key-here # For The Guardian search
终端使用(不推荐):
python main.py
python app.py
这将启动一个本地网络服务器,您可以在浏览器中通过 http://127.0.0.1:5000 访问。
请将您最佳设置在问题中报告,以便我们改进默认设置。
Key settings in config.py:
关键设置在 config.py 中:
# LLM ConfigurationDEFAULT_MODEL = "mistral" # Change based on your needsDEFAULT_TEMPERATURE = 0.7MAX_TOKENS = 8000# Search ConfigurationMAX_SEARCH_RESULTS = 40SEARCH_REGION = "us-en"TIME_PERIOD = "y"SAFE_SEARCH = TrueSEARCH_SNIPPETS_ONLY = False# Choose search tool: "wiki", "arxiv", "duckduckgo", "guardian", "serp", "local_all", or "auto"search_tool = "auto" # "auto" will intelligently select the best search engine for your query
创建一个名为 local_collections.py 的文件在项目根目录下:
# local_collections.pyimport osfrom typing import Dict, Any# Registry of local document collectionsLOCAL_COLLECTIONS = {# Research Papers Collection"research_papers": {"name": "Research Papers","description": "Academic research papers and articles","paths": [os.path.abspath("local_search_files/research_papers")], # Use absolute paths"enabled": True,"embedding_model": "all-MiniLM-L6-v2","embedding_device": "cpu","embedding_model_type": "sentence_transformers","max_results": 20,"max_filtered_results": 5,"chunk_size": 800, # Smaller chunks for academic content"chunk_overlap": 150,"cache_dir": ".cache/local_search/research_papers"},# Personal Notes Collection"personal_notes": {"name": "Personal Notes","description": "Personal notes and documents","paths": [os.path.abspath("local_search_files/personal_notes")], # Use absolute paths"enabled": True,"embedding_model": "all-MiniLM-L6-v2","embedding_device": "cpu","embedding_model_type": "sentence_transformers","max_results": 30,"max_filtered_results": 10,"chunk_size": 500, # Smaller chunks for notes"chunk_overlap": 100,"cache_dir": ".cache/local_search/personal_notes"}}Create the directories for your collections:```bashmkdir -p local_search_files/research_papersmkdir -p local_search_files/personal_notes
将您的文档添加到这些文件夹中,系统将自动索引它们并使它们可供搜索。
您可以使用本地搜索的几种方式:
自动选择:在 config.py 中设置 search_tool = "auto" ,系统将在查询适当的情况下自动使用您的本地收藏。
显式选择:将 search_tool = "research_papers" 设置为仅搜索特定集合。
搜索所有本地收藏:将 search_tool = "local_all" 设置为搜索您所有的本地文档收藏。
查询语法:使用 collection:collection_name your query 来在查询中指定特定的集合。
系统支持多个搜索引擎,可以通过更改 config.py 中的 search_tool 变量来选择:
wiki ):最适合一般知识、事实和概述信息arxiv ):非常适合科学和学术研究,访问预印本和论文pubmed ):非常适合生物医学文献、医学研究和健康信息duckduckgo ):无需 API 密钥的通用网页搜索guardian ):高质量新闻和文章(需要 API 密钥)serp ):谷歌搜索结果(需要 API 密钥)google_pse ):可控制搜索范围和域的定制搜索体验(需要 API 密钥和搜索引擎 ID)local_collections.py 文件中定义的任何收藏53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2025-10-28
多少做RAG的人,连分词都搞不定? Milvus Analyzer指南
2025-10-28
先分块再向量化已经过时!先embedding再chunking才是王道
2025-10-28
AI检索增强中路由模型的使用
2025-10-28
HybRAG:混合文本和知识图谱的RAG框架
2025-10-28
“生成幻觉”(Hallucination)和“知识时效性”不足引发的架构范式变革
2025-10-27
RAG优化技巧
2025-10-26
关于RAG系统在多轮对话中的问题改写(优化)方法—使用历史记录改写问题
2025-10-26
你的RAG知识库,真的“喂”对数据了吗?拆解dify分段策略,告别无效召回
2025-09-15
2025-09-02
2025-08-05
2025-08-18
2025-08-25
2025-08-25
2025-08-25
2025-09-03
2025-08-20
2025-09-08
2025-10-04
2025-09-30
2025-09-10
2025-09-10
2025-09-03
2025-08-28
2025-08-25
2025-08-20