返回顶部
热门问答 更多热门问答
技术文章 更多技术文章

AGI|研究报告还能这样写?揭秘Open Deep Research智能生成全流程

[复制链接]
链载Ai 显示全部楼层 发表于 昨天 22:07 |阅读模式 打印 上一主题 下一主题

Open Deep Research智能生成全流程

在人工智能飞速发展的今天,自动化内容生成已经成为提升工作效率的关键工具。今天想和大家分享一个极具创新性的开源系统 ——Open Deep Research。


它基于LangGraph构建,能自动完成从主题规划、资料检索到内容撰写、语言润色的全过程,是一位真正意义上的“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)


智能规划节点


报告规划是整个系统的起点:


asyncdefgenerate_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 =awaitstructured_llm.ainvoke([
SystemMessage(content=system_instructions),
HumanMessage(content="Generate search queries for planning.")
])

# 网络搜索获取背景信息
query_list = [query.search_queryforqueryinresults.queries]
source_str =awaitselect_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 =awaitstructured_llm.ainvoke([
SystemMessage(content=system_instructions_sections),
HumanMessage(content=planner_message)
])

return{"sections": report_sections.sections}


这个节点的精妙之处在于:


· 双阶段规划:先搜索背景信息,再制定具体计划


· 反馈集成:能够根据人工反馈调整规划


· 结构化输出:确保输出格式的一致性


人工反馈机制


defhuman_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'ifsection.researchelse'No'}\n"
forsectioninsections
)

interrupt_message =f"""lease 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)

ifisinstance(feedback, bool)andfeedbackisTrue:
# 批准后启动并行章节研究
returnCommand(goto=[
Send("build_section_with_web_research", {
"topic": topic,
"section": s,
"search_iterations":0
})forsinsectionsifs.research
])
elifisinstance(feedback, str):
# 反馈后重新规划
returnCommand(
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的一个重要特性是自动质量控制:


asyncdefwrite_section(state: SectionState, config: RunnableConfig)-> Command:
# 生成章节内容
section_content =awaitwriter_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 =awaitreflection_model.ainvoke([
SystemMessage(content=section_grader_instructions_formatted),
HumanMessage(content=section_grader_message)
])

# 根据评估结果决定下一步
iffeedback.grade =="pass"orstate["search_iterations"] >= max_search_depth:
returnCommand(update={"completed_sections": [section]}, goto=END)
else:
returnCommand(
update={"search_queries": feedback.follow_up_queries,"section": section},
goto="search_web"
)


这种设计实现了:


· 自动质量评估:LLM评估内容质量


· 迭代改进:根据评估结果决定是否需要更多研究


· 深度控制:防止无限迭代



Part2

多智能体模式



▶ 特点:


·多智能体并行协作:一个主管智能体(Supervisor)负责任务分配,多个研究智能体(Researchers)同时处理不同章节。


·效率更高:并行执行各个部分,整体报告生成速度快。


·自动化程度更高:适合无人值守或自动化报告生成任务。


·支持MCP工具:可接入本地文件、数据库、API 等进行扩展研究。


▶ 适合场景:


· 快速生成报告、自动化内容生产。


· 集成多来源数据(如文件系统、数据库)进行知识检索和写作。


· 需要并发处理的复杂任务。


智能体角色设计


多智能体模式采用了明确的角色分工:


classReportState(MessagesState):
sections: list[str]# 报告章节列表
completed_sections: Annotated[list[Section], operator.add]# 已完成章节
final_report: str# 最终报告
question_asked: bool# 是否已提问
source_str: Annotated[str, operator.add]# 搜索来源


监督者智能体


监督者负责整体协调和高级决策:


asyncdefsupervisor(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)

# 如果章节研究完成但报告未完成,启动引言和结论撰写
ifstate.get("completed_sections")andnotstate.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工具
ifstate.get("question_asked",False):
supervisor_tool_list = [toolfortoolinsupervisor_tool_list
iftool.name !="Question"]

llm_with_tools = llm.bind_tools(supervisor_tool_list, tool_choice="any")

return{
"messages": [
awaitllm_with_tools.ainvoke([
{"role":"system","content": SUPERVISOR_INSTRUCTIONS.format(today=get_today_str())}
] + messages)
]
}


研究者智能体


研究者智能体专注于具体的章节研究:


asyncdefresearch_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 =awaitget_research_tools(config)

system_prompt = RESEARCH_INSTRUCTIONS.format(
section_description=state["section"],
number_of_queries=configurable.number_of_queries,
today=get_today_str(),
)

# 添加MCP提示(如果配置了)
ifconfigurable.mcp_prompt:
system_prompt +=f"\n\n{configurable.mcp_prompt}"

return{
"messages": [
awaitllm.bind_tools(research_tool_list, tool_choice="any").ainvoke([
{"role":"system","content": system_prompt}
] + state["messages"])
]
}


工具系统设计


Open Deep Research支持动态工具配置:


defget_search_tool(config: RunnableConfig):
configurable = Configuration.from_runnable_config(config)
search_api = get_config_value(configurable.search_api)

ifsearch_api.lower() =="none":
returnNone
elifsearch_api.lower() =="tavily":
search_tool = tavily_search
elifsearch_api.lower() =="duckduckgo":
search_tool = duckduckgo_search
else:
raiseNotImplementedError(f"Search API '{search_api}' not supported")

# 添加工具元数据
tool_metadata = {**(search_tool.metadataor{}),"type":"search"}
search_tool.metadata = tool_metadata
returnsearch_tool

asyncdefget_research_tools(config: RunnableConfig)-> list[BaseTool]:
search_tool = get_search_tool(config)
tools = [tool(Section), tool(FinishResearch)]

ifsearch_toolisnotNone:
tools.append(search_tool)

# 加载MCP工具
existing_tool_names = {cast(BaseTool, tool).namefortoolintools}
mcp_tools =await_load_mcp_tools(config, existing_tool_names)
tools.extend(mcp_tools)

returntools



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 appreciationanddominance over benchmarksandpeers, highlighting its competitive market stance. Future opportunities further emphasize expansion through innovative product launchesandtechnological 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.5billionin2020to $97.7billionin2024, marking a substantial riseanddemonstrating strong market demandandexpansion capabilities [1,2]. Despite fluctuations, Tesla maintained robust gross profits, achieving $17.4billionin2024, which is slightly lower than the $20.8billionin2023but still indicative of a strong operational performance [3].

Concerning margins, Tesla’s operating income reached $7.1billionin2024,whilethe net income stood at $7.13billion, a notable drop from the $15 billionin2023, primarily linked to increased operating expensesandreduced income from non-operating sources [1]. The declineinprofitability suggests pressures from higher expenses including researchanddevelopment (R&D) that rose to $4.54billionin2024from $3.97billion the previous year [3].

Tesla’s total assets expanded significantly, from $95.34billionin2023to $104.3billionin2024, reflective of robust investmentsininfrastructureandexpansion projects [4]. Additionally, Tesla’s liabilities also grew, indicating increasing financial obligations possibly due to strategic leveragingforexpansion [5].

Analyzing ratios, Tesla shows robust liquidity with a current ratio of2.00anda quick ratio of1.38, as of June2025, indicating healthy short-term financial stability [6]. The debt-to-equity ratio remained low at0.17, exhibiting strong equity positioningandmanageable debt levels [1].

Collectively, Tesla’s financial healthandstrategic investments position it wellforfuture opportunities despite recent profitability challenges.

### Sources
[1] Tesla Financial Statements2009-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) Financials2025- Income Statementand... -MarketBeat:https://www.marketbeat.com/stocks/NASDAQ/TSLA/financials/
[5] Tesla, Inc. AnnualReport:https://www.annualreports.com/Company/tesla-inc
[6] Tesla (TSLA) Financial Ratios - StockAnalysis:https://stockanalysis.com/stocks/tsla/financials/ratios/

## Market Performance of Tesla

Between2023and2025, 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,600by2029, 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 propositionforinvestors considering its robust growth prospectsandcompetitive market position.

### Sources
[1] Tesla Stock Price2023To2025| 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 Buyin2025? 3-Year Performance AnalysisandForecast: https://www.techi.com/tesla-stock-buy-2025-analysis-forecast/

## Future OpportunitiesforTesla

Tesla is poised to capitalize on several promising opportunitiesinthe coming years, focusing on new product launches, technological advancements,andstrategic market expansions.

Regarding new product launches, Tesla plans to unveil the Model 2, an affordable electric vehicle tailoredfora broader customer base. This vehicle will likely gain tractioninurban areasandemerging economies, helping Tesla penetrate new markets with its cost-effective solutions [1,2]. Other notable productsincludethe Tesla Van, which targets commercialandfamily use,anda compact, solar-powered Tiny House designedforsustainable living [1,2].

Technological advancements are central to Tesla’s strategy. The development of the 4680 battery cells, which offer higher energy densityandlower production costs, will enhance vehicle rangeandperformance, 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 alsoinTesla's roadmap. The company is accelerating its global expansion by establishing new manufacturing facilities, such as the GigafactoryinMexicoandpotential sitesinIndiaandthe Netherlands [6]. These plants will support increased production capacity, meeting global demandandreducing 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 Teslaforsustained growth by diversifying its product offeringsandleveraging advanced technologies to enhance performanceandcustomer experience.

### Sources
[1] Tesla’s 2025 Innovation Lineup: Affordable ModelsandNew 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 billionin2020 to $97.7 billionin2024, showing robust market demand. Despite increased R&D expenses impacting net income, the company maintains solid liquidityanda low debt-to-equity ratio, ensuring financial stability. In the stock market, Tesla's performance from 2023 to 2025 outpaced major indices like Dow JonesandNASDAQ, amid a 194.3% riseinthe stock price. Future opportunities are promising, with plansforaffordable models like the Model 2, advancesinbattery technology,andglobal expansion through new Gigafactories.

### Key Financial MetricsandMarket Performance

|Metric/Performance| 2023 |2024 | Future Opportunities |
|------------------------|-----------------------------|-----------------------------|-----------------------------------|
|Revenue| $75.4 billion |$97.7billion| 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.1billion| |

Investors should note Tesla's aggressive expansion and innovative product pipeline, which position it for continued market leadership and growth.



Part4

总结与展望


这套智能研究报告生成系统,不仅展示了AI技术在文本生成领域的实力,更体现了现代智能工作流的最佳实践。它不是“写得快”那么简单,而是“写得好、改得准、用得广”。


🌟 核心亮点,一句话概括就是“高效、智能、好用”


· 模块化设计:每个模块分工明确,像搭积木一样灵活扩展


· 多智能体协同:不是一个AI在“单打独斗”,而是多个智能体联合作战


· 质量有保障:内置评估+自动优化,报告写完还能“自我提升”


· 高自由度配置:适配不同行业、不同风格,轻松应对各种场景


· 异步并行处理:不浪费一分计算资源,让效率飞起来


🔍 这些领域,正在悄悄用上它:


· 学术报告、基金申请书、课题分析


· 市场调研、行业趋势洞察


· 技术白皮书、产品说明文档


· 政策分析、战略研判


· 竞争情报、数据解读


🚀 接下来,它还能变得更强!


· 支持图表表格,多模态内容一键生成


· 多人实时协作,像用飞书/Notion一样高效编辑


· 集成知识图谱,让内容更有深度、更可信


· 个性化推荐,根据使用习惯自动调整内容风格


· 支持多语言,英文、中文、其他语种一键切换

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

链载AI是专业的生成式人工智能教程平台。提供Stable Diffusion、Midjourney AI绘画教程,Suno AI音乐生成指南,以及Runway、Pika等AI视频制作与动画生成实战案例。从提示词编写到参数调整,手把手助您从入门到精通。
  • 官方手机版

  • 微信公众号

  • 商务合作

  • Powered by Discuz! X3.5 | Copyright © 2025-2025. | 链载Ai
  • 桂ICP备2024021734号 | 营业执照 | |广西笔趣文化传媒有限公司|| QQ