What is Group Chat?
Group Chat enables multiple agents to participate in a coordinated conversation. An orchestrator manages the conversation flow, deciding which agent speaks next based on:- Predefined workflows
- LLM-based role selection
- Round-robin scheduling
- Custom orchestration logic
Basic Group Chat
Create a simple group chat with multiple agents:Orchestration Strategies
AutoGen provides multiple orchestrators to control conversation flow:RolePlayOrchestrator
Uses an admin agent and optional workflow to select speakers:- Analyzes conversation history
- Decides which agent should speak next
- Considers the workflow if provided
WorkflowOrchestrator
Follows a predefined workflow without an admin:RoundRobinOrchestrator
Agents speak in sequential order:Custom Orchestrator
ImplementIOrchestrator for custom logic:
Workflow-Based Conversations
Define explicit conversation flows using graphs:Dynamic Group Chat Example
Complete example with Semantic Kernel integration:Initialize Messages
Provide context that persists across conversations:Managing Conversation Flow
Termination
End conversations gracefully:Max Rounds
Limit conversation length:Manual Control
Step through conversation manually:Advanced Patterns
Nested Group Chats
Create hierarchical agent structures:Conditional Workflows
Branching logic based on message content:Priority-Based Selection
Best Practices
Agent Roles
Agent Roles
- Give each agent a clear, specific role
- Avoid overlapping responsibilities
- Use descriptive names (e.g., “coder”, “reviewer”, “tester”)
- Document roles in system messages
Workflow Design
Workflow Design
- Keep workflows simple and linear when possible
- Use admin-based orchestration for complex logic
- Provide clear workflow instructions in initial messages
- Test workflows with different scenarios
Performance
Performance
- Set reasonable
maxRoundlimits - Use
DefaultReplyAgentfor simple responses - Cache responses when appropriate
- Monitor token usage across all agents
Error Handling
Error Handling
Next Steps
Function Calling
Add tools to group chat agents
Code Execution
Execute code in group conversations
Agents
Learn more about agent types
Examples
See complete group chat examples