Skip to main content

Orchestration

Coordinate how agents work together to handle user requests.

Overview

The orchestrator is the intelligence layer that manages agent interactions. It:
  • Interprets user intent
  • Selects the appropriate agent(s)
  • Coordinates multi-agent workflows
  • Resolves conflicts between outputs
  • Delivers unified responses

Orchestration Patterns

Choose a pattern based on your use case complexity.

Single Agent

One agent handles all requests. Best for focused, well-defined domains.

Supervisor

Central orchestrator coordinates multiple specialized agents. Best for complex, parallelizable tasks.

Adaptive Network

Agents dynamically hand off to each other. Best for sequential, multi-domain workflows.

Pattern Comparison

AspectSingle AgentSupervisorAdaptive Network
ComplexityLowMediumMedium-High
Agents1MultipleMultiple
CoordinationNoneCentralizedDecentralized
ExecutionSequentialParallelSequential
LatencyLowestMediumVariable
Best forSimple tasksComplex decompositionDynamic hand-offs

How Orchestration Works

Request Flow

┌──────────────────────────────────────────────────────────────┐
│                        User Request                          │
└──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────┐
│                     Intent Analysis                          │
│  • Parse user input                                          │
│  • Identify required capabilities                            │
│  • Determine complexity                                      │
└──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────┐
│                    Agent Selection                           │
│  • Match capabilities to agent descriptions                  │
│  • Consider agent availability and scope                     │
│  • Select single agent or multiple agents                    │
└──────────────────────────────────────────────────────────────┘

              ┌───────────────┼───────────────┐
              ▼               ▼               ▼
        ┌──────────┐   ┌──────────┐   ┌──────────┐
        │ Agent A  │   │ Agent B  │   │ Agent C  │
        └────┬─────┘   └────┬─────┘   └────┬─────┘
              │               │               │
              └───────────────┼───────────────┘

┌──────────────────────────────────────────────────────────────┐
│                   Response Aggregation                       │
│  • Collect agent outputs                                     │
│  • Resolve conflicts                                         │
│  • Synthesize unified response                               │
└──────────────────────────────────────────────────────────────┘


┌──────────────────────────────────────────────────────────────┐
│                      User Response                           │
└──────────────────────────────────────────────────────────────┘

Choosing the Right Pattern

Use Single Agent when:

  • Your app has one primary capability
  • Tasks don’t require coordination between specialists
  • You want minimal orchestration overhead
  • Response latency is critical
Example: A leave management bot where one agent handles all employee requests.

Use Supervisor when:

  • Tasks can be broken into independent subtasks
  • You need parallel execution for speed
  • Multiple specialists should contribute to responses
  • You want centralized control and conflict resolution
Example: A customer service app where billing, orders, and technical support agents work in parallel.

Use Adaptive Network when:

  • Tasks flow naturally between domains
  • You need dynamic routing based on context
  • Agents should autonomously decide when to hand off
  • Sequential expertise is required
Example: An employee onboarding app where HR, IT, and Finance agents hand off based on the current step.

Orchestrator Responsibilities

Task Decomposition

Breaking complex requests into manageable subtasks:
User: "I need to cancel my order and get a refund"

Decomposition:
├── Subtask 1: Look up order details (Order Agent)
├── Subtask 2: Process cancellation (Order Agent)
└── Subtask 3: Initiate refund (Billing Agent)

Agent Delegation

Routing tasks to appropriate specialists:
Request: "What's my order status and can I upgrade my shipping?"

Delegation:
├── Order Agent: Retrieve order status
└── Shipping Agent: Process shipping upgrade

Conflict Resolution

Handling inconsistencies between agent outputs:
Conflict:
├── Agent A: "Item is in stock"
└── Agent B: "Item ships in 2 weeks"

Resolution: Check inventory system → Provide accurate status

Context Management

Maintaining conversation state across agents:
Turn 1: User provides order number
Turn 2: Agent A uses order number
Turn 3: Agent B receives context, doesn't ask again

Configuration

Basic Configuration

orchestration:
  pattern: supervisor  # single_agent, supervisor, adaptive_network

  # Model for orchestration decisions
  model: gpt-4o

  # How agent selection works
  selection:
    strategy: description_match
    fallback_agent: default_support

Advanced Options

orchestration:
  # Maximum agents per request
  max_concurrent_agents: 3

  # Timeout for agent responses
  agent_timeout_ms: 30000

  # Conflict resolution strategy
  conflict_resolution: prefer_primary

  # Enable conversation summarization
  context_summarization: true