open_deep_research

应用程序

langchain-ai/open_deep_research

开源深度研究代理,支持多模型和搜索工具。

项目简介

可配置的深度研究代理,兼容多种LLM提供商、搜索API和MCP服务器。在深度研究基准榜上排名前列。基于LangGraph实现灵活编排。

README 预览

# 🔬 Open Deep Research\n\n\n\nDeep research has broken out as one of the most popular agent applications. This is a simple, configurable, fully open source deep research agent that works across many model providers, search tools, and MCP servers. It's performance is on par with many popular deep research agents ([see Deep Research Bench leaderboard](https://huggingface.co/spaces/Ayanami0730/DeepResearch-Leaderboard)).\n\n\n\n### 🔥 Recent Updates\n\n**August 14, 2025**: See our free course [here](https://academy.langchain.com/courses/deep-research-with-langgraph) (and course repo [here](https://github.com/langchain-ai/deep_research_from_scratch)) on building open deep research.\n\n**August 7, 2025**: Added GPT-5 and updated the Deep Research Bench evaluation w/ GPT-5 results.\n\n**August 2, 2025**: Achieved #6 ranking on the [Deep Research Bench Leaderboard](https://huggingface.co/spaces/Ayanami0730/DeepResearch-Leaderboard) with an overall score of 0.4344. \n\n**July 30, 2025**: Read about the evolution from our original implementations to the current version in our [blog post](https://rlancemartin.github.io/2025/07/30/bitter_lesson/).\n\n**July 16, 2025**: Read more in our [blog](https://blog.langchain.com/open-deep-research/) and watch our [video](https://www.youtube.com/watch?v=agGiWUpxkhg) for a quick overview.\n\n### 🚀 Quickstart\n\n1. Clone the repository and activate a virtual environment:\n```bash\ngit clone https://github.com/langchain-ai/open_deep_research.git\ncd open_deep_research\nuv venv\nsource .venv/bin/activate  # On Windows: .venv\Scripts\activate\n```\n\n2. Install dependencies:\n```bash\nuv sync\n# or\nuv pip install -r pyproject.toml\n```\n\n3. Set up your `.env` file to customize the environment variables (for model selection, search tools, and other configuration settings):\n```bash\ncp .env.example .env\n```\n\n4. Launch agent with the LangGraph server locally:\n\n```bash\n# Install dependencies and start the LangGraph server\nuvx --refres

常见问题 (2)

informational
`think_tool` 在 Open Deep Research 中起什么作用?它能改进推理吗?

think_tool 是一个有意设计的无操作(no-op)草稿本工具。它的 Python 返回值不执行任何操作,也不改变任何图状态。其目的是让模型在调用搜索或其他工具之前,通过工具调用显式输出 thought/推理字符串,从而鼓励规划和自我修正。任何收益都来自这些额外的推理 token;它不是一个独立的反思引擎,也不保证性能提升。它可以帮助普通的工具调用模型,但对于内置推理能力的模型来说通常是多余的。要禁用它,请从绑定到模型的工具中移除 think_tool,并删除指示模型调用它的提示词指令;否则模型可能会尝试调用一个不存在的工具。

来源 Issue #170
故障排除
如何配置基于 LangChain OpenAI 的应用以使用 OpenRouter API?

将 provider 保持设置为 openai,因为 OpenRouter 提供的是与 OpenAI 兼容的 API,但需要将客户端的 base_url 指向 OpenRouter。LangChain 的 ChatOpenAI 使用的是 OPENAI_BASE_URL,而不是 OPENAI_ENDPOINT。

在你的 .env 文件中,使用:

OPENAI_API_KEY="your-openrouter-key"
OPENAI_BASE_URL="https://openrouter.ai/api/v1"
OPENAI_MODEL="qwen/qwq-32b:free"

模型配置保持为:

planner_provider: "openai"
planner_model: "qwen/qwq-32b:free"
writer_provider: "openai"
writer_model: "qwen/qwq-32b:free"

如果应用程序直接构造客户端,请确保传入 base_url:

ChatOpenAI(
    model="qwen/qwq-32b:free",
    api_key=os.environ["OPENAI_API_KEY"],
    base_url="https://openrouter.ai/api/v1",
    timeout=60,
)

不要在 base URL 中包含 /chat/completions。

使用以下命令验证连接性和凭据:

curl https://openrouter.ai/api/v1/chat/completions \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen/qwq-32b:free","messages":[{"role":"user","content":"hello"}]}'

如果请求仍然超时,请增大客户端超时时间,或尝试其他的/付费的 OpenRouter 模型;免费模型可能响应缓慢或暂时不可用。

来源 Issue #75