DeepResearch机制解读多智能体协作(二)

DeepResearch机制解读多智能体协作

在复杂的 Deep Research 架构中,系统并非由单一模型孤立完成,而是通过多智能体(Multi-Agent)协作机制,将研究任务拆解为不同职能的专家角色共同完成。

多智能体职能分配

智能体角色 (Agent) 核心职责 (Core Responsibility) 协作环节
ResearchAgent (研究员) 负责执行搜索、爬取网页、信息过滤及多信源校验。 信息输入端:所有原始素材的供应者。
WriterAgent (撰稿人) 将研究员提供的压缩切片(Chunks)整合为结构化初稿。 内容生成端:负责 1200 字以上的深度产出。
EditorAgent (编辑) 检查逻辑、润色语言、核实引用格式,并根据 tone(语气)调整风格。 质量控制端:确保报告符合专业标准。
PublisherAgent (发布员) 负责将最终报告导出为 Markdown、PDF 等格式,并管理文件持久化。 成果输出端:最后的封装与交付。
HumanAgent (人类干预) 在关键决策点(如搜索结果不佳)请求用户反馈或补充指令。 人机协作环:确保研究方向不偏离预期。

工作流编排

节点名称 (Node) 职能描述
browser 先行预搜:执行第一步搜索,获取实时背景信息。
planner 全局规划:基于预搜信息,制定详细的研究大纲。
human 人工审计:在正式深挖前,由人类用户确认研究计划。
researcher 并行深挖:同时启动多个子查询,进行大规模爬取与分析。
writer 初稿撰写:汇总所有研究素材,生成深度报告。
publisher 最终发布:格式化输出并交付成果。

执行流程

1.初始化研究(initial_research)

流程预搜索 \rightarrow 子查询 \rightarrow 深度抓取 \rightarrow 内容压缩 \rightarrow 生成报告总结

目的:为后续的"主编(Editor)"提供一份详实的背景简报,让 AI 知道目前网络上关于该主题的讨论边界在哪里。

2.制定研究计划(plan_research)

在拿到初始总结后,系统进入"主编模式",通过特定的提示词将散乱的信息转化为结构化的文章大纲

提示词示例:

vbnet 复制代码
 [{'content': 'You are a research editor. Your goal is to oversee the research project from inception to completion. Your main task is to plan the article section layout based on an initial research summary.
  ', 'role': 'system'}, {'content': 'Today's date is 03/03/2026
                    {initial_research}'
                    
                    
 Your task is to generate an outline of sections headers for the research project
 based on the research summary report above.
 You must generate a maximum of 3 section headers.
 You must focus ONLY on related research topics for subheaders and do NOT include introduction, conclusion and references.
 You must return nothing but a JSON with the fields 'title' (str) and 
 'sections' (maximum 3 section headers) with the following structure:
 '{title: string research title, date: today's date, 
 sections: ['section header 1', 'section header 2', 'section header 3' ...]}'.', 'role': 'user'}]
(1)角色与目标设定 (System Role)
英文原文 (English) 中文翻译 (Chinese) 逻辑要点
You are a research editor. 你是一位研究编辑。 建立高层级的审视视角。
Your goal is to oversee the research project from inception to completion. 你的目标是全程监督研究项目,从启动到完成。 强调全生命周期的责任感
Your main task is to plan the article section layout based on an initial research summary. 你的主要任务是根据初步研究总结来规划文章的章节布局。 定义核心产出物:文章骨架

(2) 任务指令与边界约束 (User Instructions)
英文原文 (English) 中文翻译 (Chinese) 逻辑要点
Today's date is {date}. {initial_research} 今天的日期是 {date}。{初始研究总结} 提供时间锚点原始素材
Your task is to generate an outline of sections headers for the research project based on the research summary report above. 你的任务是根据上述研究总结报告,为该研究项目生成一份章节标题大纲。 明确大纲的数据来源
You must generate a maximum of 3 section headers. 你必须生成最多 3 个章节标题。 强制精简,防止研究主题过于分散。
You must focus ONLY on related research topics for subheaders. 你必须仅关注与研究主题相关的子标题。 确保每一章都有实质性内容。
Do NOT include introduction, conclusion and references. 不要包含引言、结论和参考文献。 排除干扰项,将 Token 留给硬核研究。

(3)输出格式规范 (JSON Format)

这是为了让代码能够自动化解析大纲,必须严格执行。

英文原文 (English) 中文翻译 (Chinese) 逻辑要点
You must return nothing but a JSON. 你必须仅返回一个 JSON 对象,不得有其他文字。 方便程序直接 json.loads()
Field 'title' (str): string research title. 字段 'title' (字符串):研究报告的标题。 自动生成具有吸引力的标题。
Field 'sections': maximum 3 section headers. 字段 'sections':最多包含 3 个章节标题。 确定并行任务的分支数量。
Structure: {title: str, date: str, sections: [...]} 结构:{标题, 日期, 章节列表} 预设固定的数据协议

3.用户反馈(review_plan)

在 Deep Research 的自动化流程中,用户反馈(Human Feedback) 是连接"AI 规划"与"大规模执行"的关键桥梁。它赋予了用户对研究深度和方向的最终决策权。

(1)交互逻辑流

系统在生成初步大纲后会暂停,进入等待状态,根据用户的不同反应采取不同路径:

  • 路径 A(无意见) :用户直接确认或留空。系统判定大纲通过,直接流转至最耗资源的 "并行执行研究任务" 阶段。
  • 路径 B(有意见) :用户输入修改建议(如"多关注技术细节"或"增加市场份额对比")。系统触发回溯机制,重新回到研究计划生成阶段。
(2) 动态提示词注入 (Prompt Injection)

当用户提供反馈时,系统并非简单地重启任务,而是将反馈内容实时注入plan_research 的提示词中,形成强制约束。

csharp 复制代码
 Human feedback: {human_feedback}. You must plan the sections based on the human feedback.
注入内容 (English) 中文翻译 (Chinese) 逻辑要点
Human feedback: {human_feedback}. 用户反馈:{human_feedback}。 将用户的原始建议作为核心上下文引入。
You must plan the sections based on the human feedback. 必须根据用户的反馈来规划各章节内容。 强制指令:优先级高于 AI 的自主判断,确保大纲向用户意图靠拢。

4.大规模并行研究(run_parallel_research)

在用户确认了大纲(Plan)后,系统进入了计算量最密集、研究深度最核心的阶段:大规模并行执行(Run Parallel Research) 。系统为大纲中的每一个章节标题都启动了一个独立的、具备"三位一体"职能的子工作流。

(1)并行执行架构

系统不再是一个人作战,而是为每个章节主题分配了一组协同智能体,通过并发处理极大地缩短了深度研究的时间。

三大核心协同智能体

在这个流程中,每个子任务都会配置以下三类角色,形成一个 "搜索-评估-修正" 的小型闭环:

智能体 (Agent) 职责描述 (Responsibility) 核心价值
research (研究员) 执行实际的搜索、网页抓取和信息提取任务。 数据获取:负责从互联网挖掘最原始的素材。
reviewer (审核员) research 拿回的信息进行质量评估、逻辑检查及信源真实性核对。 质量把控:负责发现漏洞、冲突或深度不足的问题。
reviser (修订员) 根据 reviewer 的反馈意见,重新调整搜索策略或补充特定缺失的信息。 动态闭环:负责查漏补缺,确保该章节的研究"滴水不漏"。
(2)并行协作逻辑流程
  1. 任务拆解:系统提取大纲中的 Section 1, Section 2, Section 3。

  2. 并发启动:针对每个 Section,同时运行上述三个智能体。

  3. 内部循环 (Internal Loop)

    • research 提供初步研究数据。
    • reviewer 评估:"数据太旧了"或"缺乏具体财报数字"。
    • reviser 响应:"正在针对 2026 年 Q1 财报进行补充搜索"。
  4. 结果汇总:当所有章节的"小闭环"都完成后,系统将这些深度验证后的干货汇总。

  • research流程

    系统的研究逻辑是基于 父查询 (Parent Query)子查询 (Query) 的关联展开的:

    • parent_query:研究的大背景(例如:武汉房价趋势)。
    • query:具体的章节主题(例如:光谷核心区 2026 年新盘供应量)。

    research会根据{parent_query} - {query},再次执行

    预搜索 \rightarrow 子查询 \rightarrow 深度抓取 \rightarrow 内容压缩 \rightarrow 生成报告总结

  • reviewer流程

    research 节点生成章节总结后,系统不会直接采用,而是将其送往 reviewer (审核员) 进行严苛的质量评估。这是系统防范"AI 幻觉"和"格式错误"的最后一道防线。

    审核员充当了流程的"闸门",其决策直接决定了任务的走向:

    • 判定:接受 (Accept) :如果草案符合所有准则,审核员返回 None。流程结束,该章节进入汇总池。
    • 判定:修订 (Revision) :如果草案存在瑕疵,审核员会生成详细的修订意见 (Revision Notes) ,并将其流转至 reviser 节点。

    提示词示例:

    vbnet 复制代码
     [{'content': 'You are an expert research article reviewer. Your goal is to review research drafts and provide feedback to the reviser only based on specific guidelines. ', 'role': 'system'}, {'content': 'You have been tasked with reviewing the draft which was written by a non-expert based on specific guidelines.
     Please accept the draft if it is good enough to publish, or send it for revision, along with your notes to guide the revision.
     If not all of the guideline criteria are met, you should send appropriate revision notes.
     If the draft meets all the guidelines, please return None.
     ​
     ​
     Guidelines: {guidelines}
     Draft: {'draft'}
     ', 'role': 'user'}]

    太抱歉了!刚才确实只顾着分析逻辑,没有把提示词原本的内容进行逐句对照翻译。

    现在为您奉上最完整、最严格Reviewer(审核员) 提示词中英文对照表:


    Reviewer 提示词逻辑对照表
    英文原文 (English) 中文翻译 (Chinese) 逻辑要点
    You are an expert research article reviewer. 你是一位资深的研究文章审核员。 强制 AI 切换至批判性视角,而非生成模式。
    ...provide feedback... only based on specific guidelines. ......仅根据特定准则提供反馈意见。 限制审核范围,确保 AI 严格执行预设标准。
    Please accept the draft if it is good enough to publish... 如果草案已达到发布水平,请予以接受...... 定义正向判定,作为流程完结的终极目标。
    ...or send it for revision, along with your notes... ......否则请将其发回修订,并附上修订笔记。 负向判定 :必须产生可操作的指令喂给 reviser
    If not all of the guideline criteria are met, you should send... notes. 如果未满足准则中的所有标准,你应该发送......笔记。 全量审查:哪怕只有一项不符,也必须触发拦截机制。
    If the draft meets all the guidelines, please return None. 如果草案符合所有准则要求,请返回 None 预设固定的程序开关信号,用于结束循环。
    Guidelines: {guidelines} 准则:{guidelines} 动态注入业务规则,保持审核标准的灵活性
    Draft: {'draft'} 草案:{'draft'} 明确处理对象 ,对 research 生成的内容进行对账。
  • reviser流程

    修订员(Reviser)的任务是扮演一位"顶尖撰稿人",将审核员(Reviewer)的批判性意见转化为高质量的正式稿件。

    提示词示例

    python 复制代码
     [{'content': 'You are an expert writer. Your goal is to revise drafts based on reviewer notes.', 'role': 'system'}, {'content': {draft_report} Reviewer's notes:
     {review}
     ​
     ​
     You have been tasked by your reviewer with revising the following draft, which was written by a non-expert.
     If you decide to follow the reviewer's notes, please write a new draft and make sure to address all of the points they raised.
     Please keep all other aspects of the draft the same.
     You MUST return nothing but a JSON in the following format:
     ​
     {
       "draft": { 
         draft title: The revised draft that you are submitting for review 
       },
       "revision_notes": Your message to the reviewer about the changes you made to the draft based on their feedback
     }
     ​
     ', 'role': 'user'}]
    Reviser 提示词逻辑对照表
    英文原文 (English) 中文翻译 (Chinese) 逻辑要点
    You are an expert writer. 你是一位专家级的撰稿人。 建立专业创作视角,要求文字功底高于初稿 Agent。
    Your goal is to revise drafts based on reviewer notes. 你的目标是根据审核员的笔记修订草案。 明确唯一驱动源:所有的修改必须围着审核意见转。
    ...make sure to address all of the points they raised. ......确保解决他们提出的所有要点。 闭环要求:禁止遗漏任何一条差评建议,必须逐一消灭问题。
    Please keep all other aspects of the draft the same. 请保持草案的其他所有方面不变。 稳定性原则:只修补坏掉的地方,不要在没问题的地方乱改。
    You MUST return nothing but a JSON... 你必须仅返回一个特定格式的 JSON...... 确保输出结果可以被系统自动解析并重新提交审核。
    Field "draft": { draft title: revised draft } 字段 "draft":{ 标题: 修改后的草案 } 交付核心产出物,即更新后的章节内容。
    Field "revision_notes": Your message to the reviewer... 字段 "revision_notes":你写给审核员关于修改情况的说明。 沟通对账:告诉审核员你是怎么改的,便于下一轮审核对比。

    接收输入 :Reviser 同时读取 draft_report(原稿)和 review(差评笔记)。

    执行修改

    • 如果笔记说"缺数据",Reviser 可能需要重新调用搜索工具补全。
    • 如果笔记说"格式不对",Reviser 则进行文本重构。

    产出 JSON

    • draft:新的正文。
    • revision_notes:例如"我已经按要求增加了 2026 年的财报链接"。

5.撰写最终研究报告

在这一阶段,系统不再进行新的搜索,而是扮演"首席撰稿人"的角色,对已有的海量研究数据(Research Data)进行高水平的提炼与整合。

提示词示例

vbnet 复制代码
 [{'content': 'You are a research writer. Your sole purpose is to write a well-written research reports about a topic based on research findings and information.
  ', 'role': 'system'}, {'content': 'Today's date is 03/03/2026
 .Query or Topic: {query}
 Research data: {data}
 Your task is to write an in depth, well written and detailed introduction and conclusion to the research report based on the provided research data. Do not include headers in the results.
 You MUST include any relevant sources to the introduction and conclusion as markdown hyperlinks -For example: 'This is a sample text. ([url website](url))'
 ​
 You must follow the guidelines provided: {guidelines}
 You MUST return nothing but a JSON in the following format (without json markdown):
 ​
 {
   "table_of_contents": A table of contents in markdown syntax (using '-') based on the research headers and subheaders,
   "introduction": An indepth introduction to the topic in markdown syntax and hyperlink references to relevant sources,
   "conclusion": A conclusion to the entire research based on all research data in markdown syntax and hyperlink references to relevant sources,
   "sources": A list with strings of all used source links in the entire research data in markdown syntax and apa citation format. For example: ['-  Title, year, Author [source url](source)', ...]
 }
 ​
 ​
 ', 'role': 'user'}]
提示词逻辑对照表
英文原文 (English) 中文翻译 (Chinese) 逻辑要点
You are a research writer... write well-written research reports. 你是一位研究撰稿人......负责撰写高质量的研究报告。 角色定位:由"搜索模式"转为"创作模式",强调文字的逻辑性与专业感。
Topic: {query} / Research data: {data} 主题:{query} / 研究数据:{data} 数据驱动:{data} 包含了之前并行研究产生的所有章节、来源及修订后的干货。
...detailed introduction and conclusion... based on provided data. ......根据提供的数据撰写深入、详尽的引言与结论。 核心任务:此时章节正文已完成,本步骤重点在于完成报告的"头"和"尾"。
Do not include headers in the results. 结果中不得包含标题(Headers)。 格式控制:防止 AI 自行添加多余的 Markdown 标题,干扰后续 JSON 拼接。
MUST include relevant sources... as markdown hyperlinks. 必须将相关来源以 Markdown 超链接形式加入引言和结论。 证据链闭环:确保即便是总结性内容,每一条论述也都有据可查。
You must follow the guidelines provided: {guidelines} 你必须遵守提供的准则:{guidelines} 动态约束:再次注入全局规则(如语言要求、特定语气等)。
You MUST return nothing but a JSON... (without json markdown) 你必须仅返回一个 JSON 对象(不得使用 json markdown 标识符)。 机器解析:严格要求纯文本 JSON 格式,以便后端直接提取各字段内容。

JSON 输出结构字段解析
字段名 (Field) 含义解析 (Meaning) 逻辑要求 (Requirement)
table_of_contents 目录 使用 Markdown 列表语法 (-),基于已有的章节标题自动生成导航。
introduction 引言 对主题进行深度背景介绍,并嵌入超链接参考。
conclusion 结论 基于所有研究数据,对全文进行升华总结,同样需包含超链接参考。
sources 参考资料列表 将全文涉及的所有来源整理为字符串列表,且必须符合 APA 引用格式
相关推荐
科学修行的红客4 小时前
简单设置解决cursor连接远程服务器失败问题
ai编程·cursor
lcddjm4 小时前
openclaw 配置使用第三方的api
ai编程
程序员鱼皮4 小时前
微软竟然出了免费的 AI 应用开发课?!我已经学上了
人工智能·程序员·ai编程
小碗细面5 小时前
Anthropic 官方指南:构建 Skills 的秘密都在这里
aigc·ai编程
卡尔AI工坊5 小时前
2026年3月,我实操后最推荐的3个AI开源项目
人工智能·开源·ai编程
程序员小崔日记19 小时前
一个命令,切换整个世界:CCSwitch 到底是什么?
ai编程·claudecode·ccswitch
量子位21 小时前
全球首份大模型业绩报!MiniMax预判2026三大超级PMF,AI平台公司启程了
aigc·ai编程
悟空码字1 天前
告别“屎山代码”:AI 代码整洁器让老项目重获新生
后端·aigc·ai编程
鲨叔1 天前
CC Switch 作者故事启发 - 从转行到破局
ai编程