Group-Chat Manager
Place a dedicated manager between the participants of a multi-agent group chat that decides which participant speaks next on each turn.
Problem
If every agent decides for itself whether to speak, the result is either chatter (each agent emits a turn on every step) or paralysis (no agent picks itself and the conversation stalls). Wiring up per-pair hand-offs — agent A always passes to B, B to C — works for two or three agents but does not generalise as the cast grows, and gives no central place to decide when the conversation is finished. The team needs a single component that allocates turns, watches for termination, and leaves an audit trail.
Solution
Define a Manager that owns the shared conversation transcript and a `select_next(transcript, participants) -> participant` function. On each turn the manager appends the new message to the transcript, calls `select_next`, and invokes the chosen participant. Implementations vary in how `select_next` is computed (see Variants). The manager also enforces termination — a turn cap, a content predicate, or an explicit `STOP` signal from a participant.
When to use
- Three or more agents must share a single conversation context.
- Turn order, termination, and audit need to live in one component.
- Relevance-aware speaker selection is worth a per-turn model call.
Open the full interactive page →
Diagram, neighbourhood map, code examples, related patterns and full provenance.