Skip to main content
Swarm Type: GroupChat

Overview

The GroupChat swarm type facilitates collaborative discussion between multiple specialist agents. Unlike workflows where agents operate independently, GroupChat enables agents to engage in a shared conversation where each participant can build on, challenge, and refine ideas from others. This architecture is ideal for brainstorming, cross-functional planning, and problems that benefit from interactive dialogue. Key features:
  • Collaborative Discussion: Agents engage in shared conversation rather than working in isolation
  • Cross-Functional Input: Combine perspectives from different domains in a single discussion
  • Idea Building: Each agent can react to and build on contributions from other participants
  • Convergent Outcomes: Discussion naturally converges toward actionable conclusions

Architecture

Unlike the workflow types, agents talk to each other. Every contribution lands in one shared transcript that the others can build on or push back against.

Use Cases

  • Product strategy brainstorming sessions
  • Cross-functional planning and alignment
  • Architectural design discussions
  • Risk assessment with multiple stakeholders
  • Creative ideation requiring diverse perspectives

API Usage

Basic GroupChat Example

Example Response:

Output Shape

Every swarm run is executed through a SwarmRouter with output_type forced to "dict" server-side (see api/swarm_completions.py), so output is a list of {"role": ..., "content": ...} conversation turns rather than a single string. GroupChat specifically produces a multi-turn transcript: each agent speaks in turn, sees the accumulated conversation so far (including what previous agents said), and its content in output is its contribution to that shared discussion — so, unlike ConcurrentWorkflow, later agents’ turns are expected to reference or build on earlier ones rather than being independent.
  • Design agents with complementary but distinct expertise to maximize discussion breadth
  • Use descriptive system prompts that instruct agents to build on and react to other participants’ input
  • GroupChat works best with 3-6 agents — too few limits perspective diversity, too many dilutes focus
  • Ideal for brainstorming and planning tasks where interactive dialogue adds more value than independent analysis