Communication patterns
How agents hand off work: structured messages over free chat, the shared-state alternative, and the failure modes unique to multi-agent systems.
When agents work together, how they exchange information determines whether the system is reliable or a game of telephone. The instinct — 'let them chat in natural language' — is the wrong default, for the same reason you schema'd tool outputs instead of parsing prose.
Structured handoffs, not free chat
- Agents communicate through structured messages — typed task specs going down, structured results coming back — not open-ended conversation. The orchestrator hands the read-worker
{ticket_id, question}and gets back{decision, amount, evidence, confidence}. Free-form agent chat compounds ambiguity at every hop and is nearly impossible to debug. - The task spec is a contract. Delegation is a tool call whose input schema you designed; the specialist's return is a schema too. Everything you learned about tool contracts governs agent-to-agent handoffs — because a sub-agent is a tool.
- Handoffs are context boundaries. The worker doesn't inherit the orchestrator's whole window; it gets a scoped brief. This is a feature — focused context — but it means the orchestrator must include what the worker needs. Under-briefing is the #1 multi-agent bug: the specialist fails because it was never told the thing it needed.
The shared-state alternative
Instead of (or alongside) message-passing, agents can coordinate through shared state — a common scratchpad, task board, or database they all read and write. The orchestrator posts subtasks; workers claim them, post results; the orchestrator reads and synthesizes. This decouples agents (they don't call each other directly), makes the whole system's state inspectable in one place (huge for debugging), and is how many production 'agent swarms' actually work under the marketing. The cost is coordination discipline — who owns what, how conflicts resolve — the same concurrency problems databases have solved for decades.
Multi-agent failure modes (new bugs you're buying)
- Under-briefing: the specialist lacked context to succeed — fix the delegation contract, not the specialist.
- Lost-in-handoff: a result was produced but the orchestrator dropped or misread it — structured returns and shared state both fight this.
- Cascading error: stage one's subtle mistake becomes stage three's confident disaster — because each stage trusted its input. Validate at boundaries, not just at the ends.
- Coordination deadlock / loops: agents waiting on each other, or an orchestrator re-delegating a failing task forever. Turn and cost budgets apply to the system, not just each agent.
In a single agent you read one trajectory. In a multi-agent system you need to trace a task across agents — which specialist did what, what was handed off, where it broke. Tag every message and action with a shared task id and the agent that produced it, so you can reconstruct the whole distributed trajectory. Without this, multi-agent debugging is guesswork — and it's why many teams retreat to a single well-instrumented agent.