Contents

Group Chat

Also known as: multi-agent conversation, selector team, round-robin team

Who decides
A manager agent
Shape
Shared space

Intent

Put a few specialised agents in one message thread that every one of them reads, and let a selector outside the agents pick exactly one of them to speak after each message. The order of turns comes out of the conversation, and code stops the run when a stop condition fires.

Problem

You are building an assistant that answers sports-statistics questions. A user asks: “What was the percentage change in total rebounds, between 2007–08 and 2008–09, for the Miami Heat player who scored the most points in 2006–07?”

The answer needs planning, web searches and a calculation, so you write three agents: a planner, a searcher and an analyst. Then you wire them as a fixed chain: plan, search, compute, answer. It breaks as soon as the task needs back-and-forth:

A fixed chain runs Task, Planner, Searcher, Analyst, Answer in order. The analyst finds a figure missing but has no way to send work back to the searcher, so the answer is incomplete.rebounds missing: no way back to searchTaskPlannerplans onceSearcherone queryAnalystnothing to computeAnswerincomplete
Scroll to see all of it.
The order of steps is fixed in code, so when a figure is missing the chain has no way to send the work back to search.

Solution

Keep the three agents, but replace the fixed wiring with one shared thread and one decision per turn: who speaks next. Every message is appended to the thread and delivered to every agent. A selector reads the thread and the agents’ short descriptions and returns one name. That agent reads the whole thread, replies, and its reply is broadcast in turn. Code checks the stop conditions after every reply.

On the rebounds question, a run looks like this:

  1. Seed. The user’s question becomes the first message of the thread, and every agent receives it.
  2. Select. A rule says the planner speaks first, so the selector picks it without a model call.
  3. Plan in the open. The planner posts two tasks: the searcher finds the stats, the analyst computes the percentage. Everyone sees them.
  4. Search, as often as needed. The selector picks the searcher, which runs its own ReAct loop inside its turn. It finds the top scorer but not his rebounds, so the selector picks it again. Its second message posts 214 and 398.
  5. Compute from the thread. The selector returns to the planner, which hands the next task to the analyst. The analyst reads 214 and 398 straight from the thread and posts +86.0%.
  6. Stop. The planner writes a short summary that ends with TERMINATE. A termination check sees the keyword and ends the run, returning the transcript and the stop reason. A message cap would have stopped it anyway if the keyword never came.

Each agent decides only what it says, the selector decides who speaks, and code decides when to stop. The nearest pattern, Supervisor, also picks a worker on every turn, but each worker gets its own instruction and reports back to the hub alone; in a group chat every message reaches every agent.

Structure

Three agents and an optional human all read and append to one shared thread. A selector reads the thread and asks one agent to speak. After each reply, termination conditions either stop the run and return the result, or send control back to the selector.the selected agent is asked to speaknot donestopPlanningAgentassigns, endsWebSearchAgentsearch_webDataAnalystAgentpercentage_changeHumanoptionalShared threadappend-only, broadcast to allSelectorreads roles + historyreturns one nameLLM | rule | graphTerminationkeyword, message cap,token or time budgetUser taskResultanswer + stop reasonuser: % change in rebounds?Planner: WebSearch: find statsWebSearch: 214 and 398Planner: DataAnalyst: compute %DataAnalyst: +86.0%Planner: summary... TERMINATE123456
Scroll to see all of it.

Hover over a number, or tap it, to read what it is.

Double-headed lines show each participant reading the whole thread and appending to it when selected. The accent line is the selector’s one decision per turn, and the dashed line is the selector reading the thread.
  1. Participants. Agents, each with a unique name, a short description the selector reads, a role prompt and possibly a few tools. Each replies only when selected.
  2. Shared thread. One ordered, append-only list of messages that every participant receives. It is the single record of the work.
  3. Selector. Picks exactly one next speaker after each message. It can be a fixed rotation, a rule, a graph of allowed transitions, a model reading roles and history, or a person.
  4. Termination. Code that checks each new reply and ends the run on a keyword, a message cap or a budget. If nothing fires, control goes back to the selector.
  5. Human (optional). A person who takes part as a regular member, approves before the run goes on, or acts as the selector.
  6. Result. The transcript plus the stop reason, or a shorter answer taken from it, such as the last message or a summary.

Use it when / Avoid it when

Use it when

Avoid it when

How it fails

Loops and chatter

Agents thank each other or repeat one exchange until the cap ends the run; Cemri et al. found step repetition to be the most frequent failure in their study of failed multi-agent traces, at 15.7%.

Mitigation: return to the planner after every specialist, and cap messages and tokens.

Wrong speaker

The selector names no agent, one that does not exist or the wrong expert, or one agent does all the talking.

Mitigation: narrow the candidates in code, for example with a graph of allowed transitions, and validate the name before the turn runs.

Early or missing stop

The stop keyword is never written, is written before the work is done, or appears inside quoted text.

Mitigation: let exactly one agent stop the run, match on who wrote the keyword as well as the text, and keep a message cap.

Injection spreading through the thread

A web-reading agent pastes a page that contains instructions, and every other agent then reads them as part of the conversation.

Mitigation: post a summary of untrusted content instead of the raw text, and require approval before any agent runs code.

Related patterns

Try it

Describe the team: the task, each agent’s role and description, how the next speaker is chosen and what ends the run. The generator writes the prompts for a group chat with a selector.

Further reading