欢迎使用 FlowZap,快速、清晰、掌控的绘图应用。

上下文管理 - 共享记忆

Architecture

多智能体协调模式,其中编排器将工作分解为子任务,专业智能体从共享状态存储中拉取和推送,编排器从该共享状态组合最终答案。多智能体设置感觉连贯,而不是每个助手都有自己的不一致记忆。

完整 FlowZap 代码

Orchestrator {
  n1: circle label="Complex task arrives"
  n2: rectangle label="Request shared context"
  n3: rectangle label="Create research subtask"
  n4: rectangle label="Create action subtask"
  n5: rectangle label="Receive findings and results"
  n6: rectangle label="Compile final answer"
  n1.handle(right) -> n2.handle(left)
  n2.handle(bottom) -> SharedMemory.n7.handle(top) [label="Read state"]
  n3.handle(right) -> n4.handle(left)
  n3.handle(bottom) -> Researcher.n9.handle(top) [label="Research task"]
  n4.handle(bottom) -> Operator.n13.handle(top) [label="Action task"]
  n5.handle(right) -> n6.handle(left)
  Researcher.n12.handle(top) -> n5.handle(left) [label="Finding"]
  Operator.n17.handle(top) -> n5.handle(right) [label="Result"]
}

Researcher {
  n9: rectangle label="Receive research task"
  n10: rectangle label="Read shared memory"
  n11: rectangle label="Analyze with context"
  n12: rectangle label="Return finding"
  n9.handle(right) -> n10.handle(left)
  n10.handle(right) -> n11.handle(left)
  n11.handle(right) -> n12.handle(left)
  n10.handle(bottom) -> SharedMemory.n7.handle(left) [label="Read state"]
}

Operator {
  n13: rectangle label="Receive action task"
  n14: rectangle label="Read shared memory"
  n15: rectangle label="Execute with context"
  n16: rectangle label="Write result to memory"
  n17: rectangle label="Return result"
  n13.handle(right) -> n14.handle(left)
  n14.handle(right) -> n15.handle(left)
  n15.handle(right) -> n16.handle(left)
  n16.handle(bottom) -> SharedMemory.n8.handle(left) [label="Write state"]
  n15.handle(bottom) -> n17.handle(top)
}

SharedMemory {
  n7: rectangle label="Resolve memory request"
  n8: rectangle label="Update shared state"
  n7.handle(right) -> n8.handle(left)
}

相关模板

智能体主管-工作者架构

Architecture

主管-工作者多智能体架构,其中编排器智能体接收高级目标,将其分解为子任务,委派给专业工作者智能体(研究员、写作者、QA),监控执行、处理故障并综合结果。编排器管理但不亲自执行任务。

AI原生编排器-工作者架构

Architecture

编排器-工作者架构,其中编排器智能体将目标分解为子任务,分派给专业工作者,然后综合最终响应。这是最常见的"智能体编排"架构——强大,但随着工作者数量增长,编排器可能成为瓶颈。

AI原生层级架构

Architecture

层级式多智能体架构,通过堆叠主管和团队负责人(树形结构)来扩展编排,这反映了企业组织结构并有助于分区上下文。当单个编排器无法直接管理所有工作者时,这是"企业级智能体AI架构"。适合大型企业和多领域工作流。

AI原生生成器-评判者架构

Architecture

竞争式/生成器-评判者架构,多个生成器产生独立答案,然后评估器智能体评分并选择最佳输出。这种方法提高质量并减少单模型脆弱性。它更昂贵(多次LLM调用),但当正确性或创造力比延迟更重要时值得。

智能体顺序流水线架构

Architecture

顺序流水线多智能体架构,其中智能体按严格顺序排列。每个智能体转换或丰富前一个智能体的输出,然后传递下去。没有中央编排器——流程是确定性的,就像装配线。

智能体蜂群架构

Architecture

蜂群多智能体架构,多个智能体同时处理相同或相关任务,没有中央协调器。它们的输出随后由专门的聚合器节点聚合、投票或合并。智能体可以竞争——最佳输出获胜。

返回所有模板