Group Chat
Also known as: multi-agent conversation, selector team, round-robin team, roundtable, managed conversation, GroupChat / GroupChatManager (AutoGen, AG2), group chat orchestration (Semantic Kernel, Microsoft Agent Framework)
Intent
Put a few specialised agents in one shared, append-only message thread that every one of them reads. After each message, a selector that sits outside the agents picks exactly one of them to speak next. The loop runs until a stop condition fires: a keyword, a message cap, a budget, or an outside stop.
Problem
You are building an assistant that answers sports-statistics questions. A user asks for the percentage change in total rebounds, across two seasons, of the Miami Heat player who scored the most points in 2006–07. A question of this kind is the running example of AutoGen's SelectorGroupChat tutorial (paraphrased here), and it needs three kinds of work: planning, web search (several times), and a calculation.
You split the work into a planner, a web-search agent and a data analyst, and wire them as a fixed chain: plan, search, compute, answer. It breaks as soon as the task needs back-and-forth:
- The chain cannot loop back. The first search finds the top scorer but not his rebounds. The analyst has nothing to compute, and there is no edge that sends the work back to search.
- The number of turns is unknown in advance. The search agent may need two or three turns in a row. A fixed sequence has to guess, and it guesses wrong on some questions.
- Everyone needs what the others found. The analyst must use the exact figures the searcher posted. If you wire each pair of agents directly instead, the links grow quickly: the AutoGen FSM GroupChat blog notes that the possible transitions grow roughly as N choose 2.
Putting all three roles into one agent with every tool is the other naive option. Its prompt has to hold every role, and nothing tells it when one kind of work is finished.
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 participant. A selector reads the thread and the participants' short descriptions and returns one name. That agent reads the whole thread, replies, and its reply is broadcast. Code checks the stop conditions after every reply.
- Seed. The user's question becomes the first message of the thread, and every agent receives it.
- Select. The selector sees the roles and the history. A rule says the PlanningAgent speaks first, so it is picked.
- Speak and broadcast. The planner writes two lines: "WebSearchAgent : find the Heat's top scorer in 2006–07 and his rebounds in both seasons" and "DataAnalystAgent : compute the percentage change". Everyone sees them.
- Select again. The selector picks WebSearchAgent, which runs its own short tool loop (a ReAct loop inside its turn) and posts the figures. If one is missing, the selector can pick it again or return to the planner.
- Hand back to the planner. After a specialist reports, the selector returns to the planner, which assigns the next open task. The analyst reads the two rebound totals straight from the thread and posts the percentage.
- Stop. The planner writes a short summary that ends with
TERMINATE. A termination condition sees the keyword and ends the run, returning the transcript and the stop reason. A message cap and a token budget stop it anyway if the keyword never comes.
Who decides the flow: each agent decides only what it says. The selector decides who speaks next, on every turn. Agents can influence that choice, for example by naming the next agent in their text, but they cannot make it. Code decides when to stop. The developer decides how much freedom the selector has: a fixed rotation, a rule, an allowed-transition graph, or an LLM choosing freely.
The closest neighbour is the Supervisor. A group chat whose selector always returns to the planner looks like a supervisor, but a supervisor's workers do not share one thread: each gets an instruction and reports back to the hub alone. In a group chat every message reaches every participant. In Swarm / Handoffs there is no outside selector at all: the active agent hands control to a peer itself.
Real-world analogy
A small working meeting with a chair. Everyone in the room hears everything that is said, but only one person speaks at a time, and the chair decides who gets the floor next. The chair does not do the work; they look at the agenda and at what was just said and point at the person who should answer. The meeting ends when the item is closed, or when the clock runs out.
The analogy stops at the chair's judgement. A human chair notices when the meeting is going in circles. An LLM selector only sees the transcript and the descriptions you wrote, and it will happily keep calling on people unless you give it rules and a hard stop.
Structure
- Participants. Each agent has a unique name, a short description that the selector reads, a system prompt with its role and output format, and possibly a few tools. It replies only when selected, and may run its own tool loop inside that turn.
- Shared thread. One ordered list of messages (source, content, type) that is the single source of truth. Physically, frameworks differ: AutoGen Core broadcasts on a shared topic and each agent keeps its own copy; Microsoft Agent Framework syncs each agent's session before its turn. Logically, everyone sees the same history.
- Selector (manager). Picks exactly one next speaker from the candidates. It can be a fixed rotation, a function, an allowed-transition graph, an LLM, or a person. Some managers also decide when to ask a human and how to filter the final result.
- Termination conditions. Code that inspects each new reply: a keyword such as
TERMINATEorAPPROVE, a message cap, a token or time budget, or an external stop button. Conditions combine with AND and OR. - Human participant (optional). A person who approves or redirects as a regular member, a gate the manager consults, or the selector itself in manual mode.
- Result. The transcript plus the stop reason, or a filtered answer: the last message, a designated agent's final message, or a summary pass.
Prompt generator
Describe the team's job and each participant: its name, the description the selector will read, its tools, and who may speak after it. The generator writes a shared prefix, one system prompt per participant, the speaker-selection spec (an LLM selector prompt, a rule, or a rotation) and a runtime checklist for the loop. The prompts work with any group-chat runtime (AutoGen or AG2 group chats, Semantic Kernel, Microsoft Agent Framework) or your own loop; the checklist is for your code.
Generated prompt
Highlighted text comes from the form. [Bracketed] text is still to fill in.
An LLM selector chooses from the names and descriptions you give it, so vague or overlapping descriptions produce wrong picks. Write each description as what the agent does and what it never does, and keep the selector prompt short. The AutoGen docs give the same advice, and add that with reasoning models both selector and agent prompts should stay short and direct.
Applicability
Use it when
- The work needs back-and-forth between a few roles. Writer and reviewer, or coder, executor and critic, where you cannot know in advance how many rounds it will take.
- The order of contributions is unknown, but the roles are known and few. The selector handles the order; you only define the roster.
- Every participant benefits from seeing all prior work. The analyst needs the searcher's exact figures, and the critic needs the coder's exact code.
- The run must be easy to audit. One transcript shows the whole collaboration, and a human can follow it or join in.
- You want a quick prototype of a multi-agent idea. The AutoGen paper reports the OptiGuide workflow code shrinking from over 430 lines to 100 with AutoGen's multi-agent conversation style (a Commander, Writer and Safeguard setup that is closer to an orchestrated chat than a free group chat).
Avoid it when
- A fixed sequence or a one-time dispatch is enough. Use Prompt Chaining or Routing, or a Supervisor for simple delegation.
- Latency matters. Turns run one at a time, and an LLM selector adds a model call to each one.
- Subtasks are independent. Run them at the same time with Parallelization; a group chat has one speaker per turn.
- There is no objective way to tell the work is done. The Azure Architecture Center lists this as a reason to avoid the pattern: the chat will end on a cap, not on success.
- You need more than a handful of agents. Azure recommends three or fewer; control gets harder with each agent added.
- The task is open-ended and long. Use an Orchestrator–Workers design with planning and progress tracking (see the Magentic-One ablation under Pros and cons).
- Agents read untrusted content such as web pages or emails, unless you filter it, because whatever one agent reads, every agent reads.
How to implement
- Start with one agent. Move to a team only when one agent with tools proves inadequate. AutoGen's teams tutorial and the Azure Architecture Center both say this.
- Define two to four roles that do not overlap. Give each a unique name (no spaces is safest), a crisp description for the selector, and a fixed output format in its system prompt, for example "assign tasks as
<agent> : <task>". - Pick the weakest selection policy that works. Roughly in this order: round-robin, then a rule or allowed-transition graph, then an LLM selector with a candidate filter, then a free LLM selector. Rules are free and testable; an LLM costs a call per turn and can pick wrongly.
- Validate the selector's answer. AutoGen's behaviour is worth copying: count whole-word mentions of each candidate name; if there are none or several, retry with a correction (three attempts by default in AgentChat), then fall back to a fixed choice and log a warning. Skip the call when only one candidate is left.
- Define termination in layers. A semantic stop (keyword or approval) that only one designated agent may emit, a hard message cap, and a token or time budget. Add an external stop for UIs. Treat any stop other than the semantic one as a failed run.
- Decide what is shared. Should tool calls and raw results go into the thread, or only the speaker's text? Should old turns be summarised? Should the selector see only the last few messages? Microsoft Agent Framework (Python) strips tool content before broadcast by default.
- Decide the output and log every selection. Return the last message, a designated agent's final message, or a summary pass. Log candidates, the chosen speaker, the reason, the retries, tokens per message and the stop reason for each run.
| Framework | How this pattern appears |
|---|---|
| AutoGen AgentChat (0.4+) | RoundRobinGroupChat, SelectorGroupChat (with selector_prompt, selector_func, candidate_func, allow_repeated_speaker=False by default) and MagenticOneGroupChat. Termination classes such as TextMentionTermination and MaxMessageTermination combine with | and &. |
| AutoGen 0.2 / AG2 | GroupChat plus GroupChatManager, with speaker_selection_method set to auto (default), round_robin, random, manual or a function, and allowed_or_disallowed_speaker_transitions for a graph. max_round defaults to 10. AG2 adds AutoPattern, RoundRobinPattern and handoff-based patterns. |
| Semantic Kernel | GroupChatOrchestration with a RoundRobinGroupChatManager or a custom GroupChatManager that overrides speaker selection, termination, human-input and result-filter hooks. Marked experimental. |
| Microsoft Agent Framework | GroupChatBuilder (Python) with a selection function or an orchestrator agent and a termination condition; .NET and Go builders exist. Described as a star topology with per-agent sessions synced before each turn. |
| LangGraph | No dedicated class. The "multi-agent collaboration" example has agents share one message list in graph state, with a rule-based router reading the last output. |
| CAMEL | RolePlaying: an AI user and an AI assistant in strict alternation, with a message cap, an end token and role-flip detection. |
Caveat. According to its GitHub README, the AutoGen repository is archived and in maintenance mode, with Microsoft Agent Framework named as its successor; a Microsoft blog dates Agent Framework 1.0 to April 3, 2026. The October 2025 date for AutoGen's move to maintenance mode comes only from secondary sources and is unverified. AG2 is the community fork that keeps the 0.2-style GroupChat API. Defaults such as max_round=10 or three selector attempts were read at research time and may change, and the Semantic Kernel and Agent Framework API details were not re-checked.
Variants
Round-robin team
A fixed rotation with no selector call. The minimal case is a writer and a reviewer taking turns; Semantic Kernel's sample runs them for five rounds and its docs suggest an odd number so the writer has the last word. Cheap and predictable, but every agent speaks even when it has nothing to add.
Selector group chat
An LLM reads the roles and history and names the next speaker, optionally helped by a function that forces some choices (for example "after any specialist, return to the planner") or narrows the candidates. This is the running example on this page.
Graph-constrained group chat
An allowed-transition graph lists who may follow whom, and the LLM picks only among legal next speakers. The AutoGen FSM GroupChat blog stresses that the graph and the agents' descriptions together form the state machine: the descriptions say when each edge should be taken. StateFlow generalises this into state-driven workflows; its gains over ReAct are single-workflow results, not group-chat benchmarks.
Maker-checker loop
A maker proposes and a checker approves or sends feedback, until approval or an iteration cap. The Azure Architecture Center treats it as a turn-based special case of group chat. As a two-role loop it is the same idea as Evaluator–Optimizer.
Two-agent role-playing (CAMEL)
An "AI user" gives instructions and an "AI assistant" solves them, in strict alternation, after a task-specifier prompt and two role prompts set things up. CAMEL used five stop rules, including an end-of-task token, role-flip detection and a 40-message cap set to control cost.
Chat chain (ChatDev)
A sequence of two-agent chats grouped into phases such as design, coding and testing. Only the solutions from earlier phases carry forward, not the full transcripts, so it sits between group chat and Prompt Chaining.
Orchestrated group chat (Magentic-One)
A manager that plans, keeps task and progress ledgers, detects stalls, picks the next agent and also writes it an instruction. AutoGen exposes it as MagenticOneGroupChat, a drop-in replacement for a selector group chat. Its internals are covered on the Orchestrator–Workers page.
Human in the group
A person takes part as a regular member, as a gate the manager consults before a turn, or as the selector itself. A common form routes to the human right after the planner speaks and returns to the planner unless the reply is "APPROVE". See Human-in-the-Loop.
Publish-subscribe message pool (MetaGPT)
Agents publish structured documents to a shared pool and subscribe by role, so each reads only what concerns it. MetaGPT argues that sharing everything overloads agents. This is the bridge to the Blackboard pattern.
Nested group chats
A whole team acts as one participant in a larger chat. See Hierarchical teams.
Pros and cons
Pros
- Little orchestration code: you define roles, a selection policy and stop conditions, and the loop does the rest.
- One readable transcript shows the whole collaboration, which helps debugging and audits.
- Every agent works from the same facts, so the analyst uses the searcher's exact figures.
- The number of rounds adapts to the task: a missing figure leads to another search turn instead of a wrong answer.
- A human can join as a participant, a gate or the selector without changing the structure.
- The selection policy can move from free to controlled (LLM, graph, rule, rotation) without rewriting the agents.
Cons
- Context grows every turn and each speaker re-reads the whole thread, so input tokens grow faster than the number of turns. (The research notes estimate roughly quadratic growth; this is their own reasoning, not a measurement.)
- Turns are serial, and an LLM selector adds a model call per turn, plus retries.
- Free selection is weak on open-ended tasks. In the Magentic-One paper, replacing its planning orchestrator with plain group-chat speaker selection cut performance on the GAIA validation set by about 31% (relative). That baseline was AutoGen 0.2-style selection; a well-constrained selector may close part of the gap, which is unverified.
- Conversations loop, drift, or end too early without caps and a designated finisher.
- Peer critique can hurt weaker models: in AgentVerse, GPT-3.5 groups did worse than solo agents on two tasks, while GPT-4 groups did slightly better.
- Everything one agent sees, every agent sees, including secrets, tool output and injected instructions from web pages.
Failure modes
- Loops and chatter
-
Agents trade courtesies ("thank you", "you're welcome") or repeat the same exchange. CAMEL observed message loops with no progress, and in the MAST study of failed multi-agent traces, step repetition was the most frequent failure mode (15.7%). You notice it as runs that end on the message cap.
Mitigation: hard caps plus a token budget, a rule that returns to the planner after every specialist, stall detection with re-planning, and an explicit "no small talk" line in every prompt.
- Speaker-selection errors
-
The selector names no agent, two agents, an agent that does not exist, or the wrong expert, or one agent ends up dominating the chat.
Mitigation: validate and retry with feedback, then fall back. Narrow the candidates with a function or a transition graph, disallow immediate repeats, and use distinctive names and descriptions. Letting the planner name the next agent and routing on that with a rule removes most LLM picks.
- Premature or missed termination
-
The stop keyword is never written, is written too early, or appears inside quoted text. MAST reports agents unaware of termination conditions in 12.4% of failures and premature termination in 6.2%.
Mitigation: give exactly one agent the power to stop and match on both source and text. Use a distinctive token, always add caps, and add a final verification turn before the stop.
- Weak or no verification
-
The final answer is never checked. In the AutoGen tutorial's own
candidate_funcsample run, the planner's summary reported a different percentage from the one the analyst had computed (a tutorial with mock tools, so an illustration, not a measured rate).Mitigation: a checker with concrete criteria, grounded tools such as code execution or tests, and a final step that cross-checks figures against the thread.
- Role drift and flake replies
-
An assistant starts giving instructions, agents do each other's jobs, or an agent says "I will search..." and stops without acting. CAMEL documented both role flipping and these "flake replies".
Mitigation: strict system prompts ("never flip roles"), fixed output prefixes, narrow tool sets per agent, a rule that the action happens in the same message as the announcement, and a terminator on role violation.
- Echoing and conformity
-
Agents agree with or paraphrase the previous message, or drop a correct answer after a wrong critique. In AgentVerse, about 10% of GPT-3.5's MGSM errors came from exactly that.
Mitigation: give critics explicit acceptance criteria, ask for evidence rather than opinions, use stronger models for critics, and add a non-LLM verifier. In the AutoGen chess example, removing the board agent that validated moves led to illegal moves.
- Context explosion
-
Long threads, tool dumps and screenshots exceed the window or push the task out of focus.
Mitigation: strip tool payloads from the broadcast, summarise or compact between turns, give the selector only the last few messages, or carry forward only solutions as ChatDev does. AgentPrune reports cutting tokens by 28.1–72.8% by pruning redundant messages.
- Prompt injection spreading through the thread
-
A web-reading agent pastes hostile instructions, and every other agent then reads them. The Magentic-One guide warns about prompt injection from web content.
Mitigation: quote or sanitise external content, broadcast summaries instead of raw outputs from risky agents, require human approval before code runs, and sandbox execution.
Relations with other patterns
- Supervisor: often confused with group chat. A selector that always returns to the planner looks like a supervisor, but supervisor workers do not share one thread: each gets an instruction and reports back alone.
- Swarm / Handoffs: the active agent decides to hand off itself, with no outside selector. AutoGen's
Swarmreuses the group-chat machinery with handoff-based selection. - Orchestrator–Workers: Magentic-One is the orchestrated form of group chat, adding planning, progress tracking and per-agent instructions; the 31% ablation shows what removing them costs.
- Council / Debate: structured rounds where several agents answer the same question, then critique or vote. Group chat is open-ended turn-taking on a task. Azure uses "debate" and "council" as synonyms for group chat; this site keeps them apart.
- Blackboard: a shared workspace organised by content instead of a time-ordered chat log. MetaGPT's subscribed message pool sits between the two.
- Evaluator–Optimizer: the two-role maker-checker loop. A round-robin writer and reviewer chat is one way to build it.
- ReAct (tool-use loop): what happens inside each speaker's turn when it uses tools.
- Hierarchical teams: a whole group chat can be one participant, or one team, inside a larger structure.
- Prompt Chaining: a fixed order with no shared conversation. ChatDev's chat chain is a pipeline whose steps are small chats.
- Human-in-the-Loop: a human as participant, approval gate or manual selector.
Further reading
- Selector Group Chat (AutoGen docs): the Planner, WebSearch and DataAnalyst example used on this page, with
selector_func,candidate_funcand a human-approval flow. - FSM GroupChat (AutoGen blog, 2024): constraining speaker selection with an allowed-transition graph, and why descriptions act as transition conditions.
- AI agent orchestration patterns (Azure Architecture Center): when to use and avoid group chat, the maker-checker variant and the advice to keep groups small.
- AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation (Wu et al., arXiv): the original group-chat manager loop, the role-play selector prompt and a small pilot comparing selector designs.
- Magentic-One (Fourney et al., arXiv): an orchestrated team and the ablation against plain group-chat speaker selection.
- Why Do Multi-Agent LLM Systems Fail? (Cemri et al., arXiv): the MAST taxonomy of 14 failure modes, useful for tagging failed transcripts.