Overview
Single agents are limited by context window, specialization depth, and parallelism. Multi-agent systems overcome these limits by routing subtasks to specialized agents. But multi-agent systems introduce new failure modes: lost context, conflicting decisions, infinite loops, and cascading failures.
This skill provides the architecture and coordination patterns to build multi-agent systems that are reliable, observable, and maintainable.
When to Use
- The task requires more context than a single agent can handle
- Different subtasks require different specializations (research, coding, review, security)
- Subtasks can be parallelized for speed
- The workflow is long-running and requires checkpointing
- Different tasks require different levels of human oversight
Process
Step 1: Design the Agent Network
- Define agent responsibilities: Each agent should have a single, well-defined job. Name them by role:
researcher, coder, reviewer, security-auditor, tester.
- Define communication topology: Who can talk to whom?
- Pipeline: Agent A → Agent B → Agent C (sequential)
- Supervisor: Orchestrator dispatches to specialists (hub-and-spoke)
- Peer: Agents collaborate as equals (mesh)
- Define data contracts: What does each agent receive? What does it output? Use structured formats (JSON schemas) for inter-agent communication.
- Define the orchestration logic: Who decides which agent acts next?
Verify: You can draw the agent network on a whiteboard with clear roles and data flow.
Step 2: Implement Context Management
- Each agent should receive only the context it needs — not the full conversation history.
- Use a shared state store (database, key-value store) for information that multiple agents need.
- Pass summaries, not full transcripts, when context must traverse agent boundaries.
- Include a task ID in every message for tracing.
Verify: No agent receives more context than it requires for its specific task.
Step 3: Design for Failure
- Every agent call can fail — plan for it:
- Timeout with a defined maximum duration
- Retry with exponential backoff (max 3 retries)
- Fallback behavior when retries are exhausted
- Prevent infinite loops: Track call depth. If depth > N (e.g., 10), surface to human review.
- Checkpointing: For long workflows, save state after each major step so the workflow can be resumed after failure.
- Dead letter queue: Failed tasks that exhaust retries go to a queue for human inspection.
Verify: Failure scenarios are defined for every agent-to-agent call.
Step 4: Human-in-the-Loop Checkpoints
- Define which decisions require human approval:
- Irreversible actions (data deletion, financial transactions, external communications)
- High-uncertainty states (agents disagree, confidence below threshold)
- Sensitive operations (PII access, privileged system access)
- Design the human review interface: What information does the reviewer need? What actions can they take?
Verify: At least one human-in-the-loop checkpoint exists for high-risk operations.
Step 5: Observability
- Log every agent invocation: inputs, outputs, duration, token usage, errors.
- Implement distributed tracing across the agent network (trace ID propagated through all calls).
- Dashboard: agent activity, success/failure rates, latency, token consumption.
- Alerts: agent down, retry rate spike, context overflow, unexpected output patterns.
Verify: You can trace any specific task's full execution path across all agents from logs alone.
Common Rationalizations (and Rebuttals)
| Excuse |
Rebuttal |
| "One agent is simpler" |
Until it hits context limits, fails silently, or produces wrong results. Multi-agent is the right tool for complex tasks. |
| "We'll add observability later" |
Multi-agent systems without observability are black boxes. Debug them in production — I dare you. |
| "Agents are smart, they'll figure it out" |
Agents are tools. They need clear roles, contracts, and failure boundaries. |
| "The happy path works fine" |
Multi-agent systems fail in complex ways. Design for failure from day one. |
Red Flags
- Agents pass full conversation history to other agents (context bloat)
- No timeout defined for any agent call
- Agents can call each other recursively without depth limits
- No human approval required for irreversible actions
- No distributed tracing across agent boundaries
- Agents making conflicting state changes with no conflict resolution
Verification
References
Source: DevelopersGlobal/ai-agent-skills — distributed by TomeVault.
1---2name: multi-agent-orchestration3description: Designs and coordinates multi-agent pipelines where specialized agents collaborate to complete complex tasks. Includes communication protocols, failure handling, and state management. Use when this capability is needed.4---56## Overview78Single agents are limited by context window, specialization depth, and parallelism. Multi-agent systems overcome these limits by routing subtasks to specialized agents. But multi-agent systems introduce new failure modes: lost context, conflicting decisions, infinite loops, and cascading failures.910This skill provides the architecture and coordination patterns to build multi-agent systems that are reliable, observable, and maintainable.1112## When to Use1314- The task requires more context than a single agent can handle15- Different subtasks require different specializations (research, coding, review, security)16- Subtasks can be parallelized for speed17- The workflow is long-running and requires checkpointing18- Different tasks require different levels of human oversight1920## Process2122### Step 1: Design the Agent Network23241. **Define agent responsibilities**: Each agent should have a single, well-defined job. Name them by role: `researcher`, `coder`, `reviewer`, `security-auditor`, `tester`.252. **Define communication topology**: Who can talk to whom?26 - **Pipeline**: Agent A → Agent B → Agent C (sequential)27 - **Supervisor**: Orchestrator dispatches to specialists (hub-and-spoke)28 - **Peer**: Agents collaborate as equals (mesh)293. **Define data contracts**: What does each agent receive? What does it output? Use structured formats (JSON schemas) for inter-agent communication.304. **Define the orchestration logic**: Who decides which agent acts next?3132**Verify:** You can draw the agent network on a whiteboard with clear roles and data flow.3334### Step 2: Implement Context Management35365. Each agent should receive **only the context it needs** — not the full conversation history.376. Use a shared state store (database, key-value store) for information that multiple agents need.387. Pass **summaries**, not full transcripts, when context must traverse agent boundaries.398. Include a **task ID** in every message for tracing.4041**Verify:** No agent receives more context than it requires for its specific task.4243### Step 3: Design for Failure44459. **Every agent call can fail** — plan for it:46 - Timeout with a defined maximum duration47 - Retry with exponential backoff (max 3 retries)48 - Fallback behavior when retries are exhausted4910. **Prevent infinite loops**: Track call depth. If depth > N (e.g., 10), surface to human review.5011. **Checkpointing**: For long workflows, save state after each major step so the workflow can be resumed after failure.5112. **Dead letter queue**: Failed tasks that exhaust retries go to a queue for human inspection.5253**Verify:** Failure scenarios are defined for every agent-to-agent call.5455### Step 4: Human-in-the-Loop Checkpoints565713. Define which decisions require human approval:58 - Irreversible actions (data deletion, financial transactions, external communications)59 - High-uncertainty states (agents disagree, confidence below threshold)60 - Sensitive operations (PII access, privileged system access)6114. Design the human review interface: What information does the reviewer need? What actions can they take?6263**Verify:** At least one human-in-the-loop checkpoint exists for high-risk operations.6465### Step 5: Observability666715. Log every agent invocation: inputs, outputs, duration, token usage, errors.6816. Implement distributed tracing across the agent network (trace ID propagated through all calls).6917. Dashboard: agent activity, success/failure rates, latency, token consumption.7018. Alerts: agent down, retry rate spike, context overflow, unexpected output patterns.7172**Verify:** You can trace any specific task's full execution path across all agents from logs alone.7374## Common Rationalizations (and Rebuttals)7576| Excuse | Rebuttal |77|--------|----------|78| "One agent is simpler" | Until it hits context limits, fails silently, or produces wrong results. Multi-agent is the right tool for complex tasks. |79| "We'll add observability later" | Multi-agent systems without observability are black boxes. Debug them in production — I dare you. |80| "Agents are smart, they'll figure it out" | Agents are tools. They need clear roles, contracts, and failure boundaries. |81| "The happy path works fine" | Multi-agent systems fail in complex ways. Design for failure from day one. |8283## Red Flags8485- Agents pass full conversation history to other agents (context bloat)86- No timeout defined for any agent call87- Agents can call each other recursively without depth limits88- No human approval required for irreversible actions89- No distributed tracing across agent boundaries90- Agents making conflicting state changes with no conflict resolution9192## Verification9394- [ ] Agent network designed with clear roles and data contracts95- [ ] Context is minimized at each agent boundary96- [ ] Failure handling (timeout, retry, fallback) for every agent call97- [ ] Infinite loop prevention via call depth limits98- [ ] Human-in-the-loop checkpoints for high-risk operations99- [ ] Distributed tracing implemented across agents100- [ ] End-to-end test of failure scenarios101102## References103104- [task-decomposition skill](../task-decomposition/SKILL.md)105- [observability skill](../observability/SKILL.md)106- [prompt-injection-defense skill](../prompt-injection-defense/SKILL.md)107- [hallucination-prevention skill](../hallucination-prevention/SKILL.md)108109---110> Source: [DevelopersGlobal/ai-agent-skills](https://github.com/DevelopersGlobal/ai-agent-skills) — distributed by [TomeVault](https://tomevault.io).111<!-- tomevault:4.0:skill_md:2026-06-24 -->