微信扫码
添加专属顾问
我要投稿
Open Deep Research 革新了研究报告的生成方式,让AI成为你的智能研究助手,从规划到撰写一气呵成。核心内容: 1. 两种运行模式:结构化工作流与多智能体协作,满足不同研究需求 2. 工作流模式的四大特点:结构化执行、人工反馈、逐节写作、强交互性 3. 技术实现:基于LangGraph构建的智能节点与子图系统
Open Deep Research智能生成全流程
在人工智能飞速发展的今天,自动化内容生成已经成为提升工作效率的关键工具。今天想和大家分享一个极具创新性的开源系统 —— Open Deep Research。
它基于 LangGraph 构建,能自动完成从主题规划、资料检索到内容撰写、语言润色的全过程,是一位真正意义上的“AI 研究助手”。
作者
张传辉 | 高级AI开发工程师
Open Deep Research 提供两种强大的运行模式:
一是工作流模式,强调结构化和可控性,允许用户参与规划、迭代反馈,每一步都可审阅把关;
二是多智能体模式,模拟真实研究团队,每个智能体分工明确、并行处理任务,高效产出结构清晰、逻辑严谨的研究报告。它不仅能自动拆解研究问题、整合多源信息,还能智能优化逻辑结构与语言表达。
无论你是科研人员、市场分析师、政策顾问,还是技术从业者,都能在 Open Deep Research 中找到适合自己的“智能写作模式”。接下来,我们一起看看它都有哪些“硬核”亮点👇
Part1
工作流模式
▶ 特点:
· 结构化执行流程:采用计划 ➜ 用户确认 ➜ 分部分研究 ➜ 编写报告的顺序流程。
· 支持人工反馈:在生成报告前允许用户修改或接受研究计划。
· 逐节写作:每一节单独进行研究和写作,并可在每节之间反思和迭代。
· 交互性强:适用于对结构、准确性和质量有较高要求的研究项目。
▶ 适合场景:
· 学术研究、报告撰写、需要用户参与决策的流程。
· 用户希望对每一步有明确控制权和可视化反馈的情况。
核心工作流程
# 主工作流图构建
builder = StateGraph(ReportState, input=ReportStateInput, output=ReportStateOutput)
# 智能规划节点
builder.add_node("generate_report_plan", generate_report_plan)
# 人工反馈节点
builder.add_node("human_feedback", human_feedback)
# 章节研究子图
builder.add_node("build_section_with_web_research", section_builder.compile())
builder.add_node("gather_completed_sections", gather_completed_sections)
builder.add_node("write_final_sections", write_final_sections)
builder.add_node("compile_final_report", compile_final_report)
智能规划节点
报告规划是整个系统的起点:
async def generate_report_plan(state: ReportState, config: RunnableConfig):
topic = state["topic"]
feedback_list = state.get("feedback_on_report_plan", [])
# 获取配置参数
configurable = Configuration.from_runnable_config(config)
report_structure = configurable.report_structure
number_of_queries = configurable.number_of_queries
# 生成规划查询
structured_llm = writer_model.with_structured_output(Queries)
system_instructions = report_planner_query_writer_instructions.format(
topic=topic,
report_organization=report_structure,
number_of_queries=number_of_queries,
today=get_today_str()
)
# 执行搜索和规划
results = await structured_llm.ainvoke([
SystemMessage(content=system_instructions),
HumanMessage(content="Generate search queries for planning.")
])
# 网络搜索获取背景信息
query_list = [query.search_query for query in results.queries]
source_str = await select_and_execute_search(search_api, query_list, params_to_pass)
# 生成报告章节结构
planner_llm = init_chat_model(model=planner_model, model_provider=planner_provider)
structured_llm = planner_llm.with_structured_output(Sections)
report_sections = await structured_llm.ainvoke([
SystemMessage(content=system_instructions_sections),
HumanMessage(content=planner_message)
])
return {"sections": report_sections.sections}
这个节点的精妙之处在于:
· 双阶段规划:先搜索背景信息,再制定具体计划
· 反馈集成:能够根据人工反馈调整规划
· 结构化输出:确保输出格式的一致性
人工反馈机制
def human_feedback(state: ReportState, config: RunnableConfig) -> Command:
sections = state['sections']
sections_str = "\n\n".join(
f"Section: {section.name}\n"
f"Description: {section.description}\n"
f"Research needed: {'Yes' if section.research else 'No'}\n"
for section in sections
)
interrupt_message = f"""Please provide feedback on the following report plan:
\n\n{sections_str}\n
\nDoes the report plan meet your needs?
Pass 'true' to approve or provide feedback to regenerate:"""
feedback = interrupt(interrupt_message)
if isinstance(feedback, bool) and feedback isTrue:
# 批准后启动并行章节研究
return Command(goto=[
Send("build_section_with_web_research", {
"topic": topic,
"section": s,
"search_iterations": 0
}) for s in sections if s.research
])
elif isinstance(feedback, str):
# 反馈后重新规划
return Command(
goto="generate_report_plan",
update={"feedback_on_report_plan": [feedback]}
)
这种设计的优势:
· 交互式规划:用户可以直接参与规划过程
· 智能路由:根据反馈类型自动选择下一步操作
· 并行启动:批准后立即启动所有章节的并行研究
章节研究子图
每个章节的研究是一个独立的子图build_section_with_web_research,每个子图执行三个环节,问题生成——网络搜索——章节编写,以此完成每个章节的研究。
# 章节研究子图
section_builder = StateGraph(SectionState, output=SectionOutputState)
section_builder.add_node("generate_queries", generate_queries)
section_builder.add_node("search_web", search_web)
section_builder.add_node("write_section", write_section)
section_builder.add_edge(START, "generate_queries")
section_builder.add_edge("generate_queries", "search_web")
section_builder.add_edge("search_web", "write_section")
质量控制和迭代优化
Open Deep Research的一个重要特性是自动质量控制:
async def write_section(state: SectionState, config: RunnableConfig) -> Command:
# 生成章节内容
section_content = await writer_model.ainvoke([
SystemMessage(content=section_writer_instructions),
HumanMessage(content=section_writer_inputs_formatted)
])
section.content = section_content.content
# 质量评估
reflection_model = init_chat_model(model=planner_model).with_structured_output(Feedback)
feedback = await reflection_model.ainvoke([
SystemMessage(content=section_grader_instructions_formatted),
HumanMessage(content=section_grader_message)
])
# 根据评估结果决定下一步
if feedback.grade == "pass"or state["search_iterations"] >= max_search_depth:
return Command(update={"completed_sections": [section]}, goto=END)
else:
return Command(
update={"search_queries": feedback.follow_up_queries, "section": section},
goto="search_web"
)
这种设计实现了:
· 自动质量评估:LLM评估内容质量
· 迭代改进:根据评估结果决定是否需要更多研究
· 深度控制:防止无限迭代
Part2
多智能体模式
▶ 特点:
· 多智能体并行协作:一个主管智能体(Supervisor)负责任务分配,多个研究智能体(Researchers)同时处理不同章节。
· 效率更高:并行执行各个部分,整体报告生成速度快。
· 自动化程度更高:适合无人值守或自动化报告生成任务。
· 支持 MCP 工具:可接入本地文件、数据库、API 等进行扩展研究。
▶ 适合场景:
· 快速生成报告、自动化内容生产。
· 集成多来源数据(如文件系统、数据库)进行知识检索和写作。
· 需要并发处理的复杂任务。
智能体角色设计
多智能体模式采用了明确的角色分工:
class ReportState(MessagesState):
sections: list[str] # 报告章节列表
completed_sections: Annotated[list[Section], operator.add] # 已完成章节
final_report: str # 最终报告
question_asked: bool # 是否已提问
source_str: Annotated[str, operator.add] # 搜索来源
监督者智能体
监督者负责整体协调和高级决策:
async def supervisor(state: ReportState, config: RunnableConfig):
messages = state["messages"]
configurable = Configuration.from_runnable_config(config)
supervisor_model = get_config_value(configurable.supervisor_model)
llm = init_chat_model(model=supervisor_model)
# 如果章节研究完成但报告未完成,启动引言和结论撰写
if state.get("completed_sections") andnot state.get("final_report"):
research_complete_message = {
"role": "user",
"content": "Research is complete. Now write introduction and conclusion..."
}
messages = messages + [research_complete_message]
# 获取可用工具
supervisor_tool_list = get_supervisor_tools(config)
# 如果已经提问过,移除Question工具
if state.get("question_asked", False):
supervisor_tool_list = [tool for tool in supervisor_tool_list
if tool.name != "Question"]
llm_with_tools = llm.bind_tools(supervisor_tool_list, tool_choice="any")
return {
"messages": [
await llm_with_tools.ainvoke([
{"role": "system", "content": SUPERVISOR_INSTRUCTIONS.format(today=get_today_str())}
] + messages)
]
}
研究者智能体
研究者智能体专注于具体的章节研究:
async def research_Agent(state: SectionState, config: RunnableConfig):
configurable = Configuration.from_runnable_config(config)
researcher_model = get_config_value(configurable.researcher_model)
llm = init_chat_model(model=researcher_model)
research_tool_list = await get_research_tools(config)
system_prompt = RESEARCH_INSTRUCTIONS.format(
section_description=state["section"],
number_of_queries=configurable.number_of_queries,
today=get_today_str(),
)
# 添加MCP提示(如果配置了)
if configurable.mcp_prompt:
system_prompt += f"\n\n{configurable.mcp_prompt}"
return {
"messages": [
await llm.bind_tools(research_tool_list, tool_choice="any").ainvoke([
{"role": "system", "content": system_prompt}
] + state["messages"])
]
}
工具系统设计
Open Deep Research支持动态工具配置:
def get_search_tool(config: RunnableConfig):
configurable = Configuration.from_runnable_config(config)
search_api = get_config_value(configurable.search_api)
if search_api.lower() == "none":
returnNone
elif search_api.lower() == "tavily":
search_tool = tavily_search
elif search_api.lower() == "duckduckgo":
search_tool = duckduckgo_search
else:
raise NotImplementedError(f"Search API '{search_api}' not supported")
# 添加工具元数据
tool_metadata = {**(search_tool.metadata or {}), "type": "search"}
search_tool.metadata = tool_metadata
return search_tool
asyncdef get_research_tools(config: RunnableConfig) -> list[BaseTool]:
search_tool = get_search_tool(config)
tools = [tool(Section), tool(FinishResearch)]
if search_tool isnotNone:
tools.append(search_tool)
# 加载MCP工具
existing_tool_names = {cast(BaseTool, tool).name for tool in tools}
mcp_tools = await _load_mcp_tools(config, existing_tool_names)
tools.extend(mcp_tools)
return tools
Part3
使用示例
以工作流模式为例,让我们看看它的表现!我期望生成一篇特斯拉股票估值的研究报告,输入题目《从投资者视角解析特斯拉估值变化:财务数据、市场表现与未来机遇》
generate_report_plan生成报告大纲,进入human_feedback节点,询问用户对报告大纲的意见,如果接受则直接进入下个阶段,否则输入改进建议,即可重新生成报告大纲。
[
{
"name": "Introduction",
"description": "Brief overview of the investor's perspective on Tesla's valuation changes, highlighting factors such as financial data, market performance, and future opportunities.",
"research": false,
"content": ""
},
{
"name": "Analysis of Tesla's Financial Data",
"description": "Detailed examination of Tesla's financial performance, including revenue, margins, profit, assets, and liabilities over recent years.",
"research": true,
"content": ""
},
{
"name": "Market Performance of Tesla",
"description": "Evaluation of Tesla's market performance, analyzing stock price trends, comparisons with benchmarks and peers, and investor sentiments.",
"research": true,
"content": ""
},
{
"name": "Future Opportunities for Tesla",
"description": "Exploration of potential future opportunities for Tesla, including new product launches, technological advancements, and strategic market expansions.",
"research": true,
"content": ""
},
{
"name": "Conclusion",
"description": "Summary of the financial performance, market performance, and future prospects of Tesla, including key takeaways for investors.",
"research": false,
"content": ""
}
]
这里我们输入true,表示接受当前大纲,进入build_section_with_web_research子图,此时系统会根据大纲提要,搜索待研究的相关内容,并编辑成章节。
经过搜索、编写和汇总等多个阶段,生成最终的调研报告。
# 从投资者视角解析特斯拉估值变化:财务数据、市场表现与未来机遇
Tesla's valuation changes are pivotal from an investor’s standpoint, influenced by financial data, market performance, and future opportunities. The financial analysis reveals remarkable revenue growth and asset expansion, contrasted by recent profitability challenges. Market performance underscores Tesla's stock appreciation and dominance over benchmarks and peers, highlighting its competitive market stance. Future opportunities further emphasize expansion through innovative product launches and technological advancements, poised to drive sustainable growth. This report examines these dimensions to provide an integrated view of Tesla’s evolving valuation landscape.
## Analysis of Tesla's Financial Data
Tesla's financial performance over recent years indicates significant growth and profitability. Tesla's revenue has consistently increased from $31.5 billion in2020 to $97.7 billion in2024, marking a substantial rise and demonstrating strong market demand and expansion capabilities [1,2]. Despite fluctuations, Tesla maintained robust gross profits, achieving $17.4 billion in2024, which is slightly lower than the $20.8 billion in2023 but still indicative of a strong operational performance [3].
Concerning margins, Tesla’s operating income reached $7.1 billion in2024, while the net income stood at $7.13 billion, a notable drop from the $15 billion in2023, primarily linked to increased operating expenses and reduced income from non-operating sources [1]. The decline in profitability suggests pressures from higher expenses including research and development (R&D) that rose to $4.54 billion in2024 from $3.97 billion the previous year [3].
Tesla’s total assets expanded significantly, from $95.34 billion in2023 to $104.3 billion in2024, reflective of robust investments in infrastructure and expansion projects [4]. Additionally, Tesla’s liabilities also grew, indicating increasing financial obligations possibly due to strategic leveraging for expansion [5].
Analyzing ratios, Tesla shows robust liquidity with a current ratio of 2.00and a quick ratio of 1.38, as of June 2025, indicating healthy short-term financial stability [6]. The debt-to-equity ratio remained low at 0.17, exhibiting strong equity positioning and manageable debt levels [1].
Collectively, Tesla’s financial health and strategic investments position it well for future opportunities despite recent profitability challenges.
### Sources
[1] Tesla Financial Statements 2009-2025| TSLA - Macrotrends: https://www.macrotrends.net/stocks/charts/TSLA/tesla/financial-statements
[2] Tesla (TSLA) Financials - Income Statement - Stock Analysis: https://stockanalysis.com/stocks/tsla/financials/
[3] TSLA | Tesla Inc. Financial Statements - WSJ:https://www.wsj.com/market-data/quotes/TSLA/financials
[4] Tesla (TSLA) Financials 2025 - Income Statement and ... - MarketBeat:https://www.marketbeat.com/stocks/NASDAQ/TSLA/financials/
[5] Tesla, Inc. Annual Report:https://www.annualreports.com/Company/tesla-inc
[6] Tesla (TSLA) Financial Ratios - Stock Analysis:https://stockanalysis.com/stocks/tsla/financials/ratios/
## Market Performance of Tesla
Between 2023and2025, Tesla's stock price showed impressive growth, with closing prices surging from $281.95 to $348.68, reflecting a significant increase of 194.3% during this period [1]. Despite fluctuations, Tesla’s overall trend has been upward, underpinned by strong fundamentals and market sentiments.
Comparatively, Tesla has outperformed major indices such as the Dow Jones and NASDAQ. For instance, in 2024, Tesla’s stock returns were +62.52%, significantly higher than both Dow Jones (+12.88%) and NASDAQ (+28.64%) [2].
Tesla’s performance relative to its peers in the electric vehicle (EV) sector is also noteworthy. Over the past five years, it has consistently delivered higher average returns (+178.48%) compared to competitors like Toyota (+8.79%), BYD (+93.67%), and Ferrari (+23.54%) [2].
Market analyst sentiments towards Tesla are mixed. While Cathie Wood's Ark Invest targets an optimistic price of $2,600 by 2029, some analysts like Seth Goldstein of Morningstar maintain a more conservative fair value estimate of $210, albeit seeing long-term potential [3]. Overall, Tesla’s stock continues to be an attractive proposition for investors considering its robust growth prospects and competitive market position.
### Sources
[1] Tesla Stock Price 2023 To 2025| StatMuse Money: https://www.statmuse.com/money/ask/tesla-stock-price-2023-to-2025
[2] Tesla Stock Price Forecast 2025 - 2050 with Complete Analysis: https://futurevaluejournal.com/tesla-stock-price-forecast/
[3] Is Tesla Stock a Buy in 2025? 3-Year Performance Analysis and Forecast: https://www.techi.com/tesla-stock-buy-2025-analysis-forecast/
## Future Opportunities for Tesla
Tesla is poised to capitalize on several promising opportunities in the coming years, focusing on new product launches, technological advancements, and strategic market expansions.
Regarding new product launches, Tesla plans to unveil the Model 2, an affordable electric vehicle tailored for a broader customer base. This vehicle will likely gain traction in urban areas and emerging economies, helping Tesla penetrate new markets with its cost-effective solutions [1,2]. Other notable products include the Tesla Van, which targets commercial and family use, and a compact, solar-powered Tiny House designed for sustainable living [1,2].
Technological advancements are central to Tesla’s strategy. The development of the 4680 battery cells, which offer higher energy density and lower production costs, will enhance vehicle range and performance, supporting Tesla’s drive to produce more efficient electric cars [2]. Tesla’s Full Self-Driving (FSD) software continues to evolve, aiming to achieve complete autonomy, which will significantly impact the market once regulatory hurdles are cleared [2,6].
Strategic market expansions are also in Tesla's roadmap. The company is accelerating its global expansion by establishing new manufacturing facilities, such as the Gigafactory in Mexico and potential sites in India and the Netherlands [6]. These plants will support increased production capacity, meeting global demand and reducing costs through localized production [6]. Additionally, Tesla's entry into Saudi Arabia aligns with economic diversification efforts, showcasing its commitment to sustainable technologies [6].
These initiatives position Tesla for sustained growth by diversifying its product offerings and leveraging advanced technologies to enhance performance and customer experience.
### Sources
[1] Tesla’s 2025 Innovation Lineup: Affordable Models and New Ventures: https://ilovetesla.com/teslas-2025-innovation-lineup-affordable-models-and-new-ventures/
[2] Elon Musk Confirms 3 NEW Teslas Models For 2025: https://elonbuzz.com/elon-musk-confirms-3-new-teslas-models-for-2025/
[6] Tesla’s Global Expansion: New Factories & Market Strategies For 2025: https://autotimesnews.com/teslas-global-expansion-new-factories-market-strategies-for-2025-2/
## Conclusion
Tesla has demonstrated substantial financial growth with revenues almost tripling from $31.5 billion in 2020 to $97.7 billion in 2024, showing robust market demand. Despite increased R&D expenses impacting net income, the company maintains solid liquidity and a low debt-to-equity ratio, ensuring financial stability. In the stock market, Tesla's performance from 2023 to 2025 outpaced major indices like Dow Jones and NASDAQ, amid a 194.3% rise in the stock price. Future opportunities are promising, with plans for affordable models like the Model 2, advances in battery technology, and global expansion through new Gigafactories.
### Key Financial Metrics and Market Performance
| Metric/Performance | 2023 |2024 | Future Opportunities |
|------------------------|-----------------------------|-----------------------------|-----------------------------------|
| Revenue | $75.4 billion | $97.7 billion | New models & affordable EVs |
| Net Income | $15 billion | $7.13 billion | Advanced battery technologies |
| Stock Price | $281.95 | $348.68 | Global expansion plans |
| Debt-to-Equity Ratio |0.17 | 0.17 | |
| Operating Income | $9.2 billion | $7.1 billion | |
Investors should note Tesla's aggressive expansion and innovative product pipeline, which position it for continued market leadership and growth.
Part4
总结与展望
这套智能研究报告生成系统,不仅展示了AI技术在文本生成领域的实力,更体现了现代智能工作流的最佳实践。它不是“写得快”那么简单,而是“写得好、改得准、用得广”。
🌟 核心亮点,一句话概括就是“高效、智能、好用”
· 模块化设计:每个模块分工明确,像搭积木一样灵活扩展
· 多智能体协同:不是一个AI在“单打独斗”,而是多个智能体联合作战
· 质量有保障:内置评估+自动优化,报告写完还能“自我提升”
· 高自由度配置:适配不同行业、不同风格,轻松应对各种场景
· 异步并行处理:不浪费一分计算资源,让效率飞起来
🔍 这些领域,正在悄悄用上它:
· 学术报告、基金申请书、课题分析
· 市场调研、行业趋势洞察
· 技术白皮书、产品说明文档
· 政策分析、战略研判
· 竞争情报、数据解读
🚀 接下来,它还能变得更强!
· 支持图表表格,多模态内容一键生成
· 多人实时协作,像用飞书/Notion一样高效编辑
· 集成知识图谱,让内容更有深度、更可信
· 个性化推荐,根据使用习惯自动调整内容风格
· 支持多语言,英文、中文、其他语种一键切换
如果你对这个系统感兴趣,欢迎在GitHub上查看完整代码并参与贡献。让我们一起推动AI辅助内容创作的发展!
参考资料:
1.https://github.com/langchain-ai/open_deep_research
2.https://langchain-ai.github.io/langgraph/tutorials/workflows/
“
Hello~
这里是神州数码云基地
编程大法,技术前沿,尽在其中
超多原创技术干货持续输出ing~
想要第一时间获取
超硬技术干货
快快点击关注+设为星标★
- END -
往期精选
了解云基地,就现在!
53AI,企业落地大模型首选服务商
产品:场景落地咨询+大模型应用平台+行业解决方案
承诺:免费POC验证,效果达标后再合作。零风险落地应用大模型,已交付160+中大型企业
2025-08-19
GPT-OSS 图解:架构、推理模式与消息通道
2025-08-19
被“上下夹击”的Coze,开源了
2025-08-19
PS 再见!阿里 Qwen 开源全能 P 图神器,人人都是设计师!
2025-08-19
gpt-oss 模型在 Azure A10 和单卡 H100 机型上的性能测评
2025-08-19
企业级UI自动化测试落地痛点与AI提供的解决方案
2025-08-19
我的Codex是Claude Code 帮忙装好的……
2025-08-19
刚刚,Qwen-Image图像编辑版本开源了!
2025-08-19
硅基流动国际站上线 OpenAI gpt-oss
2025-07-23
2025-06-17
2025-06-17
2025-07-23
2025-08-05
2025-07-14
2025-07-12
2025-07-29
2025-07-27
2025-07-31