Hands-on·16 min read

Multi-Agent Systems in AI: Patterns, Pitfalls and a Tested Example

What a multi-agent system is, the six architecture patterns behind almost all of them, and when several agents beat one. We ran four designs on the same job-offer task with a free local model and measured accuracy, model calls and text sent, including what happens when a subtask loses one detail.

By the Crio.Do team · Last updated 21 November 2026

Short answer

A multi-agent system splits one job across several AI agents, each with its own instructions, tools and slice of the information, coordinated by code or a lead agent. The common patterns are pipelines, routers and handoffs, parallel workers, orchestrator-workers and evaluator loops. Use one when the work splits into independent parts. In our test on job-offer letters, one agent reading everything got 0 of 3 right and one worker per letter got 2 of 3, for 4 times the model calls. When the workers got a summarised subtask instead of the user's words, every worker did its job and the system still fell for the trap.

On this page
  1. What is a multi-agent system
  2. Six architecture patterns
  3. When they help, when they hurt
  4. We tested four designs
  5. What the run shows
  6. How to design one that works
  7. Frameworks in 2026
  8. The classical meaning
  9. Interview questions
  10. Honest limits
  11. FAQ

What is a multi-agent system?

A multi-agent system is a program where several AI agents work on one job. Each agent is a language model call with its own instructions, its own tools and, most importantly, its own view of the information. Some code, or one "lead" agent, splits the job, hands out the pieces and puts the answers together.

Think of it like a newsroom. One editor takes the story, sends three reporters to three places, and writes the final piece from their notes. Each reporter only sees their own beat. That is the strength (nobody drowns in everything) and the weakness (nobody sees everything).

A single AI agent is one model in a loop: it calls a tool, reads the result, decides the next step. A multi-agent system is several of those loops, with messages passing between them. Nothing magic happens when you call a second model "an agent": it is still prompts in and text out. What changes is who sees what, and that is what this guide is about.

The term is older than LLMs. In AI courses, a multi-agent system means several autonomous software agents that sense a shared environment, act, and coordinate or negotiate with each other: robot teams, traffic signals, trading bots. We cover that classical meaning near the end. Most searches in 2026 mean the LLM kind, so we start there.

Six multi-agent architecture patterns

Anthropic's guide Building effective agents (19 December 2024) names five workflow patterns: prompt chaining, routing, parallelization (with two flavours, "sectioning" and "voting"), orchestrator-workers and evaluator-optimizer. Add handoffs, which the OpenAI Agents SDK is built around, and you have the six shapes almost every multi-agent system uses. Start from the first row and only move down when you can say what the extra agents buy you.

PatternHow it worksUse it whenExample
0. One agent with tools (the baseline)One model, one loop, all the toolsAlways try this firstA support bot that can look up orders and issue refunds
1. Pipeline (prompt chaining)Agent A's output is agent B's input, in a fixed orderThe steps are known in advanceExtract fields from a resume, then score them, then write feedback
2. Router or handoffA triage agent picks one specialist and hands over the conversationRequests fall into clear types with different tools or rules"Billing" vs "technical" vs "sales" queries
3. Parallel (sectioning or voting)Several agents work at the same time on different parts, or on the same question to voteParts are independent, or one answer needs a second opinionCheck a pull request for security, style and tests in parallel
4. Orchestrator-workers (supervisor)A lead agent decides the subtasks at run time, sends them to workers, combines the resultsYou cannot know the subtasks until you see the inputResearch a question across many sources
5. Evaluator-optimizer (critic loop)One agent drafts, another grades it against criteria, repeat until it passes"Good" can be checked, and a second pass helpsWrite SQL, run it, have a checker compare the result to the question

Anthropic's own description of orchestrator-workers: "a central LLM dynamically breaks down tasks, delegates them to worker LLMs, and synthesizes their results." The difference from a parallel pipeline is the word dynamically: in a pipeline, your code decides the split; in orchestrator-workers, a model does.

Two more terms you will see. Hierarchical means orchestrators of orchestrators (a manager of team leads). Swarm or network means agents hand off to each other with no fixed boss. Both are combinations of the rows above, and both make it harder to see why the system did what it did.

When multiple agents help, and when they hurt

Two well-known engineering write-ups from June 2025 seem to disagree. Read together, they say the same thing.

For: Anthropic's post How we built our multi-agent research system (13 June 2025) reports that "a multi-agent system with Claude Opus 4 as the lead agent and Claude Sonnet 4 subagents outperformed single-agent Claude Opus 4 by 90.2% on our internal research eval." Research is the ideal case: many independent searches that can run in parallel, each in a fresh context window.

The bill: the same post says "agents typically use about 4× more tokens than chat interactions, and multi-agent systems use about 15× more tokens than chats." In their BrowseComp analysis, "token usage by itself explains 80% of the variance" in performance. Part of what multi-agent buys you is simply permission to spend more tokens.

Against: Cognition's Don't Build Multi-Agents (Walden Yan, 12 June 2025) gives two principles: "Share context, and share full agent traces, not just individual messages", and "Actions carry implicit decisions, and conflicting decisions carry bad results". Its example: split "build a Flappy Bird clone" into a background subtask and a bird subtask, and one subagent builds a background that looks like Super Mario Bros, while the other builds a bird that does not match. Neither saw what the other decided.

Anthropic agrees on where the line is: domains "that require all agents to share the same context or involve many dependencies between agents" are "not a good fit for multi-agent systems today", and "most coding tasks involve fewer truly parallelizable tasks than research."

The failure data: the paper Why Do Multi-Agent LLM Systems Fail? (Cemri, Pan, Yang and others, arXiv 2503.13657, latest version 26 October 2025) studied traces from 7 popular multi-agent frameworks and found 14 failure modes in 3 groups: "(i) system design issues, (ii) inter-agent misalignment, and (iii) task verification." Its dataset, MAST-Data, has 1600+ annotated traces, and the taxonomy was checked with an inter-annotator agreement of kappa = 0.88.

So the rule of thumb: split work that is independent, keep work that is connected in one context. If agent B needs to know what agent A decided, every summary between them is a place to lose something. Our experiment below shows that happening.

We tested four designs on one task

Talk about multi-agent systems is cheap, so we ran one. The task: you have three job offers; which gives the most guaranteed cash in the first year? Guaranteed means 12 months of fixed pay plus the joining bonus, not variable pay, stock options or relocation. And you will not sign an offer with a service bond.

It looks easy. Each offer letter also prints a "Total CTC" that includes variable pay and stock options, some letters give pay per month instead of per year, and in some cases the best guaranteed offer has a bond. Those are the traps people fall into with real offers, too. We wrote 4 cases of 3 invented offer letters each (12 letters, made-up companies and numbers), where the highest Total CTC is never the right answer.

Here is one letter, exactly as the model sees it:

Output

OFFER OF EMPLOYMENT: Kestrel Pay
Role: Software Engineer II (Backend), Bengaluru.

Your fixed salary will be Rs 1,60,000 per month, paid on the last working day of each month.
Target variable pay: 10% of fixed pay, paid annually based on company and individual performance.
Joining bonus: Rs 1,00,000, paid with your first salary.
Total CTC: Rs 21,12,000 per annum (includes target variable pay).

Insurance: group health cover of Rs 5,00,000 for you, your spouse and two children.
Notice period: 30 days during the six-month probation, 60 days after confirmation.
Leave: 24 days of paid leave per calendar year, plus 12 public holidays.
There is no service agreement or bond attached to this offer.

Please sign and return this letter within 7 days to accept the offer.

We ran four designs with the same free local model, qwen2.5:3b through Ollama (temperature 0, seed 42), on a laptop CPU. The run finished 3 of the 4 cases before the laptop ran out of disk (details in Honest limits):

  1. single: one model call reads all three letters and answers.
  2. workers: orchestrator-workers. One worker per letter, each given the full user brief, extracts fixed pay, joining bonus and bond as JSON. A final "lead" call reads the three notes and answers.
  3. workers+code: the same three worker notes, but plain Python applies the rule (drop bonded offers, add fixed + joining bonus, pick the largest). No model in the final step.
  4. lossy: the same as workers, except the subtask the workers get was "summarised" on the way down. It asks for total_ctc instead of fixed pay and joining bonus. This is the kind of rewrite an orchestrator model makes when it turns a user request into subtasks. We wrote it by hand so the failure is easy to see.

The whole program is plain Python with no libraries. The lead agent here is fixed code (it always makes three workers), which keeps the test fair: the only thing that changes between designs is who sees what.

multi_agent.py

# multi_agent.py: one task, four designs. Which offer letter gives the most guaranteed first-year cash?
#   single      one model call reads all 3 letters and answers
#   workers     orchestrator-workers: 1 worker per letter extracts numbers (with the full brief),
#               then a final model call compares the workers' notes
#   workers+code  same workers, but plain Python does the comparison
#   lossy       same as workers, but the subtask the workers get was rewritten and lost a detail
import json, pathlib, re, sys, time, urllib.request

BRIEF = ("I have job offers below. Which one gives me the most guaranteed cash in the first year? "
         "Guaranteed cash = 12 months of fixed pay + joining bonus. Do not count variable pay, "
         "stock options or relocation. I will not sign any offer with a service bond, so leave bonded offers out.")
FIELDS = '{"company": str, "fixed_pay_per_year": int, "joining_bonus": int, "has_bond": bool}'
LOSSY_SUBTASK = 'Read this offer letter. Reply in JSON: {"company": str, "total_ctc": int, "has_bond": bool}'
FULL_SUBTASK = f"The user's goal: {BRIEF}\nRead this ONE offer letter and reply in JSON: {FIELDS}. Use plain rupee numbers."

class Ollama:
    def __init__(self, name="qwen2.5:3b"):
        self.name, self.log = name, []            # log: one entry per model call
    def ask(self, role, prompt, json_mode=False):
        body = {"model": self.name, "stream": False, "messages": [{"role": "user", "content": prompt}],
                "options": {"temperature": 0, "seed": 42, "num_ctx": 4096}}
        if json_mode:
            body["format"] = "json"
        t = time.time()
        req = urllib.request.Request("http://localhost:11434/api/chat", json.dumps(body).encode(),
                                     {"Content-Type": "application/json"})
        reply = json.load(urllib.request.urlopen(req, timeout=900))["message"]["content"]
        self.log.append({"role": role, "chars_in": len(prompt), "chars_out": len(reply), "secs": time.time() - t})
        return reply

def final_answer(model, notes: str) -> str:   # the "lead" call that sees the brief + every worker's note
    return model.ask("lead", f"{BRIEF}\nEnd with one line: ANSWER: <company name>\n\n{notes}")

def single(model, letters):
    return model.ask("single", f"{BRIEF}\nEnd with one line: ANSWER: <company name>\n\n" + "\n\n---\n\n".join(letters))

def workers(model, letters, subtask=FULL_SUBTASK):
    notes = [model.ask("worker", f"{subtask}\n\n{doc}", json_mode=True) for doc in letters]
    return final_answer(model, "Notes from the people who read each letter:\n" + "\n".join(notes)), notes

def workers_code(notes):                      # no model call: Python applies the user's rule
    rows = [json.loads(n) for n in notes]
    ok = [r for r in rows if not r.get("has_bond")]
    best = max(ok, key=lambda r: int(r.get("fixed_pay_per_year", 0)) + int(r.get("joining_bonus", 0)))
    return f"ANSWER: {best['company']}"

def picked(answer: str, companies):           # which company the ANSWER line names
    line = (re.findall(r"ANSWER:\s*(.+)", answer) or [""])[-1].lower()
    hits = [c for c in companies if c.lower() in line]
    return hits[0] if len(hits) == 1 else None

if __name__ == "__main__":
    data = pathlib.Path(__file__).parent / "data"
    truth = json.loads((data / "truth.json").read_text())
    model = Ollama()
    score = {"single": 0, "workers": 0, "workers+code": 0, "lossy": 0}
    calls = {k: [] for k in score}
    transcripts = []
    for t in truth:
        letters = json.loads((data / f"case{t['case']}.json").read_text())["letters"]
        runs = {}
        n = len(model.log); runs["single"] = single(model, letters); calls["single"] += model.log[n:]
        n = len(model.log); runs["workers"], notes = workers(model, letters); calls["workers"] += model.log[n:]
        calls["workers+code"] += model.log[n:n + 3]   # it reuses the same 3 worker calls
        runs["workers+code"] = workers_code(notes)
        n = len(model.log); runs["lossy"], lossy_notes = workers(model, letters, LOSSY_SUBTASK); calls["lossy"] += model.log[n:]
        transcripts.append({"case": t["case"], "answers": runs, "notes": notes, "lossy_notes": lossy_notes})
        print(f"case {t['case']} (right answer: {t['answer']})")
        for k, ans in runs.items():
            p = picked(ans, t["companies"]); ok = p == t["answer"]; score[k] += ok
            print(f"  {k:<13} -> {p or 'no clear answer'} {'OK' if ok else 'WRONG'}")
        print("  worker notes:", " | ".join(n.replace("\n", " ") for n in notes))
        print("  lossy notes: ", " | ".join(n.replace("\n", " ") for n in lossy_notes))
        sys.stdout.flush()
    (data.parent / "transcripts.json").write_text(json.dumps(transcripts, indent=1))
    print("\ndesign        right  model calls  chars sent  biggest prompt  model seconds")
    for k in score:
        c = calls[k]
        print(f"{k:<13} {score[k]}/{len(truth)}   {len(c):>6}      {sum(x['chars_in'] for x in c):>8,}   "
              f"{max(x['chars_in'] for x in c):>10,}     {sum(x['secs'] for x in c):>8.0f}")
make_cases.py: how the 12 letters and the right answers are made

make_cases.py

# make_cases.py: writes 4 test cases x 3 invented offer letters + the right answer for each case.
# Companies and numbers are made up. Each case hides a trap: the biggest "Total CTC" is not the
# most guaranteed cash, or the best guaranteed offer has a service bond.
import json, pathlib

def inr(n: int) -> str:
    """Indian digit grouping: 2500000 -> 25,00,000."""
    s = str(n)
    if len(s) <= 3:
        return s
    head, tail = s[:-3], s[-3:]
    groups = []
    while len(head) > 2:
        groups.insert(0, head[-2:]); head = head[:-2]
    return ",".join([head] + groups + [tail]) if head else ",".join(groups + [tail])

# fixed = annual fixed pay; monthly=True writes it per month; var = target variable % of fixed;
# esop = grant value over 4 years; bond = (months, repay amount) or None
CASES = [
    [dict(co="Tealpath Systems", fixed=1800000, var=15, esop=800000),
     dict(co="Kestrel Pay", fixed=1920000, monthly=True, var=10, join=100000),
     dict(co="Quillbyte Labs", fixed=2100000, var=10, join=200000, bond=(24, 250000))],
    [dict(co="Marigold Health Tech", fixed=2400000, var=20),
     dict(co="Saffron Cloud", fixed=2250000, join=300000, split=True),
     dict(co="Copperleaf Data", fixed=2520000, monthly=True, join=50000, bond=(12, 150000))],
    [dict(co="Ondaline", fixed=1600000, esop=4000000),
     dict(co="Pinecrest Software", fixed=1900000, var=10),
     dict(co="Lotus Mobility", fixed=1750000, var=25, join=100000)],
    [dict(co="Indigo Rail Tech", fixed=1500000, monthly=True, join=200000, reloc=100000),
     dict(co="Brightfield Analytics", fixed=1650000, var=12),
     dict(co="Juniper Stack", fixed=1720000, bond=(18, 150000))],
]

def total_ctc(o):  # what the letter calls "Total CTC": fixed + target variable + yearly ESOP value
    return o["fixed"] + o["fixed"] * o.get("var", 0) // 100 + o.get("esop", 0) // 4

def guaranteed(o):  # what the user asked for: 12 months of fixed pay + joining bonus
    return o["fixed"] + o.get("join", 0)

def letter(o, style: int) -> str:
    L = [f"OFFER OF EMPLOYMENT: {o['co']}", f"Role: Software Engineer II (Backend), Bengaluru.", ""]
    if o.get("monthly"):
        L.append(f"Your fixed salary will be Rs {inr(o['fixed'] // 12)} per month, paid on the last working day of each month.")
    else:
        L.append(f"Fixed pay: Rs {inr(o['fixed'])} per annum, paid monthly.")
    if o.get("var"):
        L.append(f"Target variable pay: {o['var']}% of fixed pay, paid annually based on company and individual performance.")
    if o.get("esop"):
        L.append(f"Stock options: a grant valued at Rs {inr(o['esop'])} at the last funding round, vesting over 4 years with a 1-year cliff.")
    if o.get("join"):
        when = ("paid in two equal parts, with your first salary and after six months of service"
                if o.get("split") else "paid with your first salary")
        L.append(f"Joining bonus: Rs {inr(o['join'])}, {when}.")
    if o.get("reloc"):
        L.append(f"Relocation support: up to Rs {inr(o['reloc'])} against bills for travel and moving, reimbursed once.")
    L.append(f"Total CTC: Rs {inr(total_ctc(o))} per annum (includes target variable pay"
             + (" and the yearly value of stock options" if o.get("esop") else "") + ").")
    L.append("")
    filler = [
        "Leave: 24 days of paid leave per calendar year, plus 12 public holidays.",
        "Insurance: group health cover of Rs 5,00,000 for you, your spouse and two children.",
        "Notice period: 30 days during the six-month probation, 60 days after confirmation.",
    ]
    L += filler[style:] + filler[:style]          # same facts, different order per company
    if o.get("bond"):
        m, amt = o["bond"]
        L.append(f"Service agreement: you agree to serve a minimum of {m} months from your joining date. "
                 f"If you leave earlier, you will repay Rs {inr(amt)} to the company.")
    elif style != 2:
        L.append("There is no service agreement or bond attached to this offer.")
    L += ["", "Please sign and return this letter within 7 days to accept the offer."]
    return "\n".join(L)

if __name__ == "__main__":
    out = pathlib.Path(__file__).parent / "data"
    truth = []
    for i, case in enumerate(CASES, 1):
        docs = [letter(o, s) for s, o in enumerate(case)]
        allowed = [o for o in case if not o.get("bond")]
        best = max(allowed, key=guaranteed)
        top_ctc = max(case, key=total_ctc)
        (out / f"case{i}.json").write_text(json.dumps({"letters": docs}, indent=1))
        truth.append({"case": i, "answer": best["co"], "guaranteed_inr": guaranteed(best),
                      "highest_total_ctc": top_ctc["co"], "companies": [o["co"] for o in case]})
    (out / "truth.json").write_text(json.dumps(truth, indent=1))
    for t in truth:
        print(f"case {t['case']}: answer {t['answer']} (Rs {inr(t['guaranteed_inr'])} guaranteed); "
              f"highest Total CTC: {t['highest_total_ctc']}")

Running python3 make_cases.py prints the right answer for each case and the trap (the offer with the highest Total CTC):

Output

case 1: answer Kestrel Pay (Rs 20,20,000 guaranteed); highest Total CTC: Quillbyte Labs
case 2: answer Saffron Cloud (Rs 25,50,000 guaranteed); highest Total CTC: Marigold Health Tech
case 3: answer Pinecrest Software (Rs 19,00,000 guaranteed); highest Total CTC: Ondaline
case 4: answer Indigo Rail Tech (Rs 17,00,000 guaranteed); highest Total CTC: Brightfield Analytics

Then python3 multi_agent.py, with Ollama running and ollama pull qwen2.5:3b done. This is everything it printed before it stopped in case 4:

Output

case 1 (right answer: Kestrel Pay)
  single        -> Quillbyte Labs WRONG
  workers       -> Kestrel Pay OK
  workers+code  -> Tealpath Systems WRONG
  lossy         -> Quillbyte Labs WRONG
  worker notes: {"company": "Tealpath Systems", "fixed_pay_per_year": 1800000, "joining_bonus": 0, "has_bond": false} | {"company": "Kestrel Pay", "fixed_pay_per_year": 160000, "joining_bonus": 100000, "has_bond": false} | {   "company": "Quillbyte Labs",   "fixed_pay_per_year": 2100000,   "joining_bonus": 200000,   "has_bond": true }
  lossy notes:  {"company": "Tealpath Systems", "total_ctc": 2270000, "has_bond": false} | {"company": "Kestrel Pay", "total_ctc": 2112000, "has_bond": false} | {"company": "Quillbyte Labs", "total_ctc": 2310000, "has_bond": false}
case 2 (right answer: Saffron Cloud)
  single        -> Marigold Health Tech WRONG
  workers       -> Marigold Health Tech WRONG
  workers+code  -> Saffron Cloud OK
  lossy         -> Saffron Cloud OK
  worker notes: {"company": "Marigold Health Tech", "fixed_pay_per_year": 2400000, "joining_bonus": 0, "has_bond": false} | {"company": "Saffron Cloud", "fixed_pay_per_year": 2250000, "joining_bonus": 300000, "has_bond": false} | {"company": "Copperleaf Data", "fixed_pay_per_year": 210000, "joining_bonus": 50000, "has_bond": true}
  lossy notes:  {"company": "Marigold Health Tech", "total_ctc": 2880000, "has_bond": false} | {"company": "Saffron Cloud", "total_ctc": 2250000, "has_bond": false} | {"company": "Copperleaf Data", "total_ctc": 2520000, "has_bond": false}
case 3 (right answer: Pinecrest Software)
  single        -> no clear answer WRONG
  workers       -> Pinecrest Software OK
  workers+code  -> Pinecrest Software OK
  lossy         -> Ondaline WRONG
  worker notes: {"company": "Ondaline", "fixed_pay_per_year": 1600000, "joining_bonus": 400000, "has_bond": false} | {"company": "Pinecrest Software", "fixed_pay_per_year": 1900000, "joining_bonus": 209000, "has_bond": false} | {"company": "Lotus Mobility", "fixed_pay_per_year": 1750000, "joining_bonus": 100000, "has_bond": false}
  lossy notes:  {"company": "Ondaline", "total_ctc": 2600000, "has_bond": false} | {"company": "Pinecrest Software", "total_ctc": 2090000, "has_bond": false} | {"company": "Lotus Mobility", "total_ctc": 2187500, "has_bond": false}

The script prints its cost table at the end, which it never reached, so tally.py rebuilt it for the 3 finished cases. It rebuilds every prompt exactly from the same code and the worker notes above, and takes the time of each call from Ollama's own request log:

tally.py: how the table below was rebuilt

tally.py

# tally.py: the cost table for the 3 finished cases. Our run stopped in case 4 (the laptop ran out of disk),
# before multi_agent.py printed its table, so this rebuilds it: prompts are rebuilt exactly from the same
# code and the worker notes in run.out; call times come from Ollama's own request log, in call order.
import json, pathlib, re, sys
from multi_agent import BRIEF, FULL_SUBTASK, LOSSY_SUBTASK, picked

here = pathlib.Path(__file__).parent
out = (here / "run.out").read_text()
log = pathlib.Path(sys.argv[1]).read_text()      # ollama serve's log for that run

def secs(s):                                     # "6m7s" / "41.42s" -> seconds
    m = re.fullmatch(r"(?:(\d+)m)?([\d.]+)s", s)
    return int(m.group(1) or 0) * 60 + float(m.group(2))
times = [secs(t) for t in re.findall(r"\| 200 \|\s+(\S+) \|.*/api/chat", log)]

truth = json.loads((here / "data" / "truth.json").read_text())
blocks = re.split(r"^case \d+ ", out, flags=re.M)[1:]
lead = lambda notes: f"{BRIEF}\nEnd with one line: ANSWER: <company name>\n\n" + \
    "Notes from the people who read each letter:\n" + "\n".join(notes)
rows = {k: {"right": 0, "prompts": [], "secs": 0.0} for k in ["single", "workers", "workers+code", "lossy"]}
for t, block in zip(truth, blocks):
    letters = json.loads((here / "data" / f"case{t['case']}.json").read_text())["letters"]
    notes = re.search(r"worker notes: (.*)", block).group(1).split(" | ")   # printed with \n -> space: same length
    lossy = re.search(r"lossy notes:  (.*)", block).group(1).split(" | ")
    p = {"single": [f"{BRIEF}\nEnd with one line: ANSWER: <company name>\n\n" + "\n\n---\n\n".join(letters)],
         "workers": [f"{FULL_SUBTASK}\n\n{d}" for d in letters] + [lead(notes)],
         "lossy": [f"{LOSSY_SUBTASK}\n\n{d}" for d in letters] + [lead(lossy)]}
    p["workers+code"] = p["workers"][:3]
    tt, times = times[:9], times[9:]             # 9 calls per case: single, 3 workers + lead, 3 lossy + lead
    s = {"single": tt[0], "workers": sum(tt[1:5]), "workers+code": sum(tt[1:4]), "lossy": sum(tt[5:9])}
    for k in rows:
        rows[k]["prompts"] += p[k]; rows[k]["secs"] += s[k]
        rows[k]["right"] += bool(re.search(rf"^  {re.escape(k)}\s+-> .* OK$", block, re.M))
n = len(blocks)
print(f"{n} finished cases")
print("design        right  model calls  chars sent  biggest prompt  model seconds")
for k, r in rows.items():
    print(f"{k:<13} {r['right']}/{n}   {len(r['prompts']):>6}      {sum(map(len, r['prompts'])):>8,}   "
          f"{max(map(len, r['prompts'])):>10,}     {r['secs']:>8.0f}")

Output

3 finished cases
design        right  model calls  chars sent  biggest prompt  model seconds
single        0/3        3         7,601        2,747          800
workers       2/3       12        12,690        1,277         1265
workers+code  2/3        9        10,658        1,277         1069
lossy         1/3       12         9,167          919          931

What the run shows

DesignRight (of 3)Model callsCharacters sentBiggest single prompt
single037,6012,747
workers21212,6901,277
workers+code2910,6581,277
lossy1 (luck)129,167919

Read it as a demonstration on 3 cases, not a benchmark. Even so, each line of the output shows a different way a multi-agent system succeeds or fails.

1. One agent reading everything fell for every trap

The single call got 0 of 3. In case 1 it picked Quillbyte Labs, the offer with the bond. In case 2 it picked Marigold Health Tech, the offer with the biggest Total CTC (Rs 28,80,000, of which Rs 4,80,000 is variable pay). In case 3 its last line did not name one company. A 3B model holding three letters, a definition and a rule in one prompt mixed them up. Bigger models do much better at this, but the same thing happens to them at a larger scale: more documents, more rules.

2. Splitting the work helped, and cost more

Giving each letter to its own worker, with the user's full brief, got 2 of 3. Each worker's prompt was at most 1,277 characters instead of 2,747, so each one had less to confuse. With the full brief, the workers also caught both service bonds (Quillbyte Labs and Copperleaf Data, "has_bond": true).

The price: 4 times the model calls (12 vs 3) and 1.7 times the text sent (12,690 vs 7,601 characters), because the brief is repeated to every worker and the notes are sent again to the lead. That is the small version of Anthropic's "about 15× more tokens than chats". On our laptop the calls ran one after another, so it was also slower: 1,265 seconds of model time vs 800 (the timings are rough, the machine was busy with other work).

3. Each step makes its own kind of mistake

The two 2-of-3 scores are not the same 2 cases, and that is the most useful lesson here.

  • Workers misread numbers. Kestrel Pay pays Rs 1,60,000 per month. Its worker wrote "fixed_pay_per_year": 160000, forgetting to multiply by 12. In case 3, two workers invented joining bonuses that are not in the letters (Rs 4,00,000 for Ondaline, Rs 2,09,000 for Pinecrest Software).
  • Code trusts the notes. Because of the Kestrel Pay note, workers+code picked Tealpath Systems in case 1. It was right in cases 2 and 3, where the wrong numbers did not change the order.
  • The lead model does the maths badly. In case 2 the notes were all correct, Saffron Cloud Rs 22,50,000 + Rs 3,00,000 against Marigold Health Tech Rs 24,00,000, and the lead still picked Marigold.
  • A right answer can come from wrong numbers. In case 1 the lead picked Kestrel Pay, the right answer, although its notes said Kestrel's yearly fixed pay was Rs 1,60,000, which would make it the worst offer. We did not save the lead's reply text (see limits), so we cannot say how it got there. A score alone would have hidden this. Read the notes, not just the final line.

The fix for the first mistake is a check in code: a fixed pay under Rs 3,00,000 a year next to a letter that says "per month" should send the note back to the worker. The fix for the third is to never ask a model to do arithmetic code can do.

4. One lost detail broke the system, while every worker did its job

The lossy workers did exactly what they were asked: every total_ctc they reported matches the letter. But the question needs fixed pay and joining bonus, and those never left the workers. The lead picked the biggest Total CTC in case 1 (Quillbyte Labs, bonded) and in case 3 (Ondaline, whose Total CTC counts Rs 10,00,000 a year of stock options): exactly the trap the user asked to avoid. Its one "right" answer, Saffron Cloud in case 2, is the offer with the smallest Total CTC in its notes. No rule the user gave leads there from those notes, so we count it as luck.

There was a second loss we did not plan. The lossy subtask did not mention bonds as a deal-breaker, only as a field, and those workers reported "has_bond": false for both bonded offers. The workers that saw the user's full brief got both right. The same model, the same letter, a different instruction.

This is Cognition's first principle in action: share the context, not a summary of it. No amount of cleverness in the lead agent can recover a number the workers were never asked for.

How to design a multi-agent system that works

  1. Write the single-agent version first, and a test. A fixed set of inputs with known right answers, like our 4 cases. Without it you cannot tell whether a second agent helped.
  2. Split only along independent lines. One worker per document, per source, per file. If two workers must agree on something (a style, a schema, a date range), decide it first and give it to both.
  3. Pass the user's words down, not a summary. Every worker prompt should carry the original request and the definitions in it. A few hundred extra characters per worker is cheap next to a wrong answer.
  4. Make workers return structure. JSON with named fields, checked by code, not a paragraph. Then you can test each worker alone.
  5. Let code do what code can do. Arithmetic, filtering, sorting and rule checks belong in Python. Keep the model for reading messy text and writing.
  6. Cap the fan-out. Anthropic's research agent scales effort to the query: "Simple fact-finding requires just 1 agent with 3-10 tool calls", while "complex research might use more than 10 subagents". Their early versions spawned "50 subagents for simple queries". Put the limit in your code.
  7. Log every call, and save as you go. Role, input size, output size, time, and the full reply. Our script kept its log in memory and wrote the replies only at the end, so when the run stopped we lost them (see Honest limits). Write each call to disk the moment it returns.

Multi-agent frameworks in November 2026

You do not need one (the program above has none), but here is how the main frameworks map to the patterns. Status as of 21 November 2026.

FrameworkMulti-agent featurePatternStatus note
LangGraphWorkers wrapped as tools of a supervisor agent; or your own graphOrchestrator-workers, pipeline, anythingThe separate langgraph-supervisor package (last release 0.0.31, 19 November 2025) says "We now recommend using the supervisor pattern directly via tools"; its repo was archived on 20 September 2026
OpenAI Agents SDKHandoffs ("Handoffs allow an agent to delegate tasks to another agent") and agents as tools (Agent.as_tool())Router/handoff, orchestrator-workersIts docs separate "Allowing the LLM to make decisions" from "Orchestrating via code"
CrewAICrews of role-based agents with a sequential or hierarchical processPipeline, orchestrator-workersHierarchical needs a manager_llm or a custom manager_agent
Google ADKSequential, loop and parallel workflow agents, plus graph-based and dynamic workflowsPipeline, parallel, evaluator loopDocs moved to adk.dev
AutoGenGroup chats of agentsNetwork/swarmArchived on 20 November 2026; Microsoft names Microsoft Agent Framework as "the enterprise-ready successor to AutoGen"

Notice the trend in that last column: the dedicated "multi-agent" layers are being folded back into plain tool calling. A worker agent is increasingly just a tool that happens to call a model. Our LangGraph tutorial covers the graph side and our tool calling guide the tool side.

Multi-agent systems in AI courses (the classical meaning)

If you met the term in a syllabus, it probably means this. In classical AI, an agent is a program that perceives its environment and acts on it to meet its goals. A multi-agent system (MAS) is several such agents in a shared environment, where each one's actions change what the others see. The questions are about interaction: how do agents cooperate, compete, negotiate and agree?

IdeaIn plain wordsLLM-era version
AutonomyEach agent decides its own actions; nobody steps it throughAn agent loop that picks its own next tool
CommunicationAgents exchange structured messages (request, inform, propose, accept)JSON messages, handoffs, MCP and agent-to-agent protocols
CoordinationAvoiding clashes and duplicate work over shared resourcesAn orchestrator assigning subtasks
Negotiation and task allocationAgents bid for tasks; a manager awards each task to the best bid (the "contract net" idea)A router choosing a specialist
ConsensusAgents reach the same value from local information onlyVoting across several model answers

Classical examples: a fleet of warehouse robots sharing aisles, traffic signals that coordinate along a corridor, drones covering a search area, power-grid controllers balancing supply. These systems run on maths (game theory, graph theory, control) more than on language. If you want a full course on this side, NPTEL lists Introduction to Multi-Agent Systems from IIT Kanpur (Prof. Twinkle Tripathy, under Electrical Engineering).

The two traditions meet in one place: the hard part is always what each agent knows. Classical MAS research made it explicit with message protocols. LLM multi-agent systems often leave it implicit in prompts, which is why context loss is their top failure.

Multi-agent interview questions

  1. When would you not use a multi-agent system? When the subtasks depend on each other's decisions, when one context window holds everything, or when the cost of 4 to 15 times more tokens is not worth it. Start with one agent and a test.
  2. What is the difference between orchestrator-workers and a parallel pipeline? In a pipeline your code fixes the split in advance. In orchestrator-workers a model decides the subtasks at run time from the input.
  3. Handoff vs agent-as-tool? A handoff passes the conversation to another agent, which then talks to the user. An agent used as a tool returns its result to the caller, which stays in control.
  4. How do you stop context loss between agents? Pass the original request and its definitions to every worker, return structured outputs, and share the decisions that other agents depend on. Then test it: our lossy run is a failure you can reproduce.
  5. How do you evaluate a multi-agent system? End to end on a fixed test set with known answers, and each agent on its own. Track accuracy, number of model calls, tokens and time per design, like the table in this guide.
  6. Why do multi-agent systems fail? The MAST study groups 14 failure modes into system design issues, inter-agent misalignment and task verification. In practice: unclear roles, lost or conflicting information between agents, and nobody checking the final answer.

Honest limits

  • 3 cases is tiny. We generated 4 cases, and the run stopped during case 4 when our disk guard shut the model server down (the laptop's swap had filled the disk). We report the 3 finished cases and did not re-run, because a repeat run hit the same disk limit. One flip changes a score by a third. The patterns in the notes matter more than the scores.
  • We did not save the model's full replies. multi_agent.py writes transcripts.json only at the end, so the stopped run lost the lead and single replies. The case lines, the worker notes and the call log survived. That is why we can't explain the lucky answers. Save after every case: our own advice in step 7 above.
  • The cost table was rebuilt, not printed. tally.py rebuilds every prompt with the same code and the worker notes printed in the output (exact character counts), and takes call times from Ollama's request log in call order. Times are rough: the laptop CPU was shared with other jobs, and a worker call took anywhere from 39 seconds to 4 minutes.
  • One small model. qwen2.5:3b at temperature 0. Larger models make fewer arithmetic and reading mistakes, so all four designs would likely score higher. The structural failure, a worker never asked for the number the question needs, does not depend on model size.
  • A fixed orchestrator. Our "lead" always made three workers, and we wrote the lossy subtask by hand. A real orchestrator model writes its own subtasks, sometimes well and sometimes lossily. That makes the failure less predictable, not less likely.
  • Invented data. The companies, letters and numbers are made up. Real offer letters are longer and messier.
  • Quotes and statuses come from the sources below, read on 21 November 2026. Framework details change quickly; check the docs before you build.

Frequently asked questions

What is a multi-agent system in AI?

A multi-agent system is a program where several AI agents work on one job. Each agent is a model call with its own instructions, tools and view of the information, and code or a lead agent splits the work, hands out the pieces and combines the results. In classical AI the term means several autonomous agents sharing an environment and coordinating, such as robot teams or traffic signals.

What are some examples of multi-agent systems?

LLM examples: a research system where a lead agent sends subagents to search different sources in parallel (Anthropic's research feature works this way), a support system where a triage agent hands billing and technical questions to specialists, and a coding setup where one agent writes code and another reviews it. Classical examples: warehouse robots sharing aisles, coordinated traffic signals, drone search teams and power-grid controllers.

What are the main multi-agent architecture patterns?

Six cover almost everything: one agent with tools (the baseline), a pipeline where each agent's output feeds the next, a router or handoff to one specialist, parallel agents (splitting the work or voting), orchestrator-workers where a lead agent decides the subtasks at run time, and an evaluator-optimizer loop where one agent drafts and another grades.

Are multi-agent systems better than a single agent?

Only when the work splits into independent parts. Anthropic reports its multi-agent research system beat a single agent by 90.2% on its internal research eval, while using about 15 times the tokens of a chat. In our small test, one worker per offer letter got 2 of 3 cases right where a single agent got 0 of 3, for 4 times the model calls and 1.7 times the text sent. When work depends on shared decisions, as in most coding, a single agent with full context is usually safer.

Why do multi-agent systems fail?

The study Why Do Multi-Agent LLM Systems Fail? (arXiv 2503.13657) found 14 failure modes in 3 groups: system design issues, inter-agent misalignment and task verification. The most common practical cause is lost context: a worker gets a summary of the task instead of the user's words and solves the wrong problem.

Which framework should I use to build a multi-agent system?

You can build one in plain Python, as this guide does. If you want a framework: LangGraph now recommends building a supervisor as an agent whose tools are the worker agents, the OpenAI Agents SDK has handoffs and agents as tools, CrewAI has sequential and hierarchical crews, and Google ADK has sequential, parallel and loop workflows. AutoGen was archived on 20 November 2026, with Microsoft Agent Framework named as its successor.

Crio AI Engineering

Build agents that work outside a demo

Crio's AI Engineering program is project-first: you build LLM apps, RAG pipelines and tool-using agents, then learn to evaluate, secure and ship them. Talk to the team about whether it fits you.

Sources

  1. How we built our multi-agent research system (90.2%, 4x and 15x tokens, 80% of variance), 13 June 2025 · Anthropic
  2. Building effective agents (workflows vs agents, five workflow patterns), 19 December 2024 · Anthropic
  3. Don't Build Multi-Agents (Walden Yan, two principles, Flappy Bird example), 12 June 2025 · Cognition
  4. Why Do Multi-Agent LLM Systems Fail? (Cemri et al., arXiv 2503.13657 v3, 26 October 2025) · arXiv
  5. OpenAI Agents SDK: handoffs · OpenAI
  6. OpenAI Agents SDK: agent orchestration (LLM-led vs code-led, agents as tools) · OpenAI
  7. langgraph-supervisor-py (supervisor via tools recommended; archived 20 September 2026) · LangChain
  8. CrewAI processes: sequential and hierarchical · CrewAI
  9. Google ADK workflows · Google
  10. microsoft/autogen README (archived; Microsoft Agent Framework is the successor) · Microsoft
  11. NPTEL: Introduction to Multi-Agent Systems (IIT Kanpur) · NPTEL
  12. Ollama API: /api/chat, format json, options · Ollama

The experiment ran on 21 November 2026 with Python 3 (standard library only) and Ollama 0.24.0 serving qwen2.5:3b (temperature 0, seed 42, 4,096-token context) on a laptop CPU. The run finished 3 of 4 cases. The case output is exactly what multi_agent.py printed; the cost table was rebuilt by tally.py from the same prompts and Ollama's request log. The companies and offer letters are invented. Sources were read on 21 November 2026.

Last updated: