Multi-Agent Systems in Practice: Architectural Boundaries, State Handoffs, and Failure Control

Design Multi-Agent Systems with Supervisor-Worker, Planner-Executor, Critic-Reviewer, state handoffs, failure containment, observability, and single-agent tradeoffs.

Published · 2026-04-2413 min readXBSTACK
Evidence 10 cited sources
On this page

Who Should Read This

  • System architects shifting from single-agent workflows to complex multi-agent collaborative systems.
  • Frontline developers focusing on communication latency, network overhead, and debugging logs for multi-agent environments.
  • Technical decision-makers who need to assess the value and cost of deploying multi-agent applications in specific verticals.

1. Architectural Choice: Don’t Use Multiple Agents for Their Own Sake

Introducing a multi-agent architecture should be a defensive response to task complexity and increasing model-attention entropy, not the default choice simply because the technology appears advanced.

With Multi-Agent Systems (MAS) surging in popularity, many developers have fallen into the misconception that more agents make a system smarter. They try to use a complex cluster containing a Planner, Coder, Tester, and Reviewer for a simple task that a single agent and a few Python tools could easily handle.

Multi-agent systems are not a free lunch. Every additional Agent that requires a separate model call or state handoff usually adds some latency, token/call cost, context maintenance, and debugging complexity, but the amplification depends on team topology, parallelism, model price, message sharing, and tool-result size. If one Agent plus tools already meets the acceptance bar, there is no reason to split roles for appearance alone. If the business path is deterministic, compare a normal code workflow against agent orchestration on real cost and maintenance effort.

The useful multi-agent benefit is usually responsibility isolation: independent retrieval, generation, review, execution, or cross-system delegation can have separate context and permissions. Whether that actually outperforms one agent must be proven on the same task set rather than assumed from agent count.

2. Scenario Fit: When Should You Introduce Multi-Agent Systems?

Multi-agent systems are useful when independent roles, context isolation, parallel research, independent review, or cross-system delegation justify the coordination overhead. If a task is simply a deterministic linear process, compare a normal workflow or business state machine before adding multiple agents.

Before refactoring a system into a multi-agent architecture, evaluate the business objective, risk, task topology, and available operational evidence to determine whether role separation is justified:

1. Scenarios Worth Evaluating for MAS

  • Complex open-ended research: for example, searching a large number of web pages in real time, synthesizing technology trends, and producing competitor reports. This requires a Searcher Agent to filter for signal, a Writer Agent to draft the report, and a Critic Agent to identify errors and audit against an independent evidence trail.
  • High-risk decision review: for example, legal contract audits or financial-statement reconciliation. Separating generation from review can help, but review should also use original evidence, deterministic checks, and human oversight where required. Whether this needs another Agent should be decided by risk analysis and evaluation.
  • Cross-organization and cross-toolchain collaboration: when agents are implemented by different teams, languages, or frameworks and must delegate across separate security boundaries, evaluate A2A, MCP, HTTP APIs, queues, or custom event contracts. A2A is one standardized option for agent-to-agent collaboration, not the only integration pattern.

2. Scenarios Where a Single Agent or Deterministic Workflow Is Usually Preferable

  • Single-turn or low-frequency Q&A: for example, a simple enterprise intranet FAQ knowledge base can use RAG + prompts directly.
  • Highly deterministic approval processes: for example, leave approvals or automatic deductions from reimbursement limits. Logic with clear rules should be implemented directly with traditional CRUD operations and conditional branches instead of consuming expensive LLM inference capacity.
  • Simple single-tool calls: if the agent only needs to query the weather once or read a database in response to an instruction, a single Agent with Function Calling is the most efficient approach.

3. Five Core Collaboration Architecture Models and Their Practical Risks

Production-grade multi-agent collaboration must begin with clearly defined responsibilities for each node to prevent redundant internal work caused by overlapping logical boundaries.

In industrial-grade MAS design, five collaboration and orchestration patterns are common. Each has a different division of responsibilities and a different set of boundary risks:

1. Supervisor-Worker Pattern (Manager and Executors)

  • Structure: The central Supervisor receives the user’s task, decomposes it, assigns work to specialized Workers, and formats and consolidates the Workers’ results while providing final quality control.
  • Suitable scenarios: routing for multi-channel intelligent customer service and cross-domain document analysis.
  • Main risk: the Supervisor can become a single point of failure. If it misclassifies a task—for example, routing a legal refund request to an FAQ Worker—the downstream path may be wrong. Deterministic prechecks, routing-confidence thresholds, fallback paths, and human escalation can reduce this risk; Workers should not be assumed to correct upstream errors on their own.

2. Planner-Executor Pattern (Planner and Executor)

  • Structure: The Planner is responsible only for decomposing a long-running task and defining its phases, then sending specific instructions to the Executor. After execution, the Executor returns the actual result to the Planner, which decides whether to proceed or replan.
  • Suitable scenarios: complex automated software deployment, multi-step data cleaning.
  • Main risk: if the Planner decomposes the task too finely, communication costs consume large numbers of Tokens. If the decomposition is too coarse, the Executor frequently produces errors because local tool calls lack required inputs.

3. Researcher-Writer-Reviewer Pattern (Research, Writing, and Auditing)

  • Structure: this is the classic content-production triad. The Researcher uses retrieval tools to collect verifiable evidence; the Writer drafts from that evidence; and the Reviewer checks key claims, conclusions, and citations against the original sources. Agreement between models is not proof, and the Reviewer should not rely only on the Writer’s summary.
  • Suitable scenarios: industry research reports and automated proofreading of technical documentation.
  • Main risk: the Reviewer can compromise on quality. Without constraints, it may read only the Writer’s summary instead of checking the original Research evidence trail, allowing hallucinated facts to pass.

4. Debate / Critic Pattern (Two-Role Adversarial Debate)

  • Structure: two Agents review the same proposal, such as a software architecture or investment research draft, from different positions over a bounded number of rounds. They look for counterexamples and evidence gaps. Consensus is not proof of correctness; use independent sources, verifiable checks, and an explicit stopping rule.
  • Suitable scenarios: evaluating high-risk investment proposals and automated security-vulnerability discovery.
  • Main risk: meaningless pleasantries and bloated output. Without strong external factual constraints, the debate can easily degrade into a pointless loop that burns large numbers of Tokens.

5. Agent Handoff Pattern (Agent Handoff Routing)

  • Structure: each Agent has a defined role. When the FAQ Agent detects a refund request, it passes only the context, authorization scope, and stable business identifiers required by the Refund Agent, following least-privilege rules rather than copying the full conversation by default.
  • Suitable scenarios: complex, distributed, multifunctional business systems.
  • Main risk: context loss. If the shared process memory or state-persistence layer fails to pass key session variables—such as an already recognized order_id—the receiving Agent will ask the user for the information again, creating a severe break in the experience.

Framework implementation notes: similar patterns do not imply identical runtime semantics

  • LangGraph: Subgraphs can be used as nodes in a parent graph. Parent and child graphs may share state keys or use wrapper nodes to map different state schemas. Configure the parent checkpointer when subgraph persistence, interrupts, or state inspection are required.
  • AutoGen AgentChat: Team presets include RoundRobinGroupChat, SelectorGroupChat, MagenticOneGroupChat, and Swarm. Termination conditions such as MaxMessageTermination, TimeoutTermination, and HandoffTermination can bound execution. The official guidance is to optimize a single agent and its tools before introducing a team.
  • Google ADK: ADK 2.0 graph workflows express routing through nodes and edges. Current documentation lists Python, TypeScript, and Go v2.0.0 support, with Kotlin marked experimental. Prebuilt sequential, parallel, and loop workflow templates are also documented; check the target language and SDK version before choosing.
  • Microsoft Agent Framework: Built-in workflow orchestrations include Sequential, Concurrent, Handoff, Group Chat, and Magentic, with approval and request-info interactions for human-in-the-loop workflows.
  • A2A: Use it for agent-to-agent task interaction across service or organizational boundaries. In-process handoffs, function calls, and MCP tool access should not all be described as A2A.

Framework class names and APIs evolve. Base implementation choices on the official documentation for the deployed version and tests of failure and recovery behavior, not on a framework’s class names as universal architecture standards.

4. State Handoff: Transitioning from Natural Language to Strongly Typed Structured Data

For important business state, prefer a versioned, validated structured contract between Agents. A natural-language summary can provide context, but should not be the only source of state. Low-risk, short-lived tasks may use a lighter handoff appropriate to their requirements.

When developing a multi-agent system, the worst engineering mistake is to have Agents hand off tasks using only conversational natural language. When reading a summary written by the previous Agent, a large model often misses technical details such as exact IDs, execution times, and parameter hashes.

For workflows that require durable state transfer, define a versioned and validated handoff contract; whether it must be a single shared model depends on system boundaries and data complexity.

The following Pydantic example illustrates a typed handoff contract. It validates fields, but does not by itself guarantee concurrent consistency, durable persistence, or compatibility across schema versions:

from typing import Literal
from pydantic import BaseModel, Field

class EvidenceRef(BaseModel):
    source_id: str
    uri: str | None = None
    content_hash: str | None = None

class TaskContext(BaseModel):
    user_goal: str
    entity_ids: list[str] = Field(default_factory=list)
    constraints: list[str] = Field(default_factory=list)

class AgentState(BaseModel):
    schema_version: Literal["1"] = "1"
    task_id: str
    idempotency_key: str
    state_version: int = Field(ge=0)
    parent_trace_id: str
    current_agent: str
    target_agent: str | None = None
    task_context: TaskContext
    completed_steps: list[str] = Field(default_factory=list)
    evidence: list[EvidenceRef] = Field(default_factory=list)
    handoff_reason: str | None = None

At runtime, when the Coder Agent completes the code and hands the task to the Reviewer, the required business fields can be serialized into a version-checked AgentState. The Reviewer reads task_context, completed_steps, and evidence references within its authorization scope. Structured state reduces the risk that a natural-language summary drops an ID or parameter, but Pydantic/schema validation does not itself provide durable persistence, concurrency control, or exactly-once side effects. The idempotency_key must be enforced at the business store or side-effect boundary, and schema evolution, concurrent writes, replay, and external-system state need recovery tests.

5. Communication Overhead and Latency: The Concrete Cost of Multi-Role Interaction

Separating roles does not inherently improve output accuracy. It usually adds model calls, token use, network latency, state coordination, and debugging work; evaluate the tradeoff on the same task set before adopting it.

How much more expensive a multi-agent design becomes must be measured on your own task set. One unarchived seconds/token comparison is not a universal benchmark. A more defensible test keeps input, tool permissions, and pricing assumptions constant: use a single agent as the baseline, add Planner, Reviewer, or specialized Workers one at a time, and record model-call count, input/output tokens, P50/P95 latency, tool calls, task success, and human correction rate. An extra role is justified only when the quality gain covers the additional cost and complexity.

When deciding whether to use MAS, measure at least:

  • Token and call amplification: attribute input, output, cache behavior, and tool-result volume to each role rather than assuming communication tokens always dominate.
  • Interaction latency (P95/P99): serial model rounds accumulate delay, while parallel calls add resource and aggregation cost. Define an explicit latency SLO before enabling a multi-agent path for real-time traffic.
  • State consistency overhead: when Workers update the same business object concurrently, choose an explicit concurrency strategy such as transactions, optimistic versions, queue serialization, idempotent writes, or key partitioning. A distributed lock is not universally required.

6. Failure Propagation: Local Collapses in Multi-Agent Clusters and Chain Reactions

A primary multi-agent risk is the propagation of upstream errors. Critical transitions need explicit validation, bounded recovery paths, and checkpoints where the workflow requires them.

In MAS, mistakes are contagious. Without intervention, a tiny local error can quickly turn into a global logical disaster.

The classic failure transmission chain is as follows:

  1. Stage One (Planner drift). The user wants to check the R&D budget for Q1 2026, but the Planner hallucinates and decomposes the task for Q1 2025.
  2. Stage Two (blind Worker execution). The Worker Agent responsible for SQL received instructions for 2025 and faithfully queried and returned the database’s 2025 data.
  3. Stage Three (false Reviewer approval). The Reviewer compared only the Worker’s SQL with the Planner’s plan, found that both specified 2025, and passed the consistency check.
  4. Stage Four (summary and return). The user ultimately receives an exceptionally well-formatted, logically structured budget report whose core factual data is entirely wrong.

To reduce error propagation, a multi-agent architecture needs two controls: First, give the Reviewer the original request, authorized scope, and relevant evidence references. It should use restricted read-only tools for rechecking only when necessary and authorized; do not grant broad tool access merely for review. Second, define recoverable checkpoints and explicit failure branches for critical steps. If a Reviewer rejects an output, the workflow may request a targeted Worker repair, return to the Planner for replanning, or escalate to a human. The recovery point should follow the state machine, idempotency design, and side-effect boundary; rolling the Planner back is not mandatory for every architecture.

7. Evaluation Metrics: How Do You Measure the Health of Multi-Agent Collaboration?

Multi-agent evaluation must not rely solely on the final output similarity score; instead, it must break down and monitor each subnode’s call frequency, handover success rate, and marginal resource contribution.

If we only use a simple LLM-as-a-judge to score the final article or report when evaluating multi-agent systems, we cannot judge the effectiveness of the division of labor among each Agent role. We might end up spending dozens of times more tokens, introducing five agents, but the final effect is no different from a single agent.

To achieve production-level quality monitoring, we must establish a detailed evaluation indicator system within the development environment:

1. Collaboration and Performance Metrics (Technical Metrics)

  • Agent Handoff Success Rate (agent_handoff_success_rate): Measures the proportion of timeouts and deadlocks caused by parsing failures or context loss during state handoffs between Agents.
  • Average Steps Per Task (avg_steps_per_task): A measure of execution-path length. A sustained increase may reflect task mix, routing changes, or retries; stratify by task type rather than treating the metric alone as proof of an inefficient loop.
  • Communication Token Ratio: The proportion of tokens consumed by mutual confirmation between agents to the total token consumed for a single task, used to assess redundant communication costs.
  • Retry Recovery Rate (retry_recovery_rate): Measures the share of Reviewer-returned tasks that a Worker repairs and passes through review within the retry budget. It measures the recovery process, not autonomous self-healing.

2. Real Business Metrics

  • Marginal quality gain: Compare task success, error severity, and human correction rates on the same evaluation set, model versions, tool permissions, and cost basis. Set project-specific keep, simplify, or rollback thresholds using uncertainty intervals, latency, and cost per successful task; do not apply an unsupported universal percentage.
  • Human escalation rate (human_escalation_rate): The share of tasks sent to human review or takeover. Interpret it alongside risk level, false-approval rate, and review quality; a higher rate is not automatically worse, and a lower rate is not automatically safer.
  • Marginal cost per task success (cost_per_successful_task): Calculate the average amount of dollars spent for each successful completion of a real business task.

8. Minimum Viable Release Recommendations

For an initial release, start with the smallest set of roles that meets the task requirements, then add roles only when evaluation demonstrates value. Automation should be governed by action risk, reversibility, permissions, and approval policy; payments, refunds, external communications, and irreversible state changes need explicit authorization and appropriate human confirmation.

When building the first MAS system (MVP), avoid designing an overly grand autonomous ecosystem. I strongly recommend that you comply with the following development constraints:

  • Role count: There is no universal maximum. Start with the smallest viable topology, such as a Supervisor, Worker, and Reviewer; add another agent only when it produces measurable quality, isolation, or throughput gains, and monitor coordination overhead.
  • Clear boundaries: Grant each role the minimum tools required for its task. FAQ lookup and high-impact refund tools need distinct authorization, server-side validation, and approval policies. Tool sets may overlap in a controlled way, but a shared runtime must not expose every tool to every agent by default.
  • Authorization and human approval: For high-impact or irreversible actions such as payments, refunds, and external notifications, require explicit user authorization, policy checks, and human approval where appropriate. Low-risk, reversible actions may be automated within restricted permissions and audit controls.

9. Common Design Pitfalls and Error Troubleshooting (Error Logs)

Poorly designed multi-agent clusters are prone to typical errors such as communication deadloops, state locks, and hallucination amplification, requiring targeted interception.

The following are illustrative failure scenarios and synthetic log examples, not production incidents observed by XBSTACK. Adapt error names, thresholds, and remediation to the deployed framework and infrastructure:

1. Agent Handoff Loop (Communication Deadlock)

  • Symptom: Two Agents repeatedly hand control back and forth because of a state check, routing condition, or review response, without producing verifiable progress; model calls and token use continue to accumulate.
  • Error Text:
    Example only: [MAS_COMMUNICATION_DEADLOCK] Interaction budget exceeded between 'agent_code_developer' and 'agent_code_reviewer'. Session ID: example-session. Handoff limit: configured-project-value.
    
  • Root Cause: Lack of global hop count monitoring, and the Reviewer did not provide specific code modification instructions when returning changes, causing the Worker to guess the modifications, and the Reviewer continued to report errors and return them.
  • Troubleshooting Measures: Set per-workflow limits for handoffs, total steps, runtime, and cost, then combine them with no-progress detection to trigger termination, bounded retry, or human review. Max_Turns = 5 is an example project setting, not a universal default. Reviewer feedback should use a validated structure containing the failed field, evidence location, and suggested action.

2. State Synchronization Lag (Concurrent State Conflict)

  • Phenomenon: When multiple agents concurrently read the same file and update the state, the Agent that finishes later directly overwrites the data of the Agent that finished earlier, causing data corruption.

  • Error Text:

    Example only: [STATE_VERSION_CONFLICT] Optimistic lock check failed for entity 'example-task'. Expected version: 4, found: 5. Active agent: 'example-writer'.
    
  • Root Cause: Multiple concurrently executing sub-Workers share the same memory state and no optimistic locking mechanism has been introduced at the database or persistence layer.

  • Troubleshooting Measures: Introduce version (version) control in the underlying State DB. Each time the state dictionary is updated, perform an optimistic lock check on WHERE version = current_version; if a write conflict occurs, catch the exception and trigger exponential backoff retry to decouple concurrent conflicts.

3. Latency Explosion (Response Delay Avalanche)

  • Symptom: A client request is disconnected after exceeding the gateway or client timeout configured in the deployment; for example, one environment may use 60 seconds. This is illustrative, not a universal gateway default.

  • Error Text:

    Example only: [HTTP_GATEWAY_TIMEOUT] Upstream task exceeded the configured gateway timeout. Trace: example-trace.
    
  • Root Cause: The system uses a synchronous waiting model to handle multi-step planning across multiple agents. Any slowdown in an upstream model triggers a domino-like delay avalanche.

  • Troubleshooting Strategy: For work that can outlive an HTTP request, consider a durable asynchronous job model: return a task identifier, persist status and checkpoints, and expose authenticated polling, streaming, or push updates. Short, bounded tasks may remain synchronous when they fit the service’s latency budget. Choose a queue and delivery model based on durability, retry semantics, idempotency, and operational needs.

10. Further Reading

To deploy high-reliability agents in production, you need to further learn how to introduce robust governance standards at each process level.

Official framework documentation:

OpenAI Swarm is an experimental educational project; its official README says it has been replaced by the OpenAI Agents SDK and recommends the SDK for production use. It is therefore not listed as a production orchestration standard.

Topic path / AI Agents

Continue from one agent pattern to the complete production system

The AI Agent hub organizes architecture, memory, tool use, evaluation, security, deployment and multi-agent coordination into a single learning path.

Next step: make state and recovery explicit

Full decision path →

Move from the current symptom to the next state, checkpoint, resume, or failure-recovery boundary.

Continue with tool and protocol boundariesAssistants API Shut Down: Responses Migration vs Custom AgentsOpenAI Assistants API shut down August 26, 2026. Restore previously saved Thread histories with Responses API and Conversations, with application-owned business state.Refine the system architectureAutoGen Archived: AgentChat Teams and Agent Framework MigrationArchived AutoGen migration guide covering legacy AgentChat teams, termination, state and the move to Microsoft Agent Framework.Continue with state and memory2026 AI Agent Development Handbook: Protocol Selection, Tool Calling, State Management, and Multi-Agent Deployment ChecklistPractical AI Agent engineering handbook: choose MCP or function calls, manage state, orchestrate teams, enforce tool permissions and test failure recovery.
Comments & evidence

DISCUSSION

Questions, verification and corrections

Sign in to comment. Every new comment is reviewed before publication; while pending, it is visible only to you and the administrator.

Sign-in required Reviewed before public
Loading the discussion…