Chat Chain
also known as Phased Multi-Agent Pipeline, Sequential Role-Pair Chats, Communicative Phase Chain
Decompose a long, multi-disciplinary task into ordered phases; within each phase, run a paired-role chat between two agents until the phase artefact is signed off; pass the artefact to the next phase.
Context
A team is using agents to carry out a long task — build a small program, prepare a regulatory brief, produce a multi-section report — that naturally breaks into several disciplines that have to happen in order: requirements, design, implementation, testing, documentation. The whole task is too long to fit in one agent's loop, and each discipline benefits from focused two-agent dialogue rather than a solo monologue.
Problem
A single agent loop loses focus halfway through, forgetting the early requirements by the time it is writing tests. A broadcast multi-agent chat where every agent sees every message tangles design discussion with code review and blows up context windows. Flat prompt-chaining — one prompt feeds the next — cannot host the multi-turn back-and-forth a discipline like design review needs. The team needs structure across the disciplines but flexibility inside each one.
Forces
- Each discipline benefits from focused two-agent dialogue.
- Context windows blow up if every agent sees every chat.
- Phase-to-phase hand-off needs a clean artefact contract.
- Termination of a phase has to be explicit, not vibes-based.
Example
A team is using an agent system to ship a small internal tool. A single agent loop forgets the requirements by the time it's writing tests, and a free-for-all multi-agent chat tangles design discussions with code review. They structure the work as a Chat-Chain: phase 1 is two agents pairing on requirements until a spec is signed off, phase 2 is two agents pairing on design against that spec, phase 3 is implementation, and so on. Each phase's signed-off artefact becomes the only context that crosses into the next.
Diagram
Solution
Therefore:
Define an ordered chain of phases. Each phase has (a) a defined input artefact, (b) two role-paired agents (e.g. designer + coder, coder + tester), (c) a phase-specific completion predicate, (d) a defined output artefact. Within a phase, the two agents converse multi-turn; the completion predicate ends the phase; the artefact moves to the next phase. The chain is the macro-control; the chat is the micro-control.
What this pattern forbids. Agents may not skip phases or address agents outside the current phase; phase output must satisfy the completion predicate before transition.
The smaller patterns that complete this one —
- generalisesPrompt Chaining★★— Decompose a task into a fixed sequence of LLM calls where each step's output becomes the next step's input.
- usesPipes and Filters★★— Compose stream-shaped processing as a chain of small filters connected by pipes.
- usesStop Hook★★— Define an explicit programmatic predicate that decides when the agent's loop should terminate.
And the patterns that stand alongside it, or against it —
- complementsSOP-Encoded Multi-Agent Workflow★— Encode a human Standard Operating Procedure (roles, ordered phases, standardised hand-off artefacts) into a multi-agent pipeline so that agents communicate through structured documents rather than free-form chat.
- alternative-toSupervisor★★— Place a coordinating agent above a set of specialised agents and route work to them.
Neighbourhood
Click any neighbour to follow the language. Scroll to zoom, drag to pan.