链载Ai

标题: 强大的AI研究助手Local Deep Research [打印本页]

作者: 链载Ai    时间: 10 小时前
标题: 强大的AI研究助手Local Deep Research

项目简介

一款强大的 AI 驱动研究助手,使用多个LLMs和网页搜索进行深度、迭代分析。系统可本地运行以保护隐私,或配置为使用基于云的LLMs以增强功能。


特性
? 高级研究能力



示例研究:聚变能源发展
该仓库包含展示工具功能的完整研究示例。例如,我们的聚变能源研究分析提供了以下全面概述:


本示例展示了系统执行多次研究迭代的能力,跨科学和商业领域追踪证据线索,并从不同来源综合信息,同时保持适当的引用。


安装


克隆仓库:

gitclonehttps://github.com/yourusername/local-deep-research.gitcdlocal-deep-research
  1. 安装依赖项:
pipinstall-rrequirements.txt
  1. 安装 Ollama(用于本地模型):
#InstallOllamafromhttps://ollama.aiollamapullmistral#Defaultmodel-manyworkreallywellchoosebestforyourhardware(fitsinGPU)
  1. 配置环境变量:
# 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

使用


终端使用(不推荐):

pythonmain.py

网页界面
该项目包括一个用于更友好用户体验的网页界面:

pythonapp.py

这将启动一个本地网络服务器,您可以在浏览器中通过http://127.0.0.1:5000访问。

网页界面功能:




配置



请将您最佳设置在问题中报告,以便我们改进默认设置。

Key settings inconfig.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


本地文档搜索(RAG)
系统包括使用检索增强生成(RAG)的强大本地文档搜索功能。这允许您从自己的文档集合中搜索和检索内容。



设置本地收藏


创建一个名为local_collections.py的文件在项目根目录下:

# local_collections.pyimportosfromtypingimportDict,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":"ersonal Notes", "description":"ersonal 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 directoriesforyour collections:```bashmkdir -p local_search_files/research_papersmkdir -p local_search_files/personal_notes

将您的文档添加到这些文件夹中,系统将自动索引它们并使它们可供搜索。


使用本地搜索


您可以使用本地搜索的几种方式:

  1. 自动选择:在config.py中设置search_tool = "auto",系统将在查询适当的情况下自动使用您的本地收藏。

  2. 显式选择:将search_tool = "research_papers"设置为仅搜索特定集合。

  3. 搜索所有本地收藏:将search_tool = "local_all"设置为搜索您所有的本地文档收藏。

  4. 查询语法:使用collection:collection_name your query来在查询中指定特定的集合。


搜索引擎选项



系统支持多个搜索引擎,可以通过更改config.py中的search_tool变量来选择:






欢迎光临 链载Ai (https://www.lianzai.com/) Powered by Discuz! X3.5