Guide to Agent Orchestration: Linear and Adaptive Orchestrators

In a multi-agent system, orchestration strategies define how agents work together to tackle complex tasks. Dynamiq offers two primary orchestration patterns — Linear and Adaptive. Each approach is tailored to specific workflows and complexity levels, enabling users to leverage the strengths of each pattern based on the nature of the task.

Understanding Orchestration in Multi-Agent Systems

Orchestration determines the flow, coordination, and interaction between agents, especially in cases where a single agent might not be enough to handle a task’s complexity. Both orchestration types require an Agent Manager and at least one agent to execute the tasks.


1. Linear Orchestrator

Overview

The Linear Orchestrator follows a predefined, step-by-step sequence, ensuring that agents process tasks in a strict order. This type of orchestration is ideal for workflows where each step depends on the output of the previous step.

How It Works

The Linear Orchestrator starts by receiving input and then:

  • Breaks down the task into sequential sub-tasks.

  • Assigns each sub-task to the appropriate agent based on the predefined order.

  • Loops through agents in sequence until each task is processed, ultimately producing a final output.

Key Components

ComponentDescription

Linear Agent Manager

Manages the orderly execution of agents in a strict sequence, coordinating the handoff of data from one agent to the next.

Agents

A set of agents configured to perform specific roles within the sequence. Each agent should have a descriptive name reflecting its function in the workflow.

Name

The orchestrator’s identifier (e.g., "linear-orchestrator").

Configuration Options

FieldDescription

Name

Name the orchestrator to distinguish it from other orchestration setups.

Agents

Configure the participating agents. Choose agents based on roles that align with the sequential workflow.

Agent Manager

Use the Linear Agent Manager to enforce the step-by-step order of operations.

Streaming

Streaming mode is enabled to provide flexible data handling options. Users can specify a custom event name, with data set as the default. There is a choice to stream either all intermediate steps or only the final outcome, depending on the level of detail required. Additionally, users can control the granularity of the streamed data by choosing to stream it in smaller, token-based segments or as complete responses.

Best Use Cases

The Linear Orchestrator is best suited for tasks that:

  • Require a strict order of operations: Tasks where one step must follow another, such as a data processing pipeline.

  • Have predictable workflows: Scenarios where the workflow is unlikely to change dynamically based on context.

Example Workflow

Imagine a task that involves analyzing customer feedback data, categorizing it, and generating a summary:

  1. The Linear Orchestrator receives the feedback data.

  2. Agent 1 categorizes the feedback.

  3. Agent 1 analyzes categorized data for patterns.

  4. Agent 2 generates a summary based on the analysis.

  5. The orchestrator returns the consolidated result.


2. Adaptive Orchestrator

Overview

The Adaptive Orchestrator is designed for dynamic, context-aware workflows. Unlike the linear approach, it adapts its sequence based on task requirements, routing tasks to agents according to real-time conditions and decision points.

How It Works

The Adaptive Orchestrator’s process is more flexible:

  • Receives input and assesses the task requirements.

  • Based on context, it decides the next agent to activate, dynamically routing tasks.

  • Repeats this process until it gathers sufficient information to generate a final output.

Key Components

ComponentDescription

Adaptive Agent Manager

Manages agents by routing tasks dynamically, allowing real-time decision-making based on task progress and context.

Agents

Supports a mix of agents (e.g., ReAct for complex tasks, Simple for straightforward tasks) to ensure adaptive capabilities.

Name

The orchestrator’s identifier (e.g., "adaptive-orchestrator").

Configuration Options

FieldDescription

Name

Assign a name to identify the orchestrator configuration.

Agents

Configure a diverse set of agents to handle different aspects of the task. Include both ReAct and Simple agents for flexibility.

Agent Manager

Use the Adaptive Agent Manager to enable dynamic task routing and flexible decision-making.

Best Use Cases

The Adaptive Orchestrator is ideal for:

  • Complex tasks with decision points: Workflows that require on-the-fly adjustments and dynamic sequencing.

  • Situations with unpredictable task flow: When the workflow changes based on intermediate results, allowing agents to respond accordingly.

Example Workflow

Consider a complex customer support scenario where the agent may need to perform multiple actions depending on the query:

  1. The Adaptive Orchestrator receives a customer query.

  2. Based on the query type, it might:

    • Route it to a Simple Agent for direct response.

    • Use a ReAct Agent for more complex queries that require searching for information.

  3. If additional processing is needed, it continues routing until sufficient information is gathered.

  4. The orchestrator then compiles the responses into a final output.


Comparing Linear and Adaptive Orchestrators

FeatureLinear OrchestratorAdaptive Orchestrator

Agent Manager

Linear Agent Manager

Adaptive Agent Manager

Task Execution

Sequential, predetermined steps

Dynamic routing based on context and task progress

Agent Types

Typically homogenous agents focused on specific roles

Can include both Simple and ReAct agents for adaptability

Best Use Cases

Structured tasks with clear, predictable steps

Flexible workflows that may change based on intermediate results

Input Handling

Receives input, splits tasks sequentially

Evaluates context at each step, deciding the next best action


Choosing the Right Orchestration Pattern

Selecting between Linear and Adaptive Orchestration depends on the task requirements and complexity:

  • Use Linear Orchestration if:

    • The task has a clear sequence that needs to be followed.

    • Predictability and order are essential, such as in data processing tasks.

  • Use Adaptive Orchestration if:

    • The task involves complex queries or requires dynamic adjustments.

    • Flexibility is a priority, and the agent’s response needs to adapt based on intermediate data or user input.


Orchestrator Best Practices

  1. Manager Configuration Each orchestrator type has a dedicated Agent Manager that coordinates the agent tasks. Managers should be configured with an LLM, as it is mandatory for both Linear and Adaptive orchestrators.

  2. Assigning Agents

    • Linear Orchestrator: Configure agents with clearly defined roles, using a sequence that aligns with task requirements.

    • Adaptive Orchestrator: Include a mix of agent types to ensure the orchestrator can dynamically assign tasks based on context.

  3. Error Handling

    • Both orchestrators should have robust error handling to address potential issues, especially in complex workflows with multiple agents.


Conclusion

In multi-agent systems, the choice between Linear and Adaptive orchestration patterns is crucial for efficiency and task completion. Linear Orchestration suits predictable, sequential tasks, while Adaptive Orchestration offers flexibility for complex, evolving workflows. By understanding these orchestrators' configuration options, key components, and best use cases, you can build powerful workflows tailored to your task requirements.

These orchestration patterns expand the capabilities of AI-driven systems, empowering agents to handle multi-step, multi-query tasks with precision and adaptability.

Last updated