A collaboration pattern lets specialized agents work as peers on one goal. They share work, challenge one another’s conclusions, refine the result, and collectively judge whether it is complete. Unlike an assembly line, work can move back and forth; unlike hub-and-spoke orchestration, no single agent must make every decision. section 9.4 section 1.6
Figure 4.1 The three well-established patterns for building multi-agent systems: agent flow (assembly line), orchestrator (hub-and-spoke), and collaboration (peer-to-peer).
Compare the peer-to-peer shape with sequential agent flow and central orchestration. section 4.1
A practical collaboration loop has four parts:
- Assign complementary roles. A researcher gathers findings, a critic checks gaps or unsupported claims, and a synthesizer combines validated findings. section 9.4
- Keep a shared, inspectable state containing the goal and each agent’s contribution. Contributions can record content, critique, suggestions, confidence, and whether the agent thinks the goal is met. section 9.4
- Rotate turns so each agent can use earlier work. A lightweight turn manager chooses whose turn comes next; the agents determine what to contribute. section 9.4
- Stop when the state indicates consensus or a maximum number of rounds is reached. A round limit bounds a conversation that might otherwise keep repeating itself. section 9.4 section 1.4.3
Reviewing a research answer
To assess the risks and benefits of AI-generated code in production, let a researcher collect information, a critic identify weak or unsupported points, and a synthesizer assemble the reviewed answer. Print each contribution and whether consensus was reached; then compare the result with a single-agent research loop on the same question. section 9.4 section 9.5
Choose collaboration when different perspectives and adversarial review justify extra work. Peer discussion can improve complex answers, but repeated messages increase latency and cost. For a well-defined sequence, use agent flow; when one agent should coordinate workers, use orchestration. Prefer the least costly pattern that meets the goal. section 1.4.3 section 1.6
