Coordinate multiple specialized agents using the supervisor architecture
The supervisor pattern enables you to build multi-agent systems where a central supervisor agent coordinates and delegates tasks to specialized worker agents. This is ideal for complex workflows requiring task decomposition and intelligent routing.
A supervisor agent acts as an intelligent orchestrator that:
Routes user requests to the most appropriate specialist agent
Manages handoffs between multiple agents
Evaluates worker outputs and decides next steps
Coordinates multi-step workflows across different domains
Use architecture: "supervisor" to enable supervisor-based multi-agent coordination. The supervisor dynamically routes tasks without requiring explicit edges.
Here’s a research team supervisor coordinating three specialized agents:
Copy
name: "Research Team Supervisor"description: "Supervisor coordinates research, analysis, and synthesis specialists"architecture: "supervisor"save_messages: truepersistent_state: trueagents: # Supervisor Agent - name: "research_supervisor" agent_type: "supervisor" description: "Intelligent supervisor coordinating research team specialists" supervised_agents: ["research_agent", "analysis_agent", "synthesis_agent"] return_to_supervisor: false max_handoffs: 15 streaming_config: enable_streaming: true show_output_to_user: true supervisor_prompt: | You are a research team supervisor coordinating specialized agents. Your team consists of: - research_agent: Expert at web search and information gathering - analysis_agent: Specialist in data analysis and pattern recognition - synthesis_agent: Expert at summarizing findings For ANY user request, immediately delegate to the appropriate agent. Always provide clear reasoning when transferring. # Research Agent - name: "research_agent" agent_type: "react_agent" description: "Specialized in research and information gathering" tools: - "tavily_search" - "tavily_extract" tool_calling: enabled: true max_iterations: 5 streaming_config: show_output_to_user: true show_reasoning: true system_prompt: | You are a Research Specialist in a multi-agent team. Your expertise includes: - Web search and information gathering - Fact-checking and source verification - Identifying reliable sources Always provide detailed, well-sourced research results. # Analysis Agent - name: "analysis_agent" agent_type: "react_agent" description: "Specialized in data analysis and pattern recognition" tools: - "calculator" tool_calling: enabled: true max_iterations: 3 streaming_config: show_output_to_user: true system_prompt: | You are an Analysis Specialist in a multi-agent team. Your expertise includes: - Data analysis and statistical processing - Pattern recognition and trend identification - Insight generation from complex information Focus on extracting meaningful insights. # Synthesis Agent - name: "synthesis_agent" agent_type: "llm_agent" description: "Specialized in synthesizing information" streaming_config: show_output_to_user: true system_prompt: | You are a Synthesis Specialist in a multi-agent team. Your expertise includes: - Combining research and analysis into coherent narratives - Creating well-structured, comprehensive reports - Ensuring completeness and coherence Create comprehensive, well-organized final responses.entry_point: "research_supervisor"
Clear role definitions: In the supervisor_prompt, clearly describe each worker agent’s expertise and when to use them
Mix agent types: Combine ReAct agents (for tool use) with LLM agents (for synthesis) under a supervisor for powerful multi-domain systems
Immediate delegation: Instruct the supervisor to delegate immediately without attempting to answer directly
Set appropriate max_handoffs limits to prevent infinite coordination loops
Use return_to_supervisor: true when the supervisor needs to evaluate intermediate results and orchestrate multi-step workflows. Set to false for simpler one-way delegation.
Setup: Supervisor + multiple domain-specific ReAct agentsEach agent is an expert in a specific domain (legal, medical, technical). Supervisor routes based on domain.