使用说明
免责声明
This repo is an experiment on agent coding. 95% of the code is written by LLM's
开放式深度研究MCP服务器
一个由人工智能驱动的研究助理,可以对任何主题进行深入的迭代研究。它结合了搜索引擎、网络抓取和人工智能,深入探索主题并生成全面的报告。可作为模型上下文协议(MCP)工具或独立CLI使用。查看exampleout.md,了解报告可能的样子。
快速开始
- 克隆并安装:
git clone https://github.com/Ozamatash/deep-research
cd deep-research
npm install
- 设置环境
.env.local:
# Copy the example environment file
cp .env.example .env.local
- 构建:
# Build the server
npm run build
- 运行cli版本:
npm run start
- 使用Claude Desktop测试MCP服务器:
按照服务器快速入门底部的指南将服务器添加到Claude Desktop:
https://modelcontextprotocol.io/quickstart/server
对于远程服务器:流式HTTP
npm run start:http
服务器在上运行 http://localhost:3000/mcp 没有会话管理。
特性
- 通过生成有针对性的搜索查询来执行深入的迭代研究
- 通过深度(多深)和广度(多宽)参数控制研究范围
- 通过详细评分(0-1)和推理来评估源可靠性
- 优先考虑高可靠性来源(≥0.7),并验证不太可靠的信息
- 生成后续问题,以更好地了解研究需求
- 生成详细的降价报告,包括调查结果、来源和可靠性评估
- 可作为AI代理的模型上下文协议(MCP)工具
- 目前,MCP版本不询问后续问题
- 自然语言源偏好(避免列表、论坛、联盟评论、特定域名)
模型选择(OpenAI、Anthropic、谷歌、xAI)
每次运行选择一个提供商和型号。
- CLI:系统将提示您输入提供者和型号。例子:
openai+gpt-5.2. - MCP/HTTP:通过
model例如。openai:gpt-5.2(也接受openai/gpt-5.2).
在中设置相应的API密钥 .env.local:
OPENAI_API_KEY=...
ANTHROPIC_API_KEY=...
GOOGLE_API_KEY=...
XAI_API_KEY=...
可选择为每个提供程序设置默认模型:
OPENAI_MODEL=gpt-5.2
ANTHROPIC_MODEL=claude-opus-4-5
GOOGLE_MODEL=gemini-3-pro-preview
XAI_MODEL=grok-4-1-fast-reasoning
如果使用非默认OpenAI端点:
OPENAI_ENDPOINT=https://api.openai.com/v1
运作原理
flowchart TB
subgraph Input
Q[User Query]
B[Breadth Parameter]
D[Depth Parameter]
FQ[Feedback Questions]
end
subgraph Research[Deep Research]
direction TB
SQ[Generate SERP Queries]
SR[Search]
RE[Source Reliability Evaluation]
PR[Process Results]
end
subgraph Results[Research Output]
direction TB
L((Learnings with
Reliability Scores))
SM((Source Metadata))
ND((Next Directions:
Prior Goals,
New Questions))
end
%% Main Flow
Q & FQ --> CQ[Combined Query]
CQ & B & D --> SQ
SQ --> SR
SR --> RE
RE --> PR
%% Results Flow
PR --> L
PR --> SM
PR --> ND
%% Depth Decision and Recursion
L & ND --> DP{depth > 0?}
DP -->|Yes| SQ
%% Final Output
DP -->|No| MR[Markdown Report]
%% Styling
classDef input fill:#7bed9f,stroke:#2ed573,color:black
classDef process fill:#70a1ff,stroke:#1e90ff,color:black
classDef output fill:#ff4757,stroke:#ff6b81,color:black
classDef results fill:#a8e6cf,stroke:#3b7a57,color:black,width:150px,height:150px
class Q,B,D,FQ input
class SQ,SR,RE,PR process
class MR output
class L,SM,ND results
高级设置
使用本地防火墙(免费选项)
您可以运行本地实例,而不是使用Firecrawl API。您可以使用官方仓库或我的fork,它使用searXNG作为搜索后端,以避免使用searchapi密钥:
- 设置本地Firecrawl:
git clone https://github.com/Ozamatash/localfirecrawl
cd localfirecrawl
# Follow setup in localfirecrawl README
- 更新
.env.local:
FIRECRAWL_BASE_URL="http://localhost:3002"
可选:可观察性
使用Langfuse添加可观察性来跟踪研究流程、查询和结果:
# Add to .env.local
LANGFUSE_PUBLIC_KEY="your_langfuse_public_key"
LANGFUSE_SECRET_KEY="your_langfuse_secret_key"
如果没有提供Langfuse密钥,该应用程序可以正常工作,没有可观察性。
许可证
MIT许可证