Skip to main content

Designing Multi-Agent Workflows

AutoGen provides powerful patterns for orchestrating multiple agents to solve complex tasks. Learn how to design effective multi-agent workflows using teams, handoffs, and custom orchestration.

Team Patterns

AutoGen offers several pre-built team patterns for common multi-agent scenarios.

RoundRobinGroupChat

Agents take turns in a fixed order - ideal for sequential processing:

SelectorGroupChat

Use an LLM to intelligently select the next speaker:

Swarm Pattern

Agents dynamically hand off to each other based on context:

Custom Selector Functions

Implement custom logic for speaker selection:

Code Execution Workflow

Combine AssistantAgent with CodeExecutorAgent:

Tool-Equipped Multi-Agent Teams

Agents in teams can have different tools:

State Management in Teams

Save and resume team state:

Nested Teams

Create hierarchical team structures:

Termination Strategies

Control when workflows complete:

Best Practices

Be careful with allow_repeated_speaker=True in SelectorGroupChat - it can lead to infinite loops if not combined with proper termination conditions.

Streaming and UI

Stream team execution for real-time feedback:

Advanced: Graph-Based Workflows

Define complex workflows as directed graphs: