Pattern Overview
Multi-agent architectures distribute work among specialized agents, each with focused capabilities. Choose your pattern based on:- Orchestrator: When you need central control and dynamic task routing
- Swarm: For autonomous agent collaboration with handoffs
- Graph: When workflows have clear dependencies and parallel steps
- Workflow: For sequential, multi-stage processing pipelines
Orchestrator Pattern (Agent as Tools)
The orchestrator pattern uses a manager agent that delegates tasks to specialized worker agents. The orchestrator decides which specialist to call based on the user’s request.Architecture
Implementation Example
Fromcourse/aws_strands/06_multi_agent_pattern/06_1_agent_as_tools/main.py:
Real-World Example: Content Team Agent
Fromadvance_ai_agents/content_team_agent/main.py:
The orchestrator pattern works best when:
- You have distinct task categories (research, analysis, writing)
- Tasks don’t depend on sequential execution
- You need dynamic routing based on user intent
Swarm Pattern
Swarm agents autonomously decide which agent should handle the next step through dynamic handoffs. Unlike orchestrators, there’s no central controller.Architecture
Implementation Example
Fromcourse/aws_strands/06_multi_agent_pattern/06_2_swarm_agent/main.py:
Key Configuration Parameters
| Parameter | Purpose | Example Value |
|---|---|---|
max_handoffs | Limit total agent transitions | 20 |
max_iterations | Maximum execution cycles | 20 |
execution_timeout | Overall timeout (seconds) | 900.0 |
node_timeout | Per-agent timeout (seconds) | 300.0 |
repetitive_handoff_detection_window | Sliding window for loop detection | 8 |
repetitive_handoff_min_unique_agents | Min unique agents in window | 3 |
Graph Pattern
Graph-based workflows define explicit dependencies between agents, enabling parallel execution where possible.Architecture
Implementation Example
Fromcourse/aws_strands/06_multi_agent_pattern/06_3_graph_agent/main.py:
Parallel Execution
In the graph above,analyst and fact_checker run in parallel after researcher completes, since they don’t depend on each other.
Workflow Pattern (Sequential Pipeline)
Workflows execute agents in a fixed sequence, with each agent’s output feeding into the next. Perfect for multi-stage processing pipelines.Architecture
Implementation Example
Fromadvance_ai_agents/deep_researcher_agent/agents.py:
Usage
Pattern Comparison
| Pattern | Control Flow | Best For | Complexity |
|---|---|---|---|
| Orchestrator | Central routing | Dynamic task delegation, mixed queries | Low |
| Swarm | Autonomous handoffs | Collaborative problem-solving, emergent solutions | High |
| Graph | Dependency-based | Parallel execution, clear dependencies | Medium |
| Workflow | Sequential pipeline | Multi-stage processing, data transformation | Low |
Best Practices
1. Choose the Right Pattern
2. Set Appropriate Limits
3. Use Structured Outputs
4. Clear Agent Responsibilities
Real-World Examples
Finance Research Agent
Location:advance_ai_agents/agentfield_finance_research_agent/src/reasoners.py
5-agent investment committee:
- Manager (orchestrator)
- Analyst (bull case)
- Contrarian (bear case)
- Editor (synthesis)
- Skills layer (data gathering)
Content SEO Workflow
Location:advance_ai_agents/content_team_agent/main.py
Sequential pipeline:
- Search insights agent (SERP research)
- SERP analysis agent (keyword extraction)
- Content strategist (recommendations)
- SEO editor (content optimization)
AI Consultant
Location:memory_agents/ai_consultant_agent/workflow.py
Research + reasoning workflow:
- Tavily search (case studies)
- LLM analysis (recommendations)
- Structured output (consulting report)
Next Steps
Human-in-the-Loop Patterns
Add human oversight and approval to multi-agent workflows
Memory Systems
Give agents persistent memory across conversations
Best Practices
Production-ready patterns and error handling
API Keys
Configure credentials for multi-agent systems