# Chat Chain

> Decompose a long task into ordered phases — within each phase, two role-paired agents converse until the phase artifact is signed off, then hand it to the next phase.

- **Category**: Agentic AI
- **Subcategory**: Multi-Agent
- **Canonical URL**: https://designpattern.fyi/patterns/chat_chain/

---

## Description
**Intent**: Decompose a long, multi-disciplinary task into ordered phases; within each phase, run a paired-role chat between two agents until the phase artifact is signed off; pass the artifact to the next phase.
**Context**: Long tasks — build a small program, prepare a regulatory brief, produce a multi-section report — naturally break into ordered disciplines that have to happen in sequence. The whole task is too long for one agent's loop, and each discipline benefits from focused two-agent dialogue rather than a solo monologue.
**Solution**: Define an ordered chain of phases. Each phase has: (a) a defined input artifact, (b) two role-paired agents (e.g. designer + coder, coder + tester), (c) a phase-specific completion predicate, (d) a defined output artifact. Within a phase, the two agents converse multi-turn; the completion predicate ends the phase; the artifact moves to the next phase. The chain is macro-control; the chat is micro-control.



## Use Cases
- The work decomposes naturally into ordered phases, each with a paired role and a typed artifact.
- Phase-specific completion predicates can be expressed clearly enough to gate handoff.
- A single agent loop loses focus and broadcast multi-agent chat tangles context.






## Trade-offs


### Advantages

- Clear macro-progression with chat-level flexibility inside each phase.

- Keeps each phase's context tight — only the artifact crosses the phase boundary.

- Auditable artifact trail per phase.




### Considerations & Drawbacks

- Designing the chain (phases + completion predicates) is itself the hard architecture problem.

- Sequential by construction — parallelism inside a phase requires extra design work.

- Wrong phase decomposition forces agents into awkward role pairings that fight the structure.







---
**Reference**: [Original Source](https://www.agentpatternscatalog.org/patterns/chat-chain/)

