multi-agent-patterns

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Multi-Agent Architecture Patterns

Multi-Agent架构模式

Multi-agent architectures distribute work across multiple language model instances, each with its own context window. When designed well, this distribution enables capabilities beyond single-agent limits. When designed poorly, it introduces coordination overhead that negates benefits. The critical insight is that sub-agents exist primarily to isolate context, not to anthropomorphize role division.
Multi-Agent架构将工作分配到多个语言模型实例中,每个实例都有自己的上下文窗口。设计良好的情况下,这种分配方式能实现超越单Agent限制的能力;设计不佳时,则会引入协调开销,抵消其优势。核心要点在于:子Agent的存在主要是为了实现Context Isolation,而非拟人化的角色划分。

When to Activate

适用场景

Activate this skill when:
  • Single-agent context limits constrain task complexity
  • Tasks decompose naturally into parallel subtasks
  • Different subtasks require different tool sets or system prompts
  • Building systems that must handle multiple domains simultaneously
  • Scaling agent capabilities beyond single-context limits
  • Designing production agent systems with multiple specialized components
Do not activate this skill for adjacent work owned by other skills:
  • Deciding task-model fit, pipeline shape, or project-level cost before topology is known:
    project-development
    .
  • Designing hosted sandboxes, warm pools, remote sessions, or background runtime infrastructure:
    hosted-agents
    .
  • Sharing orchestrator state through KV-cache compaction in controlled runtimes:
    latent-briefing
    .
  • Designing the tools each agent exposes:
    tool-design
    .
在以下场景中启用本技能:
  • 单Agent的上下文限制制约了任务复杂度
  • 任务可自然分解为并行子任务
  • 不同子任务需要不同的工具集或系统提示词
  • 构建必须同时处理多个领域的系统
  • 将Agent能力扩展到单上下文限制之外
  • 设计包含多个专用组件的生产级Agent系统
请勿在以下属于其他技能负责的相关工作中启用本技能:
  • 在拓扑结构确定前,判断任务与模型的适配性、流水线形态或项目级成本:
    project-development
  • 设计托管沙箱、预热池、远程会话或后台运行时基础设施:
    hosted-agents
  • 在受控运行时中通过KV缓存压缩共享编排器状态:
    latent-briefing
  • 设计每个Agent暴露的工具:
    tool-design

Core Concepts

核心概念

Use multi-agent patterns when a single agent's context window cannot hold all task-relevant information. Context isolation is the primary benefit — each agent operates in a clean context without accumulated noise from other subtasks, preventing the telephone game problem where information degrades through repeated summarization.
Choose among three dominant patterns based on coordination needs, not organizational metaphor:
  • Supervisor/orchestrator — Use for centralized control when tasks have clear decomposition and human oversight matters. A single coordinator delegates to specialists and synthesizes results.
  • Peer-to-peer/swarm — Use for flexible exploration when rigid planning is counterproductive. Any agent can transfer control to any other through explicit handoff mechanisms.
  • Hierarchical — Use for large-scale projects with layered abstraction (strategy, planning, execution). Each layer operates at a different level of detail with its own context structure.
Design every multi-agent system around explicit coordination protocols, consensus mechanisms that resist sycophancy, and failure handling that prevents error propagation cascades.
当单Agent的上下文窗口无法容纳所有任务相关信息时,应采用Multi-Agent模式。Context Isolation是主要优势——每个Agent在干净的上下文中运行,不会受到其他子任务积累的干扰,避免了“传话游戏”问题(即信息在多次总结中逐渐失真)。
根据协调需求而非组织隐喻,选择三种主流模式:
  • Supervisor/Orchestrator(监督者/编排器) — 适用于任务分解清晰、需要人工监督的集中式控制场景。单个协调者将任务委派给专用Agent,并综合结果。
  • Peer-to-peer/Swarm(点对点/集群) — 适用于灵活探索场景,此时严格规划反而适得其反。任何Agent都可通过明确的交接机制将控制权转移给其他Agent。
  • Hierarchical(分层式) — 适用于具有分层抽象(策略、规划、执行)的大型项目。每个层级在不同细节层面运行,拥有各自的上下文结构。
围绕明确的协调协议、能抵制趋同附和的共识机制,以及防止错误传播连锁反应的故障处理机制来设计每个Multi-Agent系统。

Detailed Topics

详细主题

Why Multi-Agent Architectures

为何选择Multi-Agent架构

The Context Bottleneck Reach for multi-agent architectures when a single agent's context fills with accumulated history, retrieved documents, and tool outputs to the point where performance degrades. Recognize three degradation signals: the lost-in-middle effect (attention weakens for mid-context content), attention scarcity (too many competing items), and context poisoning (irrelevant content displaces useful content).
Partition work across multiple context windows so each agent operates in a clean context focused on its subtask. Aggregate results at a coordination layer without any single context bearing the full burden.
The Token Economics Reality Budget for substantially higher token costs. Production data shows multi-agent systems can cost far more tokens than single-agent chat (claim-multi-agent-token-multiplier):
ArchitectureToken MultiplierUse Case
Single agent chatBaselineSimple queries
Single agent with toolsHigher than baselineTool-using tasks
Multi-agent systemMuch higher than baselineComplex research/coordination
Browsing-agent evaluation research suggests token usage, tool calls, and model choice dominate performance variance (claim-evaluation-browsecomp-variance). This supports measuring multi-agent setups against single-agent baselines instead of assuming extra agents help.
Prioritize model selection alongside architecture design — upgrading to better models often provides larger performance gains than doubling token budgets. BrowseComp data shows that model quality improvements frequently outperform raw token increases. Treat model selection and multi-agent architecture as complementary strategies.
The Parallelization Argument Assign parallelizable subtasks to dedicated agents with fresh contexts rather than processing them sequentially in a single agent. A research task requiring searches across multiple independent sources, analysis of different documents, or comparison of competing approaches benefits from parallel execution. Total real-world time approaches the duration of the longest subtask rather than the sum of all subtasks.
The Specialization Argument Configure each agent with only the system prompt, tools, and context it needs for its specific subtask. A general-purpose agent must carry all possible configurations in context, diluting attention. Specialized agents carry only what they need, operating with lean context optimized for their domain. Route from a coordinator to specialized agents to achieve specialization without combinatorial explosion.
上下文瓶颈 当单Agent的上下文被积累的历史记录、检索到的文档和工具输出填满,导致性能下降时,就该考虑Multi-Agent架构。识别三种性能退化信号:中间信息丢失效应(对上下文中间内容的注意力减弱)、注意力稀缺(过多竞争项)、上下文污染(无关内容取代有用内容)。
将工作划分到多个上下文窗口中,让每个Agent专注于其子任务,在干净的上下文中运行。在协调层聚合结果,无需单个上下文承担全部负担。
Token经济现实 需为大幅增加的Token成本做好预算。生产数据显示,Multi-Agent系统的Token消耗可能远高于单Agent聊天(参考:claim-multi-agent-token-multiplier):
架构类型Token乘数适用场景
单Agent聊天基准值简单查询
带工具的单Agent高于基准值使用工具的任务
Multi-Agent系统远高于基准值复杂研究/协调任务
浏览Agent评估研究表明,Token使用量、工具调用和模型选择是影响性能差异的主要因素(参考:claim-evaluation-browsecomp-variance)。这支持将Multi-Agent设置与单Agent基准进行对比,而非假设额外Agent一定有用。
在架构设计的同时优先考虑模型选择——升级到更优模型通常比加倍Token预算带来更大的性能提升。BrowseComp数据显示,模型质量的提升往往优于单纯增加Token数量。将模型选择和Multi-Agent架构视为互补策略。
并行化论证 将可并行的子任务分配给拥有全新上下文的专用Agent,而非在单个Agent中按顺序处理。需要跨多个独立来源搜索、分析不同文档或比较竞争方案的研究任务,能从并行执行中获益。实际总耗时接近最长子任务的时长,而非所有子任务时长之和。
专业化论证 为每个Agent仅配置其特定子任务所需的系统提示词、工具和上下文。通用Agent必须在上下文中携带所有可能的配置,分散注意力。专用Agent仅携带所需内容,在针对其领域优化的精简上下文中运行。通过协调者路由到专用Agent,实现专业化而不会产生组合爆炸。

Architectural Patterns

架构模式

Pattern 1: Supervisor/Orchestrator Deploy a central agent that maintains global state and trajectory, decomposes user objectives into subtasks, and routes to appropriate workers.
User Query -> Supervisor -> [Specialist, Specialist, Specialist] -> Aggregation -> Final Output
Choose this pattern when: tasks have clear decomposition, coordination across domains is needed, or human oversight is important.
Expect these trade-offs: strict workflow control and easier human-in-the-loop interventions, but the supervisor context becomes a bottleneck, supervisor failures cascade to all workers, and the "telephone game" problem emerges where supervisors paraphrase sub-agent responses incorrectly.
The Telephone Game Problem and Solution Anticipate that supervisor architectures initially perform approximately 50% worse than optimized versions due to the telephone game problem (LangGraph benchmarks). Supervisors paraphrase sub-agent responses, losing fidelity with each pass.
Fix this by implementing a
forward_message
tool that allows sub-agents to pass responses directly to users:
python
def forward_message(message: str, to_user: bool = True):
    """
    Forward sub-agent response directly to user without supervisor synthesis.

    Use when:
    - Sub-agent response is final and complete
    - Supervisor synthesis would lose important details
    - Response format must be preserved exactly
    """
    if to_user:
        return {"type": "direct_response", "content": message}
    return {"type": "supervisor_input", "content": message}
Prefer swarm architectures over supervisors when sub-agents can respond directly to users, as this eliminates translation errors entirely.
Pattern 2: Peer-to-Peer/Swarm Remove central control and allow agents to communicate directly based on predefined protocols. Any agent transfers control to any other through explicit handoff mechanisms.
python
def transfer_to_agent_b():
    return agent_b  # Handoff via function return

agent_a = Agent(
    name="Agent A",
    functions=[transfer_to_agent_b]
)
Choose this pattern when: tasks require flexible exploration, rigid planning is counterproductive, or requirements emerge dynamically and defy upfront decomposition.
Expect these trade-offs: no single point of failure and effective breadth-first scaling, but coordination complexity increases with agent count, divergence risk rises without a central state keeper, and robust convergence constraints become essential.
Define explicit handoff protocols with state passing. Ensure agents communicate their context needs to receiving agents.
Pattern 3: Hierarchical Organize agents into layers of abstraction: strategy (goal definition), planning (task decomposition), and execution (atomic tasks).
Strategy Layer (Goal Definition) -> Planning Layer (Task Decomposition) -> Execution Layer (Atomic Tasks)
Choose this pattern when: projects have clear hierarchical structure, workflows involve management layers, or tasks require both high-level planning and detailed execution.
Expect these trade-offs: clear separation of concerns and support for different context structures at different levels, but coordination overhead between layers, potential strategy-execution misalignment, and complex error propagation paths.
模式1:Supervisor/Orchestrator(监督者/编排器) 部署一个维护全局状态和执行轨迹的中心Agent,将用户目标分解为子任务,并路由到合适的工作Agent。
用户查询 -> Supervisor -> [专用Agent, 专用Agent, 专用Agent] -> 结果聚合 -> 最终输出
当任务分解清晰、需要跨领域协调或人工监督很重要时,选择此模式。
需权衡利弊:严格的工作流控制和更易实现的人工介入,但Supervisor上下文会成为瓶颈,Supervisor故障会波及所有工作Agent,且会出现“传话游戏”问题——Supervisor会错误地转述子Agent的响应。
传话游戏问题及解决方案 预计Supervisor架构初始性能比优化版本低约50%,原因是传话游戏问题(LangGraph基准测试)。Supervisor转述子Agent的响应,每传递一次就会丢失保真度。
通过实现
forward_message
工具解决此问题,该工具允许子Agent直接将响应传递给用户:
python
def forward_message(message: str, to_user: bool = True):
    """
    将子Agent的响应直接转发给用户,无需Supervisor综合处理。

    使用场景:
    - 子Agent的响应是最终且完整的
    - Supervisor综合处理会丢失重要细节
    - 必须严格保留响应格式
    """
    if to_user:
        return {"type": "direct_response", "content": message}
    return {"type": "supervisor_input", "content": message}
当子Agent可直接响应用户时,优先选择Swarm架构,这样能完全消除翻译错误。
模式2:Peer-to-peer/Swarm(点对点/集群) 移除中央控制,允许Agent基于预定义协议直接通信。任何Agent都可通过明确的交接机制将控制权转移给其他Agent。
python
def transfer_to_agent_b():
    return agent_b  # 通过函数返回实现任务交接

agent_a = Agent(
    name="Agent A",
    functions=[transfer_to_agent_b]
)
当任务需要灵活探索、严格规划适得其反,或需求动态出现且无法提前分解时,选择此模式。
需权衡利弊:无单点故障,可有效进行广度优先扩展,但协调复杂度随Agent数量增加而上升,无中央状态 keeper时偏离风险增加,且必须具备强大的收敛约束。
定义带有状态传递的明确交接协议,确保Agent向接收Agent传达其上下文需求。
模式3:Hierarchical(分层式) 将Agent组织为抽象层级:策略层(目标定义)、规划层(任务分解)、执行层(原子任务)。
策略层(目标定义) -> 规划层(任务分解) -> 执行层(原子任务)
当项目具有清晰的层级结构、工作流涉及管理层级,或任务需要高层规划和详细执行时,选择此模式。
需权衡利弊:关注点清晰分离,支持不同层级使用不同的上下文结构,但层级间协调开销大,可能出现策略与执行不一致,且错误传播路径复杂。

Context Isolation as Design Principle

以Context Isolation为设计原则

Treat context isolation as the primary purpose of multi-agent architectures. Each sub-agent should operate in a clean context window focused on its subtask without carrying accumulated context from other subtasks.
Isolation Mechanisms Select the right isolation mechanism for each subtask:
  • Full context delegation — Share the planner's entire context with the sub-agent. Use for complex tasks where the sub-agent needs complete understanding. The sub-agent has its own tools and instructions but receives full context for its decisions. Note: this partially defeats the purpose of context isolation.
  • Instruction passing — Create instructions via function call; the sub-agent receives only what it needs. Use for simple, well-defined subtasks. Maintains isolation but limits sub-agent flexibility.
  • File system memory — Agents read and write to persistent storage. Use for complex tasks requiring shared state. The file system serves as the coordination mechanism, avoiding context bloat from shared state passing. Introduces latency and consistency challenges but scales better than message-passing.
Choose based on task complexity, coordination needs, and acceptable latency. Default to instruction passing and escalate to file system memory when shared state is needed. Avoid full context delegation unless the subtask genuinely requires it.
将Context Isolation视为Multi-Agent架构的主要目标。每个子Agent应在专注于其子任务的干净上下文窗口中运行,无需携带其他子任务积累的上下文。
隔离机制 为每个子任务选择合适的隔离机制:
  • 全上下文委托 — 将规划者的整个上下文共享给子Agent。适用于子Agent需要完整理解的复杂任务。子Agent拥有自己的工具和指令,但接收完整上下文用于决策。注意:这会部分抵消Context Isolation的目的。
  • 指令传递 — 通过函数调用创建指令;子Agent仅接收所需内容。适用于简单、定义明确的子任务。保持隔离但限制子Agent的灵活性。
  • 文件系统内存 — Agent读写持久化存储。适用于需要共享状态的复杂任务。文件系统作为协调机制,避免因传递共享状态导致上下文膨胀。会引入延迟和一致性挑战,但比消息传递扩展性更好。
根据任务复杂度、协调需求和可接受的延迟进行选择。默认使用指令传递,当需要共享状态时升级到文件系统内存。除非子任务确实需要,否则避免全上下文委托。

Consensus and Coordination

共识与协调

The Voting Problem Avoid simple majority voting — it treats hallucinations from weak models as equal to reasoning from strong models. Without intervention, multi-agent discussions devolve into consensus on false premises due to inherent bias toward agreement.
Weighted Voting Weight agent votes by confidence or expertise. Agents with higher confidence or domain expertise should carry more weight in final decisions.
Debate Protocols Structure agents to critique each other's outputs over multiple rounds. Adversarial critique often yields higher accuracy on complex reasoning than collaborative consensus. Guard against sycophantic convergence where agents agree to be agreeable rather than correct.
Trigger-Based Intervention Monitor multi-agent interactions for behavioral markers. Activate stall triggers when discussions make no progress. Detect sycophancy triggers when agents mimic each other's answers without unique reasoning.
投票问题 避免简单多数投票——它将弱模型的幻觉与强模型的推理等同看待。若无干预,Multi-Agent讨论会因内在的趋同偏见而达成基于错误前提的共识。
加权投票 根据置信度或专业知识为Agent投票加权。置信度更高或领域专业知识更丰富的Agent在最终决策中应拥有更大权重。
辩论协议 组织Agent在多轮讨论中互相评判对方的输出。对抗性评判通常比协作共识在复杂推理上产生更高的准确性。防范趋同附和的情况——Agent为了达成一致而同意,而非为了正确性。
基于触发的干预 监控Multi-Agent交互的行为标记。当讨论无进展时激活停滞触发器。当Agent在无独特推理的情况下模仿彼此的答案时,检测趋同附和触发器。

Framework Considerations

框架考量

Different frameworks implement these patterns with different philosophies. LangGraph uses graph-based state machines with explicit nodes and edges. AutoGen uses conversational/event-driven patterns with GroupChat. CrewAI uses role-based process flows with hierarchical crew structures.
不同框架以不同理念实现这些模式。LangGraph使用基于图的状态机,带有明确的节点和边。AutoGen使用对话/事件驱动模式,带有GroupChat。CrewAI使用基于角色的流程,带有分层团队结构。

Practical Guidance

实践指南

Failure Modes and Mitigations

故障模式与缓解措施

Failure: Supervisor Bottleneck The supervisor accumulates context from all workers, becoming susceptible to saturation and degradation.
Mitigate by constraining worker output schemas so workers return only distilled summaries. Use checkpointing to persist supervisor state without carrying full history in context.
Failure: Coordination Overhead Agent communication consumes tokens and introduces latency. Complex coordination can negate parallelization benefits.
Mitigate by minimizing communication through clear handoff protocols. Batch results where possible. Use asynchronous communication patterns. Measure whether multi-agent coordination actually saves time versus a single agent with a longer context.
Failure: Divergence Agents pursuing different goals without central coordination drift from intended objectives.
Mitigate by defining clear objective boundaries for each agent. Implement convergence checks that verify progress toward shared goals. Set time-to-live limits on agent execution to prevent unbounded exploration.
Failure: Error Propagation Errors in one agent's output propagate to downstream agents that consume that output, compounding into increasingly wrong results.
Mitigate by validating agent outputs before passing to consumers. Implement retry logic with circuit breakers. Use idempotent operations where possible. Consider adding a verification agent that cross-checks critical outputs before they enter the pipeline.
故障:Supervisor瓶颈 Supervisor积累所有工作Agent的上下文,容易出现饱和和性能下降。
通过约束工作Agent的输出模式,让工作Agent仅返回提炼后的摘要来缓解。使用检查点来持久化Supervisor状态,无需在上下文中携带完整历史。
故障:协调开销 Agent通信消耗Token并引入延迟。复杂协调可能抵消并行化的优势。
通过明确的交接协议减少通信来缓解。尽可能批量处理结果。使用异步通信模式。衡量Multi-Agent协调是否真的比具有更长上下文的单Agent节省时间。
故障:偏离目标 Agent在无中央协调的情况下追求不同目标,偏离预期目标。
通过为每个Agent定义明确的目标边界来缓解。实现收敛检查,验证向共享目标的进展情况。设置Agent执行的生存时间限制,防止无限探索。
故障:错误传播 一个Agent输出中的错误会传播到消费该输出的下游Agent,演变为越来越严重的错误。
通过在传递给消费者前验证Agent输出来缓解。实现带有断路器的重试逻辑。尽可能使用幂等操作。考虑添加一个验证Agent,在关键输出进入流水线前进行交叉检查。

Examples

示例

Example 1: Research Team Architecture
text
Supervisor
├── Researcher (web search, document retrieval)
├── Analyzer (data analysis, statistics)
├── Fact-checker (verification, validation)
└── Writer (report generation, formatting)
Example 2: Handoff Protocol
python
def handle_customer_request(request):
    if request.type == "billing":
        return transfer_to(billing_agent)
    elif request.type == "technical":
        return transfer_to(technical_agent)
    elif request.type == "sales":
        return transfer_to(sales_agent)
    else:
        return handle_general(request)
示例1:研究团队架构
text
Supervisor
├── Researcher(网页搜索、文档检索)
├── Analyzer(数据分析、统计)
├── Fact-checker(验证、确认)
└── Writer(报告生成、格式处理)
示例2:任务交接协议
python
def handle_customer_request(request):
    if request.type == "billing":
        return transfer_to(billing_agent)
    elif request.type == "technical":
        return transfer_to(technical_agent)
    elif request.type == "sales":
        return transfer_to(sales_agent)
    else:
        return handle_general(request)

Guidelines

指南

  1. Design for context isolation as the primary benefit of multi-agent systems
  2. Choose architecture pattern based on coordination needs, not organizational metaphor
  3. Implement explicit handoff protocols with state passing
  4. Use weighted voting or debate protocols for consensus
  5. Monitor for supervisor bottlenecks and implement checkpointing
  6. Validate outputs before passing between agents
  7. Set time-to-live limits to prevent infinite loops
  8. Test failure scenarios explicitly
  1. 以Context Isolation作为Multi-Agent系统的主要设计目标
  2. 根据协调需求而非组织隐喻选择架构模式
  3. 实现带有状态传递的明确任务交接协议
  4. 使用加权投票或辩论协议达成共识
  5. 监控Supervisor瓶颈并实现检查点机制
  6. 在Agent间传递输出前进行验证
  7. 设置生存时间限制以防止无限循环
  8. 明确测试故障场景

Gotchas

注意事项

  1. Supervisor bottleneck scaling — Supervisor context pressure grows non-linearly with worker count. At 5+ workers, the supervisor spends more tokens processing summaries than workers spend on actual tasks. Set a hard cap on workers per supervisor (3-5) and add a second supervisor tier rather than overloading one.
  2. Token cost underestimation — Multi-agent runs cost approximately 15x baseline. Teams consistently underbudget because they estimate per-agent costs without accounting for coordination overhead, retries, and consensus rounds. Budget for 15x and treat anything less as a bonus.
  3. Sycophantic consensus — Agents in debate patterns tend to converge on agreeable answers, not correct ones. LLMs have an inherent bias toward agreement. Counter this by assigning explicit adversarial roles and requiring agents to state disagreements before convergence is allowed.
  4. Agent sprawl — Adding more agents past 3-5 shows diminishing returns and increases coordination overhead. Each additional agent adds communication channels quadratically. Start with the minimum viable number of agents and add only when a clear context isolation benefit exists.
  5. Telephone game in message-passing — Information degrades through repeated summarization as it passes between agents. Each agent paraphrases and loses nuance. Use filesystem coordination instead of message-passing for state that multiple agents need to access faithfully.
  6. Error propagation cascades — One agent's hallucination becomes another agent's "fact." Downstream agents have no way to distinguish upstream hallucinations from genuine information. Add validation checkpoints between agents and never trust upstream output without verification.
  7. Over-decomposition — Splitting tasks too finely creates more coordination overhead than the task itself. A 10-step pipeline with 10 agents spends more tokens on handoffs than on actual work. Decompose only when subtasks genuinely benefit from separate contexts.
  8. Missing shared state — Agents operating without a shared filesystem or state store duplicate work, produce inconsistent outputs, and lose track of what has already been accomplished. Establish shared persistent storage before building multi-agent workflows.
  1. Supervisor瓶颈扩展 — Supervisor的上下文压力随工作Agent数量呈非线性增长。当工作Agent数量达到5个以上时,Supervisor处理摘要消耗的Token比工作Agent执行实际任务消耗的Token更多。为每个Supervisor设置工作Agent数量上限(3-5个),若需更多则添加第二层Supervisor,而非过度加载单个Supervisor。
  2. Token成本低估 — Multi-Agent运行的成本约为基准值的15倍。团队往往低估预算,因为他们仅估算单个Agent的成本,未考虑协调开销、重试和共识轮次。按15倍基准值预算,低于此值视为额外收益。
  3. 趋同附和共识 — 辩论模式中的Agent倾向于达成一致的答案,而非正确的答案。LLM天生具有趋同偏见。通过分配明确的对抗角色,要求Agent在达成共识前陈述不同意见来应对此问题。
  4. Agent泛滥 — Agent数量超过3-5个后,收益递减且协调开销增加。每个额外Agent会使通信通道数量呈二次方增长。从最小必要数量的Agent开始,仅当存在明确的Context Isolation收益时才添加Agent。
  5. 消息传递中的传话游戏 — 信息在Agent间传递时,经过多次总结会失真。每个Agent都会转述并丢失细节。对于多个Agent需要准确访问的状态,使用文件系统协调而非消息传递。
  6. 错误传播连锁反应 — 一个Agent的幻觉会成为另一个Agent的“事实”。下游Agent无法区分上游的幻觉与真实信息。在Agent间添加验证检查点,绝不未经验证就信任上游输出。
  7. 过度分解 — 将任务拆分过细会产生比任务本身更大的协调开销。包含10个Agent的10步流水线在任务交接上消耗的Token比实际工作更多。仅当子任务确实能从独立上下文中获益时才进行分解。
  8. 缺少共享状态 — 无共享文件系统或状态存储的Agent会重复工作,产生不一致的输出,且无法跟踪已完成的工作。在构建Multi-Agent工作流前,先建立共享持久化存储。

Integration

集成

This skill owns agent topology and coordination protocols. Adjacent skills own project shape, hosted runtime, and latent-state transfer:
  • project-development
    : project-level single-vs-multi choice before topology details.
  • hosted-agents
    : remote sandbox, session, warm-pool, and multiplayer infrastructure.
  • memory-systems
    : shared persistent state across agents.
  • tool-design
    : tool specialization and spawn/status tool contracts.
  • context-optimization
    : partitioning as one token-efficiency tactic.
  • latent-briefing
    : KV-cache trajectory handoff between orchestrator and worker when models align.
  • evaluation
    : measuring whether multiple agents improve outcomes after coordination cost.
本技能负责Agent拓扑结构和协调协议。相关技能负责项目形态、托管运行时和隐式状态传递:
  • project-development
    :在拓扑细节确定前,项目级的单Agent vs 多Agent选择。
  • hosted-agents
    :远程沙箱、会话、预热池和多Agent基础设施。
  • memory-systems
    :Agent间的共享持久化状态。
  • tool-design
    :工具专业化和生成/状态工具契约。
  • context-optimization
    :作为Token效率策略的上下文划分。
  • latent-briefing
    :当模型匹配时,编排器与工作Agent间的KV缓存轨迹交接。
  • evaluation
    :衡量扣除协调成本后,多Agent是否能改善结果。

References

参考资料

Internal reference:
  • Frameworks Reference - Read when: implementing a specific multi-agent pattern in LangGraph, AutoGen, or CrewAI and needing framework-specific code examples
Related skills in this collection:
  • context-fundamentals - Read when: needing to understand context window mechanics before designing agent partitioning
  • memory-systems - Read when: agents need to share state across context boundaries or persist information between runs
  • context-optimization - Read when: individual agent contexts are too large and need partitioning or compression strategies
External resources:

内部参考:
  • 框架参考 — 适用场景:在LangGraph、AutoGen或CrewAI中实现特定Multi-Agent模式,需要框架特定代码示例时阅读
本集合中的相关技能:
  • context-fundamentals — 适用场景:在设计Agent划分前,需要理解上下文窗口机制时阅读
  • memory-systems — 适用场景:Agent需要跨上下文边界共享状态或在运行间持久化信息时阅读
  • context-optimization — 适用场景:单个Agent上下文过大,需要划分或压缩策略时阅读
外部资源:
  • LangGraph文档 — 适用场景:使用明确状态机构建基于图的Multi-Agent工作流时阅读
  • AutoGen框架 — 适用场景:实现对话式GroupChat模式或事件驱动Agent协调时阅读
  • CrewAI文档 — 适用场景:设计基于角色的分层Agent流程时阅读
  • Multi-Agent协调研究 — 适用场景:需要Multi-Agent系统理论和评估的学术基础时阅读

Skill Metadata

技能元数据

Created: 2025-12-20 Last Updated: 2026-05-15 Author: Agent Skills for Context Engineering Contributors Version: 2.1.0
创建时间:2025-12-20 最后更新时间:2026-05-15 作者:Agent Skills for Context Engineering Contributors 版本:2.1.0