Why Multi-Agent Systems Are Different
A single LLM call is a function. A multi-agent system is a distributed system - with all the failure modes that implies.
The shift from "I have an AI prototype" to "I have an AI system in production" requires the same discipline as any distributed system: explicit contracts between components, observable failure modes, and graceful degradation.
Agent Orchestration Patterns
Sequential pipeline: Each agent's output is the next agent's input. Simple, debuggable, but slow.
Planner → Researcher → Writer → Reviewer → Publisher
Parallel fan-out: Multiple agents work on independent subtasks simultaneously, results merged by an orchestrator.
Orchestrator → [Agent A, Agent B, Agent C] → Aggregator
Hierarchical: A supervisor agent delegates to specialist agents and synthesises results. Most powerful, hardest to debug.
The right pattern depends on your latency budget and the degree of interdependence between subtasks.
The Failure Modes Nobody Talks About
- Prompt injection via tool output - an agent that reads external content can be manipulated by that content to change its behaviour
- Context window exhaustion - long-running agents accumulate context until they hit the model's limit and start hallucinating or truncating
- Cascading hallucination - one agent's confident wrong answer becomes the next agent's ground truth
- Non-deterministic loops - agents that can call each other can create cycles that are hard to detect and expensive to run
Observability Is Not Optional
Every agent call should emit:
{
"trace_id": "abc123",
"agent": "researcher",
"model": "claude-3-5-sonnet",
"input_tokens": 1240,
"output_tokens": 380,
"latency_ms": 2100,
"tool_calls": ["web_search", "read_file"],
"success": true
}
Without this, debugging a multi-agent failure is archaeology.
Production Checklist
- Every agent has a defined input/output contract
- Maximum iteration limits on all loops
- Human-in-the-loop checkpoints for irreversible actions
- Token budget alerts before context exhaustion
- Structured logging on every agent invocation
- Fallback behaviour when an agent fails or times out