liveBook · Manning

Collaboration pattern

As explained in AI Agents in Action, Second Edition

A reusable design in which multiple peer agents share state, contribute to a task, critique or refine one another's work, and collectively determine completion.

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

How AI Agents in Action, Second Edition covers it

How deep it goes
Develops a typed, turn-based shared-state loop with consensus and round limits; treats agent-selected routing as an advanced extension.
Examples
Uses researcher, critic, and synthesizer agents, plus an exercise reviewing risks and benefits of AI-generated code.
What it assumes
Introduces agent roles plainly, while the loop implementation builds on earlier agentic-loop concepts and Python-style typed models.
What you can do after
Build it from scratch as a bounded collaboration loop with typed peer contributions and consensus tracking.
How it connects
Contrasts agent flow and agent orchestration with shared state, agentic loops, and evaluation and feedback.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of AI Agents in Action, Second Edition. The section links point to the parts of the book it draws on.