langchain-ai/open_deep_research

GitHub Trending (daily) 工具

摘要

Open Deep Research是LangChain开发的一个可配置、完全开源深度研究代理,支持多种模型提供商、搜索工具和MCP服务器,在Deep Research Bench排行榜上取得了具有竞争力的性能。

暂无内容
查看原文
查看缓存全文

缓存时间: 2026/07/21 12:36

langchain-ai/open_deep_research

来源:https://github.com/langchain-ai/open_deep_research

🔬 Open Deep Research

深度研究已成为最热门的智能体应用之一。这是一个简单、可配置、完全开源且支持跨多个模型提供商、搜索工具和MCP服务器的深度研究智能体。其性能与许多流行的深度研究智能体相当(请参阅深度研究排行榜(https://huggingface.co/spaces/Ayanami0730/DeepResearch-Leaderboard))。

🔥 近期更新

2025年8月14日:请在此查看我们关于构建开放深度研究的免费课程(https://academy.langchain.com/courses/deep-research-with-langgraph)(以及课程仓库(https://github.com/langchain-ai/deep_research_from_scratch))。

2025年8月7日:新增GPT-5并更新了深度研究基准评估结果(含GPT-5)。

2025年8月2日:在深度研究排行榜(https://huggingface.co/spaces/Ayanami0730/DeepResearch-Leaderboard)上取得第6名,总分为0.4344。

2025年7月30日:阅读我们博客文章(https://rlancemartin.github.io/2025/07/30/bitter_lesson/)中从原始实现到当前版本的演变过程。

2025年7月16日:阅读我们的博客(https://blog.langchain.com/open-deep-research/)并观看视频(https://www.youtube.com/watch?v=agGiWUpxkhg)获取快速概览。

🚀 快速开始

  1. 克隆仓库并激活虚拟环境:

    git clone https://github.com/langchain-ai/open_deep_research.git
    cd open_deep_research
    uv venv
    source .venv/bin/activate  # Windows上: .venv\Scripts\activate
    
  2. 安装依赖:

    uv sync  # 或 uv pip install -r pyproject.toml
    
  3. 设置您的 .env 文件以自定义环境变量(模型选择、搜索工具及其他配置):

    cp .env.example .env
    
  4. 在本地使用LangGraph服务器启动智能体:

    # 安装依赖并启动LangGraph服务器
    uvx --refresh --from "langgraph-cli[inmem]" --with-editable . --python 3.11 langgraph dev --allow-blocking
    

    这将在浏览器中打开LangGraph Studio界面。

    - 🚀 API: http://127.0.0.1:2024
    - 🎨 Studio UI: https://smith.langchain.com/studio/?baseUrl=http://127.0.0.1:2024
    - 📚 API文档: http://127.0.0.1:2024/docs
    

    messages 输入字段中提问,然后点击 Submit。在“管理助手”选项卡中选择不同的配置。

⚙️ 配置

大语言模型 :brain:

Open Deep Research 通过 init_chat_model() API(https://python.langchain.com/docs/how_to/chat_models_universal_init/)支持多种大语言模型提供商。它使用大语言模型完成几种不同任务。有关更多详情,请参阅 configuration.py(https://github.com/langchain-ai/open_deep_research/blob/main/src/open_deep_research/configuration.py)文件中的以下模型字段。可通过LangGraph Studio UI访问这些设置。

  • 总结(默认:openai:gpt-4.1-mini):总结搜索API结果
  • 研究(默认:openai:gpt-4.1):驱动搜索智能体
  • 压缩(默认:openai:gpt-4.1):压缩研究发现
  • 最终报告模型(默认:openai:gpt-4.1):撰写最终报告

注意:所选模型需要支持结构化输出(https://python.langchain.com/docs/integrations/chat/)和工具调用(https://python.langchain.com/docs/how_to/tool_calling/)。 注意:对于OpenRouter:请遵循此指南(https://github.com/langchain-ai/open_deep_research/issues/75#issuecomment-2811472408);对于通过Ollama使用的本地模型,请参阅设置说明(https://github.com/langchain-ai/open_deep_research/issues/65#issuecomment-2743586318)。

搜索API :mag:

Open Deep Research 支持多种搜索工具。默认使用 Tavily(https://www.tavily.com/)搜索API。完全支持MCP兼容性,并支持Anthropic和OpenAI的原生网络搜索。有关更多详情,请参阅 configuration.py(https://github.com/langchain-ai/open_deep_research/blob/main/src/open_deep_research/configuration.py)文件中的 search_apimcp_config 字段。可通过LangGraph Studio UI访问这些设置。

其他

请参阅 configuration.py(https://github.com/langchain-ai/open_deep_research/blob/main/src/open_deep_research/configuration.py)中的字段,以了解自定义Open Deep Research行为的其他各种设置。

📊 评估

Open Deep Research 已配置为使用 Deep Research Bench(https://huggingface.co/spaces/Ayanami0730/DeepResearch-Leaderboard)进行评估。该基准包含100项博士级别的研究任务(50英文,50中文),由领域专家跨越22个领域(例如科学与技术、商业与金融)精心设计,以反映现实世界中的深度研究需求。它有两个评估指标,但排行榜基于 RACE 分数。该指标使用大模型作为评判(Gemini),根据专家编译的一组黄金标准报告在多个指标上评估研究报告。

使用方法

警告:运行全部100个示例的成本大约为20到100美元,具体取决于模型选择。该数据集可通过此链接(https://smith.langchain.com/public/c5e7a6ad-fdba-478c-88e6-3a388459ce8b/d)在LangSmith上获取。

要启动评估,请运行以下命令:

# 在LangSmith数据集上运行全面评估
python tests/run_evaluate.py

这将提供一个指向LangSmith实验的链接,实验名称将为 YOUR_EXPERIMENT_NAME。完成后,将结果提取为一个可以提交到 Deep Research Bench 的 JSONL 文件。

python tests/extract_langsmith_data.py --project-name "YOUR_EXPERIMENT_NAME" --model-name "your-model-name" --dataset-name "deep_research_bench"

这将创建 tests/expt_results/deep_research_bench_model-name.jsonl,格式符合要求。将生成的 JSONL 文件移动到 Deep Research Bench 仓库的本地副本,并按照其快速入门指南(https://github.com/Ayanami0730/deep_research_bench?tab=readme-ov-file#quick-start)提交评估。

结果

名称提交总结研究压缩总成本总Token数RACE分数实验链接
GPT-5ca3951d (https://github.com/langchain-ai/open_deep_research/pull/168/commits)openai:gpt-4.1-miniopenai:gpt-5openai:gpt-4.1204,640,8960.4943链接 (https://smith.langchain.com/o/ebbaf2eb-769b-4505-aca2-d11de10372a4/datasets/6e4766ca-613c-4bda-8bde-f64f0422bbf3/compare?selectedSessions=4d5941c8-69ce-4f3d-8b3e-e3c99dfbd4cc&baseline=undefined)
默认配置6532a41 (https://github.com/langchain-ai/open_deep_research/commit/6532a4176a93cc9bb2102b3d825dcefa560c85d9)openai:gpt-4.1-miniopenai:gpt-4.1openai:gpt-4.1$45.9858,015,3320.4309链接 (https://smith.langchain.com/o/ebbaf2eb-769b-4505-aca2-d11de10372a4/datasets/6e4766ca-6[…]ons=cf4355d7-6347-47e2-a774-484f290e79bc&baseline=undefined)
Claude Sonnet 4f877ea9 (https://github.com/langchain-ai/open_deep_research/pull/163/commits/f877ea93641680879c420ea991e998b47aab9bcc)openai:gpt-4.1-minianthropic:claude-sonnet-4-20250514openai:gpt-4.1$187.09138,917,0500.4401链接 (https://smith.langchain.com/o/ebbaf2eb-769b-4505-aca2-d11de10372a4/datasets/6e4766ca-6[…]ons=04f6002d-6080-4759-bcf5-9a52e57449ea&baseline=undefined)
Deep Research Bench提交c0a160b (https://github.com/langchain-ai/open_deep_research/commit/c0a160b57a9b5ecd4b8217c3811a14d8eff97f72)openai:gpt-4.1-nanoopenai:gpt-4.1openai:gpt-4.1$87.83207,005,5490.4344链接 (https://smith.langchain.com/o/ebbaf2eb-769b-4505-aca2-d11de10372a4/datasets/6e4766ca-6[…]ons=e6647f74-ad2f-4cb9-887e-acb38b5f73c0&baseline=undefined)

🚀 部署与使用

LangGraph Studio

按照快速开始在本地启动LangGraph服务器,并在LangGraph Studio上测试智能体。

托管部署

您可以轻松部署到LangGraph平台(https://langchain-ai.github.io/langgraph/concepts/#deployment-options)。

开放智能体平台(OAP)

开放智能体平台(OAP)是一个UI界面,非技术用户可以通过它构建和配置自己的智能体。OAP非常适合让用户配置深度研究员,使用最适合其需求和问题的不同MCP工具和搜索API。我们已将Open Deep Research部署到我们的公开演示OAP实例中。您只需添加API密钥,即可亲自测试深度研究员!在此尝试(https://oap.langchain.com)。

您也可以部署自己的OAP实例,并将您自己的自定义智能体(如深度研究员)提供给您自己的用户。

  1. 部署开放智能体平台(https://docs.oap.langchain.com/quickstart)
  2. 将深度研究员添加到OAP(https://docs.oap.langchain.com/setup/agents)

遗留实现 🏛️

src/legacy/ 文件夹包含两个早期的实现,它们提供了自动研究的替代方法。它们的性能不如当前实现,但提供了不同的思路,有助于理解深度研究的不同方法。

1. 工作流实现 (legacy/graph.py)

  • 规划与执行:带有“人在环”规划的结构化工作流
  • 顺序处理:逐个创建章节,并带有反思
  • 交互控制:允许对报告计划进行反馈和批准
  • 质量导向:通过迭代优化强调准确性

2. 多智能体实现 (legacy/multi_agent.py)

  • 监督者-研究员架构:协调的多智能体系统
  • 并行处理:多个研究员同时工作
  • 速度优化:通过并发加速报告生成
  • MCP支持:广泛的模型上下文协议集成

相似文章

深度研究系统卡

OpenAI Blog

OpenAI 推出 Deep Research,这是一个由早期版本 o3 驱动的智能体功能,能够为复杂任务执行多步网络研究。在向 Pro 用户推出前,已实施全面的安全测试和隐私保护。

推出深度研究

OpenAI Blog

OpenAI 推出深度研究功能,这是 ChatGPT 中由 o3 驱动的代理能力,能够自主进行多步骤互联网研究以生成专业级分析报告,从 2026 年 2 月起扩展访问权限和功能。