Back to series
· 14 min read

Agent Collaboration Patterns and Orchestration Strategies


I. What Is Agent Collaboration and Orchestration

In a single-Agent system, an agent usually completes a task independently, including understanding requirements, planning steps, calling tools, and generating results.

However, for complex tasks, a single Agent often faces the following limitations:

  • Clear capability boundaries: It is difficult for one Agent to be proficient in code development, data analysis, legal review, and business decision-making at the same time.
  • Excessive context burden: The more complex the task, the more information must be processed, making it easy to exceed the context window or reduce reasoning quality.
  • Execution is hard to parallelize: If multiple independent subtasks are executed sequentially by one Agent, computing resources and time are wasted.
  • No independent verification mechanism: The same Agent is responsible for both generating results and judging whether they are correct, which can easily lead to self-verification bias.
  • Task state is difficult to manage: Long-running tasks require continuous tracking of progress, dependencies, and execution results.

Multi-Agent collaboration completes tasks through multiple Agents with different responsibilities and capabilities working together.

Two core concepts need to be distinguished:

Concept Core Responsibility Focus
Agent collaboration mode Defines how Agents cooperate Roles, communication, division of labor, information sharing
Agent orchestration strategy Determines how tasks are organized and executed Scheduling, dependencies, concurrency, control flow, exception handling

They can be understood as follows:

  • The collaboration mode addresses who cooperates with whom and how they cooperate.
  • The orchestration strategy addresses who executes a task, when it is executed, and how the steps connect.

II. Basic Architecture of Agent Collaboration

A typical multi-Agent collaboration system usually includes a task entry point, an orchestrator, multiple specialized Agents, shared context, and a result aggregation module.

1. Core Components

Component Main Responsibility
User Interface Receives user requests and displays results
Orchestrator Responsible for task decomposition, scheduling, and process control
Planner Agent Analyzes goals and formulates execution plans
Worker Agent Executes specific tasks
Specialist Agent Provides domain-specific capabilities
Reviewer Agent Checks result quality and correctness
Shared Context Stores shared task information and intermediate results
State Manager Manages task status, execution status, and recovery information
Result Aggregator Aggregates execution results from multiple Agents

2. Basic Architecture Diagram

flowchart TD
    A["User Request"] --> B["Orchestrator"]
    B --> C["Planner Agent Task Planning"]

    C --> D["Task Decomposition and Dependency Analysis"]
    D --> E["Agent Scheduler"]

    E --> F["Research Agent"]
    E --> G["Analysis Agent"]
    E --> H["Execution Agent"]

    F --> I["Shared Context"]
    G --> I
    H --> I

    I --> J["Reviewer Agent"]
    J --> K{"Does the result pass?"}

    K -->|"No"| E
    K -->|"Yes"| L["Result Aggregator"]
    L --> M["Return Final Result"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style D fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#EAF3EC,stroke:#83A995,color:#315D49
    style H fill:#EAF3EC,stroke:#83A995,color:#315D49
    style I fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style J fill:#EAF3EC,stroke:#83A995,color:#315D49
    style K fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style L fill:#EAF3EC,stroke:#83A995,color:#315D49
    style M fill:#DCEFE5,stroke:#4F8B70,color:#24563F

In real systems, the Orchestrator does not have to be a standalone LLM Agent; it can also be a workflow engine implemented by an ordinary program. Handing deterministic control logic to a program usually makes it easier to achieve reliable task scheduling.

III. Common Agent Collaboration Patterns

Different collaboration patterns correspond to different task structures. Choosing the right pattern is more important than simply increasing the number of Agents.

1. Sequential Collaboration Pattern (Sequential)

Sequential collaboration is the simplest multi-Agent pattern.

Multiple Agents execute one after another in a predefined order, with each Agent using the previous Agent's output as its input.

For example, to produce a technical proposal:

  • Research Agent: collects technical materials.
  • Analysis Agent: analyzes the technology selection.
  • Writer Agent: writes the technical proposal.
  • Reviewer Agent: checks the content and technical accuracy.
flowchart TD
    A["Task Start"] --> B["Research Agent"]
    B --> C["Analysis Agent"]
    C --> D["Writer Agent"]
    D --> E["Reviewer Agent"]
    E --> F["Output Final Result"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#EAF3EC,stroke:#83A995,color:#315D49
    style C fill:#EAF3EC,stroke:#83A995,color:#315D49
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style F fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Advantages:

  • Simple flow, easy to implement.
  • Clear responsibilities for each Agent.
  • Intermediate results are easy to trace.
  • Suited to tasks with clear sequential dependencies.

Disadvantages:

  • Overall execution time is the cumulative time of all steps.
  • An error in an earlier Agent can affect all subsequent steps.
  • Not suitable for large numbers of mutually independent tasks.

Applicable scenarios: content production, code review pipelines, document processing, data processing workflows.

2. Parallel Collaboration Pattern (Parallel)

Parallel collaboration is suited to scenarios where multiple tasks have no strong dependencies between them.

The Orchestrator splits a complex task into multiple independent subtasks and distributes them concurrently to different Agents.

For example, when researching a technical topic, you can arrange the following at the same time:

  • Research Agent: searches technical materials.
  • Architecture Agent: analyzes the system architecture.
  • Security Agent: assesses security risks.
  • Performance Agent: analyzes performance issues.

After all Agents finish, a summarization Agent merges the results.

flowchart TD
    A["Receive Task"] --> B["Orchestrator"]
    B --> C["Task Decomposition"]

    C --> D["Research Agent"]
    C --> E["Architecture Agent"]
    C --> F["Security Agent"]
    C --> G["Performance Agent"]

    D --> H["Result Aggregation"]
    E --> H
    F --> H
    G --> H

    H --> I["Generate Comprehensive Report"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#EAF3EC,stroke:#83A995,color:#315D49
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#EAF3EC,stroke:#83A995,color:#315D49
    style H fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style I fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Advantages:

  • Can shorten overall execution time.
  • Can leverage the specialized capabilities of multiple Agents.
  • Subtasks are well isolated from one another.

Disadvantages:

  • Requires handling concurrent scheduling and resource contention.
  • Multiple Agents may produce duplicated or contradictory results.
  • The aggregation stage must resolve conflicts between results.
  • Too much parallelism increases model invocation costs.

In the parallel pattern, the key concern is whether the tasks are truly independent. If multiple Agents modify the same shared data at the same time, write conflicts can occur.

Applicable scenarios: multi-perspective research, parallel data analysis, multi-module code review, solution evaluation.

3. Hierarchical Collaboration Pattern (Hierarchical)

Hierarchical collaboration adopts a structure of managers and executors.

Upper-layer Agents are responsible for planning and assigning tasks, while lower-layer Agents are responsible for carrying out specific work. Complex tasks can also be further decomposed downward to form a multi-level structure.

For example:

  • Manager Agent: responsible for the entire project.
  • Backend Agent: responsible for backend development.
  • Frontend Agent: responsible for frontend development.
  • Test Agent: responsible for testing.
  • Security Agent: responsible for security checks.
flowchart TD
    A["Manager Agent"] --> B["Backend Agent"]
    A --> C["Frontend Agent"]
    A --> D["Test Agent"]

    B --> E["API Development"]
    B --> F["Database Development"]

    C --> G["Page Development"]
    C --> H["Interaction Development"]

    D --> I["Unit Testing"]
    D --> J["Integration Testing"]

    E --> K["Execution Results"]
    F --> K
    G --> K
    H --> K
    I --> K
    J --> K

    K --> L["Manager Summary"]

    style A fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style B fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style C fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style D fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style E fill:#EAF3EC,stroke:#83A995,color:#315D49
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#EAF3EC,stroke:#83A995,color:#315D49
    style H fill:#EAF3EC,stroke:#83A995,color:#315D49
    style I fill:#EAF3EC,stroke:#83A995,color:#315D49
    style J fill:#EAF3EC,stroke:#83A995,color:#315D49
    style K fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style L fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Advantages:

  • Suitable for decomposing complex tasks.
  • Clear boundaries of responsibility.
  • Supports multi-level task management.
  • Facilitates unified control of execution progress.

Disadvantages:

  • Upper-layer Agents may become performance bottlenecks.
  • Excessive hierarchy depth increases communication and coordination costs.
  • Planning errors at the upper layer may propagate downward.
  • The autonomy of sub-Agents is constrained by the manager.

Applicable scenarios: complex project execution, enterprise-level automation, software R&D processes, and cross-domain task management.

4. Peer-to-Peer Collaboration Mode (P2P)

In peer-to-peer collaboration, there is no fixed hierarchical relationship between Agents.

Each Agent can exchange information, request help, or provide services to other Agents based on its own capabilities and task requirements.

For example, in a technical decision-making system:

  • Architecture Agent proposes architecture solutions.
  • Security Agent evaluates security.
  • Performance Agent evaluates performance.
  • Cost Agent evaluates resource costs.

The Agents discuss with one another and ultimately form a joint decision.

flowchart TD
    A["Architecture Agent"] <--> B["Security Agent"]
    A <--> C["Performance Agent"]
    A <--> D["Cost Agent"]
    B <--> C
    B <--> D
    C <--> D

    E["Consensus Agent"] --> A
    E --> B
    E --> C
    E --> D

    E --> F["Final Decision"]

    style A fill:#EAF3EC,stroke:#83A995,color:#315D49
    style B fill:#EAF3EC,stroke:#83A995,color:#315D49
    style C fill:#EAF3EC,stroke:#83A995,color:#315D49
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style F fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Advantages:

  • Agents have a relatively high degree of autonomy.
  • They can discuss complex problems from different perspectives.
  • They do not rely on a single central node for all decisions.

Disadvantages:

  • Complex communication relationships.
  • Prone to duplicate discussions.
  • May lead to disagreements and circular negotiation.
  • Requires an additional consensus mechanism.

Applicable scenarios: multi-expert consultation, complex decision-making, open-ended problem research.

Note that peer-to-peer collaboration does not mean there is no coordination mechanism at all. A real system still needs to define message formats, negotiation rules, termination conditions, and conflict resolution strategies.

5. Competitive Collaboration Mode (Competitive)

In the competitive mode, multiple Agents independently complete the same task, and then a scoring, review, or voting mechanism is used to select the better result.

For example, have three Agents each generate a code implementation, and then a Reviewer Agent evaluates code quality.

flowchart TD
    A["Receive task"] --> B["Generate solutions concurrently"]

    B --> C["Agent A"]
    B --> D["Agent B"]
    B --> E["Agent C"]

    C --> F["Solution evaluation"]
    D --> F
    E --> F

    F --> G["Scoring and ranking"]
    G --> H{"Is there a qualified solution"}

    H -->|"Yes"| I["Select the best solution"]
    H -->|"No"| J["Regenerate or adjust the task"]

    I --> K["Output result"]
    J --> B

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#EAF3EC,stroke:#83A995,color:#315D49
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#EAF3EC,stroke:#83A995,color:#315D49
    style F fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style G fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style H fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style I fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style J fill:#F7EAE7,stroke:#C98D7C,color:#754438
    style K fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Advantages:

  • Can obtain multiple independent solutions.
  • Reduces the risk of an unsatisfactory single-generation result.
  • Suitable for tasks that require comparison and selection of the best option.

Disadvantages:

  • Calling the model multiple times increases cost.
  • The evaluator may have bias.
  • Multiple Agents may produce similar results, failing to bring true diversity.

Applicable scenarios: code generation, solution comparison, content creation, complex problem solving.

6. Hybrid Collaboration Mode (Hybrid)

In real-world engineering, a single collaboration mode usually cannot cover complex business requirements.

The hybrid mode combines sequential, parallel, hierarchical, competitive, and other modes, and chooses different execution methods according to the task structure.

For example, an automated software development system can adopt the following:

  1. A Planner Agent is responsible for overall task planning.
  2. Multiple development Agents develop different modules in parallel.
  3. An integration Agent completes module integration sequentially.
  4. Multiple testing Agents execute tests in parallel.
  5. A Reviewer Agent performs the final review.
flowchart TD
    A["User requirements"] --> B["Planner Agent"]
    B --> C["Task decomposition"]

    C --> D["Backend Agent"]
    C --> E["Frontend Agent"]
    C --> F["Database Agent"]

    D --> G["Integration Agent"]
    E --> G
    F --> G

    G --> H["Parallel testing"]

    H --> I["Unit Test Agent"]
    H --> J["Security Test Agent"]
    H --> K["Performance Test Agent"]

    I --> L["Reviewer Agent"]
    J --> L
    K --> L

    L --> M{"Passed?"}
    M -->|"No"| B
    M -->|"Yes"| N["Delivery result"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#EAF3EC,stroke:#83A995,color:#315D49
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style H fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style I fill:#EAF3EC,stroke:#83A995,color:#315D49
    style J fill:#EAF3EC,stroke:#83A995,color:#315D49
    style K fill:#EAF3EC,stroke:#83A995,color:#315D49
    style L fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style M fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style N fill:#DCEFE5,stroke:#4F8B70,color:#24563F

The hybrid mode provides greater expressive capability, but it also increases the complexity of system design. Priority should be given to ensuring clear boundaries at each stage before considering combining more collaboration modes.

4. Core Strategies for Agent Orchestration

Collaboration modes define the collaborative relationships, while orchestration strategies determine how the system actually operates.

1. Static Orchestration

Static orchestration determines the task execution order and invocation relationships during the system design phase.

For example:

flowchart TD
    A["Task start"] --> B["Agent A"]
    B --> C["Agent B"]
    C --> D["Agent C"]
    D --> E["Task end"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#EAF3EC,stroke:#83A995,color:#315D49
    style C fill:#EAF3EC,stroke:#83A995,color:#315D49
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Characteristics:

  • The execution path is fixed.
  • The process is easy to predict.
  • Debugging and testing are relatively simple.
  • Suitable for stable, standardized business processes.

The disadvantage is lower flexibility. If new tasks arise during operation, corresponding branches usually need to be designed in advance.

2. Dynamic Orchestration

Dynamic orchestration decides the next execution action in real time based on the current task state, execution results, and Agent capabilities.

For example, the Planner Agent can dynamically select specialized Agents according to user requirements.

flowchart TD
    A["Receive task"] --> B["Analyze task type"]
    B --> C["Select executing Agent"]

    C --> D{"Task type"}

    D -->|"Technical research"| E["Research Agent"]
    D -->|"Data analysis"| F["Analysis Agent"]
    D -->|"Code development"| G["Coding Agent"]

    E --> H["Check execution result"]
    F --> H
    G --> H

    H --> I{"Whether to continue execution"}

    I -->|"Yes"| B
    I -->|"No"| J["Complete task"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style D fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style E fill:#EAF3EC,stroke:#83A995,color:#315D49
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#EAF3EC,stroke:#83A995,color:#315D49
    style H fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style I fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style J fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Characteristics:

  • It can dynamically select an Agent based on context.
  • It adapts to complex and uncertain tasks.
  • It supports dynamically adding or adjusting execution steps.

The drawback is that the execution path is not fixed, making system testing, cost estimation, and exception recovery more difficult.

3. DAG-Based Task Orchestration

For complex tasks, using a Directed Acyclic Graph (DAG) to describe task dependencies is a very practical engineering approach.

In a DAG:

  • A node represents a task or an Agent execution unit.
  • A directed edge represents the dependency relationship between tasks.
  • The acyclic constraint ensures that task dependencies contain no cycles.
  • A node with no unfinished prerequisite dependencies can enter the executable state.

For example, to build a technical report:

  • Task A: Collect technical materials.
  • Task B: Collect industry data.
  • Task C: Analyze the technical architecture, depends on A.
  • Task D: Analyze market trends, depends on B.
  • Task E: Generate a comprehensive report, depends on C and D.
flowchart TD
    A["Collect technical materials"] --> C["Analyze technical architecture"]
    B["Collect industry data"] --> D["Analyze market trends"]

    C --> E["Generate comprehensive report"]
    D --> E

    E --> F["Quality review"]

    style A fill:#EAF3EC,stroke:#83A995,color:#315D49
    style B fill:#EAF3EC,stroke:#83A995,color:#315D49
    style C fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style D fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style E fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style F fill:#DCEFE5,stroke:#4F8B70,color:#24563F

The execution process of DAG orchestration:

flowchart TD
    A["Load task DAG"] --> B["Check task dependencies"]
    B --> C["Find executable nodes"]
    C --> D{"Are there executable tasks?"}

    D -->|"Yes"| E["Submit to task scheduler"]
    E --> F["Execute tasks concurrently"]
    F --> G["Record execution results"]
    G --> H["Update dependency status"]
    H --> C

    D -->|"No"| I{"Are all tasks complete?"}
    I -->|"Yes"| J["Aggregate results"]
    I -->|"No"| K["Detect blocked or failed tasks"]

    K --> L["Retry, skip, or abort"]
    L --> C

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style C fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style D fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style E fill:#EAF3EC,stroke:#83A995,color:#315D49
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style H fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style I fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style J fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style K fill:#F7EAE7,stroke:#C98D7C,color:#754438
    style L fill:#E0F0FE,stroke:#93BCE8,color:#1E4976

DAG orchestration is particularly well suited to:

  • Large-scale data processing.
  • Multi-stage document analysis.
  • Software development and testing.
  • Multi-agent parallel research.
  • Automation tasks with complex dependencies.

Note: DAGs are good for describing tasks with clear dependencies, but they are not suited to directly expressing arbitrary loops and ongoing conversations. For agent systems that require iterative reasoning, you can encapsulate the loop inside a single task node, or use a workflow engine that supports state transitions.

4. Event-Driven Orchestration

Event-driven orchestration does not require all agents to execute in a strict, fixed order; instead, subsequent tasks are triggered by events.

For example:

  • A task-completed event triggers result aggregation.
  • A review-failure event triggers re-execution.
  • A user-provides-more-information event triggers re-planning.
  • A timeout event triggers failure recovery.
flowchart TD
    A["Task execution"] --> B["Emit event"]
    B --> C["Event bus"]

    C --> D["Task completed event"]
    C --> E["Review failed event"]
    C --> F["Execution timeout event"]

    D --> G["Aggregate results"]
    E --> H["Re-execute task"]
    F --> I["Timeout recovery handling"]

    H --> J["Update task status"]
    I --> J
    J --> K["Continue orchestration"]

    style A fill:#EAF3EC,stroke:#83A995,color:#315D49
    style B fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style C fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style D fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style E fill:#F7EAE7,stroke:#C98D7C,color:#754438
    style F fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style G fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style H fill:#EAF3EC,stroke:#83A995,color:#315D49
    style I fill:#EAF3EC,stroke:#83A995,color:#315D49
    style J fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style K fill:#DCEFE5,stroke:#4F8B70,color:#24563F

The event-driven pattern suits asynchronous tasks, long-running tasks, and collaboration among multiple independent services.

However, it requires a reliable event delivery mechanism and must handle duplicate events, out-of-order events, lost messages, and consumer failures.

5. Blackboard-Based Collaborative Orchestration (Blackboard)

The blackboard pattern uses a shared information space that lets multiple agents read and update task state.

Each agent does not need to communicate directly with all the other agents; instead, they exchange information through the shared blackboard.

For example:

  • The Research Agent writes research materials.
  • The Analysis Agent reads the materials and writes analysis conclusions.
  • The Reviewer Agent reads the analysis conclusions and writes review comments.
  • The Orchestrator decides the next execution action based on the state in the blackboard.
flowchart TD
    A["Research Agent"] --> B["Shared Blackboard"]
    C["Analysis Agent"] <--> B
    D["Reviewer Agent"] <--> B
    E["Orchestrator"] <--> B
    F["Execution Agent"] <--> B

    B --> G["Shared task status and intermediate results"]

    style A fill:#EAF3EC,stroke:#83A995,color:#315D49
    style B fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style C fill:#EAF3EC,stroke:#83A995,color:#315D49
    style D fill:#EAF3EC,stroke:#83A995,color:#315D49
    style E fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#F5F8F4,stroke:#B5CBBB,color:#40594A

Advantages:

  • Reduces direct communication coupling between Agents.
  • Makes it easy to save intermediate results.
  • Supports different Agents executing at different times.
  • Facilitates system recovery and state tracking.

Disadvantages:

  • Shared state may cause concurrent write conflicts.
  • The blackboard may become a performance bottleneck.
  • Data versioning, permissions, and consistency mechanisms need to be designed.

V. Agent Task Decomposition and Scheduling Strategies

The core of orchestration is not simply invoking multiple Agents, but transforming complex goals into executable, traceable, and recoverable tasks.

1. Task Decomposition Strategy

A good task decomposition result should satisfy the following:

  • Each subtask has a clear goal.
  • Each subtask has a verifiable output.
  • Each subtask has clear inputs.
  • Each subtask has clear execution responsibility.
  • Dependencies between subtasks can be described.

For example, the user requests the development of a blog system.

The Planner Agent can decompose it as follows:

Task ID Subtask Executing Agent Dependency
T1 Requirements analysis Planning Agent None
T2 Database design Backend Agent T1
T3 API design Backend Agent T1
T4 Frontend page design Frontend Agent T1
T5 Backend development Backend Agent T2, T3
T6 Frontend development Frontend Agent T4, T3
T7 Integration testing Test Agent T5, T6
T8 Security review Security Agent T5, T6
T9 Delivery review Reviewer Agent T7, T8

After decomposition is complete, the Orchestrator organizes task execution according to dependencies.

2. Capability-Based Agent Routing

A system usually has multiple Agents, but different Agents have different capabilities and costs.

Therefore, an Agent capability registry needs to be established.

For example:

Agent Capability Applicable Tasks
Research Agent Information retrieval, document organization Technical research
Coding Agent Code generation, code modification Software development
SQL Agent SQL writing, database analysis Data query
Security Agent Vulnerability analysis, security review Security tasks
Reviewer Agent Quality assessment, result validation Result review

Routing process:

flowchart TD
    A["Receive subtask"] --> B["Extract task capability requirements"]
    B --> C["Query Agent capability registry"]
    C --> D["Filter out Agents that do not meet capability requirements"]
    D --> E["Evaluate candidate Agents"]

    E --> F["Consider capability, cost, load, and latency"]
    F --> G{"Is there an available Agent"}

    G -->|"Yes"| H["Select the optimal Agent"]
    G -->|"No"| I["Degrade, queue, or return failure"]

    H --> J["Submit task for execution"]

    style A fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style B fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style C fill:#E0F0FE,stroke:#93BCE8,color:#1E4976
    style D fill:#F5F8F4,stroke:#B5CBBB,color:#40594A
    style E fill:#EAE8FA,stroke:#A49BD5,color:#51477D
    style F fill:#EAF3EC,stroke:#83A995,color:#315D49
    style G fill:#F7F4E8,stroke:#C7B77A,color:#675A2D
    style H fill:#DCEFE5,stroke:#4F8B70,color:#24563F
    style I fill:#F7EAE7,stroke:#C98D7C,color:#754438
    style J fill:#DCEFE5,stroke:#4F8B70,color:#24563F

Agent selection should not only consider capability matching; it should also consider:

  • Model reasoning capability.
  • Tool access permissions.
  • Current concurrent load.
  • Average response time.
  • Invocation cost.
  • Historical task success rate.
  • Data security level.

For tasks involving permission or security boundaries, permission filtering should precede cost and performance scoring.

3. Task Priority Scheduling

When the system has many tasks at the same time, the execution order must be determined.

Common scheduling strategies include:

Strategy Scheduling Basis Applicable Scenarios
FIFO First submitted, first executed Simple task queue
Priority Tasks with higher priority execute first Prioritize important tasks
Round Robin Allocate execution resources in turn Multi-tenant systems
Shortest Job First Tasks estimated to take less time are prioritized Reduce average waiting time
Deadline Tasks closest to their deadlines are prioritized Tasks with time limits
Weighted Fair Queueing Allocate resources by weight Multi-service resource isolation

Production systems usually do not adopt only one strategy; they combine priority, deadlines, tenant quotas, and resource limits.

4. Concurrency Control and Resource Management

Parallel execution can improve efficiency, but more concurrency is not always better.

The following must be controlled:

  • Number of Agents running concurrently.
  • Number of concurrent model API requests.
  • Number of concurrent tool calls.
  • Maximum Token consumption per task.
  • Resource quota per user.
  • Concurrent access to shared data.

Common control methods:

  • Semaphore: limit the number of tasks executing simultaneously.
  • Rate Limiter: control request rate.
  • Queue: buffer tasks waiting to be executed.
  • Worker Pool: reuse worker threads or processes for execution.
  • Timeout: limit the execution time of a single task.

For example, if the maximum concurrency is set to 5, even if the system receives 100 tasks, only 5 of them are allowed to execute at the same time, and the remaining tasks enter the waiting queue.

6. State Management in Agent Orchestration

Multi-Agent systems often need to execute multiple steps and may even run continuously for minutes or hours. Relying only on in-memory variables to store state makes it difficult to support fault recovery and long-term task management.

1. Task State Design

The following states can be defined for a task:

State Meaning
PENDING Waiting for execution
READY Ready for execution
RUNNING Executing
WAITING Waiting for other tasks or external events
SUCCEEDED Execution succeeded
FAILED Execution failed
RETRYING Retrying
CANCELLED Cancelled
SKIPPED Skipped

Task state transitions: