top of page

Multi-Agent Workflows — Building AI Agents, Part 7

Shift Quality Editorial
Jul 8
9 min read

Updated: Nov 18

Building AI Agents · Part 7

The customer wrote: "You charged me for March, but your service was down for half of it." The triage agent classified it as billing and handed it over. The billing agent saw an outage claim it couldn't verify and handed it to the technical agent. The technical agent confirmed the outage, saw a refund request it had no tool for, and handed it back to billing. Billing, which had received a short summary rather than the conversation, asked the customer which month they meant. The handoff limit tripped on the next turn and the ticket went to a human, who read the first message and resolved it in four minutes.

Each agent did its own job correctly. The system failed in the handoffs, and the ticket that broke it is a common one: a billing question caused by a technical problem.

This part builds a multi-agent workflow, but it starts by measuring whether you need one, and it treats every handoff as the place where things go wrong.

What you'll build

  • a single-agent baseline and a multi-agent version of the same support workflow, compared on the same labelled tickets

  • a way to decide where to split, from data your human team already has

  • handoffs passed as typed, validated records instead of free-text summaries

  • an orchestrator that stops ping-pong between agents

  • tests built from real tickets, including the ones that cross boundaries

Prerequisites: a working tool-using agent (Part 3), the failure handling from Part 5, Python 3.10+.

Why splitting looks like the obvious answer

As an agent gains tools and responsibilities, its instructions get long and its mistakes get harder to attribute. Splitting it into specialists looks like good engineering: smaller prompts, fewer tools each, clear ownership. The team org chart often suggests the split, with a billing team, a technical team and an escalation desk.

Three mechanisms make that split cost more than it appears to.

Every handoff loses context. The receiving agent knows only what the handoff passes. A summary decides, at the moment it's written, which facts the next agent will ever see. Walden Yan of Cognition argues for sharing full agent traces rather than summaries, and adds a second principle: actions carry implicit decisions, and when two agents make conflicting implicit decisions, the result is bad. In the opening example, the billing agent's decision that the outage was unverified never reached the technical agent, and the technical agent's confirmation came back as a one-line summary.

Every agent costs tokens. Anthropic reported that in its multi-agent research system, agents used about 4 times the tokens of a chat interaction, and multi-agent systems about 15 times. The same write-up says multi-agent systems suited its research tasks, which split into independent parallel searches, and that domains where all agents need the same context, or with many dependencies between agents, are a poor fit today. Customer support, where one ticket can depend on both billing and technical facts, is closer to the second kind.

Coordination failures are a category of their own. A study of multi-agent LLM systems (Cemri et al., 2025) identified 14 failure modes in three categories: system design issues, inter-agent misalignment and task verification. The ping-pong in the opening example is inter-agent misalignment, and none of it shows up in a test of any single agent.

The test: if you already have a multi-agent system, count the tickets in the last month that involved more than one handoff. Read five of them end to end. If the customer had to repeat themselves in any, your handoffs are losing information.

A worked example: the support team's fourth agent

This is a composite drawn from common patterns, not one company. The figures are illustrative.

Context. A software company ran the triage, billing, technical and escalation agents described above. Repeat-contact complaints were rising, and the team planned to add a fourth specialist, an account agent, for plan changes and cancellations, which were being misrouted.

The fork. Adding the agent would have fixed one category of misrouting and added another boundary. The support lead asked a question before approving it: "Which tickets do our human agents pass between teams today, and why?" The human helpdesk had recorded every reassignment for years. Nobody had looked at it when the agents were designed.

The team took 400 resolved tickets from the previous quarter:

What the ticket needed

Tickets

Share

Billing only

244

61%

Technical only

88

22%

Both billing and technical (charged for a broken service, plan change because a feature is missing)

44

11%

Other (account access, legal, complaints)

24

6%

One ticket in nine needed both specialties. In the multi-agent system, those tickets produced most of the ping-pong, because no single agent could complete them.

The comparison. The team built a single agent with all nine tools from the four specialists and ran both designs on the 400 labelled tickets:


Multi-agent (4 agents)

Single agent (9 tools)

Resolved correctly, all tickets

81%

85%

Resolved correctly, mixed tickets

52%

80%

Model cost per ticket (single agent = 1.0)

2.4

1.0

Median time to answer

41 s

18 s

The decision. The team kept one boundary and removed the others. Refunds above a set amount needed a different permission and an approval step, so the refund action stayed in a separate, restricted path with its own service account. Everything else moved into one agent. The split now followed a permission boundary, not a topic boundary.

The discovery move. The reassignment history in the human helpdesk was a record of exactly where the work divides and where it doesn't. Asking for it took a day. Designing the agents along the org chart without it cost the team three months of rising repeat contacts.

The test: export three months of reassignments from your human support or operations queue. The share of work that crosses team lines is the share your multi-agent design will hand off. If it's more than a small fraction, test a single agent first.

Step 1: Build the single-agent baseline (20 min)

Before splitting, give one agent every tool the specialists would have, and measure it:

ALL_TOOLS = BILLING_TOOLS + TECHNICAL_TOOLS + ESCALATION_TOOLS

def single_agent(ticket: str, run_id: str) -> RunResult:
    return run_agent(ticket, run_id, tools=ALL_TOOLS,
                     system=SUPPORT_INSTRUCTIONS)  # run_agent from Part 5

Run it on a labelled set of real tickets, with the expected resolution recorded for each. Part 8 builds the evaluation harness in full; for now, a CSV of ticket, expected outcome and category is enough. Record correctness, cost and latency per ticket.

This number is what any multi-agent design must beat, on the same tickets.

Step 2: Decide where to split (15 min)

Split only where at least one of these is true, and write down which:

Reason to split

Evidence to look for

Permission boundary: one part needs access the rest must not have

A tool that moves money, deletes data or contacts people outside

Parallel, independent work: subtasks don't depend on each other

Research or review across many sources that can run at once

Context overflow: one agent can't hold the instructions and tools it needs

Accuracy drops as tools are added, on your evaluation set

Separate ownership: different teams change different parts on different schedules

Release conflicts between teams editing one prompt

"Different topics" is not on the list. Topics overlap in real work, as the 11% of mixed tickets showed.

Step 3: Pass handoffs as typed records (20 min)

If you split, make the handoff a record with required fields, not a summary the model writes however it likes:

from dataclasses import dataclass, field, asdict

@dataclass
class Handoff:
    workflow_id: str
    from_agent: str
    to_agent: str
    original_request: str                 # the customer's words, verbatim, always
    customer_id: str
    facts: list[dict] = field(default_factory=list)          # {"fact": ..., "source": "tool:lookup_invoice#inv_881"}
    actions_taken: list[dict] = field(default_factory=list)  # {"tool": ..., "result_id": ...}
    decisions: list[str] = field(default_factory=list)       # what this agent decided, and why
    open_question: str = ""               # what the receiving agent is being asked to do

REQUIRED = ("original_request", "customer_id", "open_question")

def validate(h: Handoff) -> list[str]:
    problems = [f"missing {f}" for f in REQUIRED if not getattr(h, f)]
    problems += [f"fact without source: {x['fact'][:40]}" for x in h.facts if not x.get("source")]
    return problems

Have the sending agent fill the record through a tool with this schema, so the model must supply every field. Reject a handoff that fails validation and send it back to the sending agent once with the problems listed. The decisions field carries the implicit decisions Cognition warns about: "I treated the outage as unverified" is exactly what the next agent needs to know.

Always pass original_request verbatim. Summaries of the customer's words are where "March" becomes "a recent month".

Step 4: Orchestrate without ping-pong (15 min)

MAX_HANDOFFS = 3

def orchestrate(ticket: str, workflow_id: str) -> RunResult:
    agent, handoff, visited = "triage", None, []
    for _ in range(MAX_HANDOFFS + 1):
        if agent in visited:                       # returning to an agent = ping-pong
            return escalate(workflow_id, "ping_pong", visited, handoff)
        visited.append(agent)
        result = AGENTS[agent](ticket, workflow_id, handoff)
        if not result.handoff:
            return result
        handoff = result.handoff
        if problems := validate(handoff):
            return escalate(workflow_id, "invalid_handoff", visited, handoff, problems)
        agent = handoff.to_agent
    return escalate(workflow_id, "handoff_limit", visited, handoff)

Two rules do most of the work. An agent may not receive the same ticket twice, so billing → technical → billing escalates on the third step instead of looping. And escalation passes the full handoff record, so the human starts where the agents stopped.

Step 5: Trace the workflow, not the agents (10 min)

Give every agent run in a workflow the same workflow_id, and log each handoff as its own event with the record attached. A trace of one agent is not enough to debug a handoff failure; you need the sequence. Part 9 builds this with OpenTelemetry, where each agent becomes a span under one workflow trace.

Step 6: Test with real tickets, including mixed ones (20 min)

Three hand-written routing tests prove very little. Build tests from the labelled set, and make sure the mixed tickets are in it:

import csv, pytest

CASES = list(csv.DictReader(open("labelled_tickets.csv")))

@pytest.mark.parametrize("case", CASES, ids=lambda c: c["ticket_id"])
def test_resolution(case):
    result = orchestrate(case["text"], workflow_id=f"test-{case['ticket_id']}")
    assert result.outcome == case["expected_outcome"]

def test_mixed_ticket_does_not_ping_pong():
    result = orchestrate("You charged me for March but the service was down for half of it.",
                         workflow_id="test-mixed")
    assert result.reason != "ping_pong"

def test_handoff_keeps_original_words(spy_handoffs):
    orchestrate("Refund my March invoice, order 5531", workflow_id="test-verbatim")
    assert all("March" in h.original_request and "5531" in h.original_request
               for h in spy_handoffs)

Report results by category. An overall 81% can hide a 52% on the category that generates complaints.

Step 7: Compare and decide (10 min)

Run both designs on the same set and fill in the table from the worked example: correctness overall and per category, cost per ticket, median latency, and handoffs per ticket. Keep the multi-agent design only if it wins on something you care about by enough to pay for its cost, and you can name which reason from Step 2 justified the split.

Choosing a design

Design

Gains

Costs

Best suited for

Warning signs

Single agent, all tools

Full context; cheapest; simplest to debug

Long instructions; harder to give parts different permissions

Most support and operations workflows

Accuracy falls as tools are added

Router plus single agent

Cheap classification up front for analytics or queueing

One extra call; misroutes are possible but recoverable

High volume with clear categories

Router accuracy below the agent's

Specialists with handoffs

Separate permissions and ownership

Context loss at each handoff; cost; ping-pong

Real permission or ownership boundaries

Customers repeating themselves; mixed tickets failing

Orchestrator with parallel workers

Speed and breadth on independent subtasks

Highest token use; results must be reconciled

Research and review across many sources

Workers producing inconsistent results

When multi-agent is the right call

Anthropic's research system is the clearest public case: questions that break into many independent searches, run in parallel, then combined. A review workflow that checks a document against many separate policies is similar. Permission boundaries are the other strong reason, as in the refund path above. If your work is mostly sequential and shares context, start with one agent and let the data, not the org chart, tell you where to split.

Common failure modes

  • Splitting along the org chart. The boundary runs through the work instead of around it.

  • Free-text handoffs. The summary drops the fact the next agent needed.

  • No baseline. Nobody can say whether the multi-agent design is better than one agent.

  • Ping-pong. Agents return the ticket to each other until a limit trips.

  • Overall scores only. The category that crosses boundaries fails quietly inside a good average.

  • Paying 2–3 times per ticket for a design that resolves fewer tickets.

Final takeaway

Multi-agent designs cost context at every handoff and tokens at every agent, so they have to earn their place. Measure one agent with every tool first. Split where the data shows the work divides, or where permissions must differ, not where the org chart draws lines. Pass handoffs as typed records that carry the customer's own words and each agent's decisions, stop agents from handing work back and forth, and test with real tickets, especially the ones that need more than one specialty. For choosing an agent design more broadly, see AI Agent Architecture.

Multi-agent workflows. In a composite support example, a ticket about being charged during an outage bounced from triage to billing to technical and back, losing context at each handoff. The human helpdesk's history showed 11% of tickets needed both billing and technical help. On 400 labelled tickets a single agent with all nine tools resolved more correctly (85% vs 81%; 80% vs 52% on mixed tickets) at well under half the cost. Split agents on permission boundaries and parallel work, not topics; pass typed handoffs with the original request verbatim; ask which tickets humans pass between teams today.

Sources

  • Jeremy Hadfield, Barry Zhang, Kenneth Lien, Florian Scholz, Jeremy Fox and Daniel Ford, "How we built our multi-agent research system", Anthropic, 13 June 2025: agents use about 4× the tokens of chat interactions and multi-agent systems about 15×; domains that require all agents to share the same context, or involve many dependencies between agents, are not a good fit today. https://www.anthropic.com/engineering/multi-agent-research-system

  • Walden Yan, "Don't Build Multi-Agents", Cognition, 12 June 2025: share context and full agent traces, not just individual messages; actions carry implicit decisions, and conflicting decisions carry bad results. https://cognition.com/blog/dont-build-multi-agents

  • Mert Cemri et al., "Why Do Multi-Agent LLM Systems Fail?", arXiv:2503.13657, March 2025 (revised October 2025): 14 failure modes in three categories, system design issues, inter-agent misalignment and task verification, from annotated traces across seven multi-agent frameworks. https://arxiv.org/abs/2503.13657

Continue the Building AI Agents path

Part of the Building AI Agents learning path.

bottom of page