All posts
AI Agents
April 5, 202612 min read

Multi-Agent AI Systems: When They Work, When They Don't, and How to Architect Them

M

Moneeb Abbas

AI Systems Architect

Multi-agent systems are the most over-hyped and under-engineered pattern in AI right now. Teams reach for them too early — before they have even made a single-agent system reliable. But used correctly, in the right context, multi-agent architectures solve problems that single-agent systems genuinely cannot. This post is about the difference.

What Multi-Agent Actually Means

A multi-agent system is any architecture where more than one LLM call is used, with the output of one call influencing the inputs of others, and where the agents have some degree of autonomy over what to do next. That definition is broad on purpose — it covers everything from a two-step chain to a fully autonomous team of agents with shared memory and tool access.

The useful distinction is between orchestrated and emergent coordination:

  • Orchestrated: A central controller (the orchestrator) directs worker agents, decides what to run next, and aggregates results. Predictable, debuggable, and suitable for most production use cases.
  • Emergent: Agents communicate directly, negotiate tasks, and self-organize. Powerful in theory, fragile in practice. Avoid in production until you have mastered orchestrated patterns.

When Multi-Agent Is the Right Answer

Use a multi-agent architecture when at least one of these is true:

  1. 1Parallelism: The task can be decomposed into independent subtasks that benefit from concurrent execution. A research agent that summarizes 20 documents is 20x faster with parallel workers than a single sequential agent.
  2. 2Specialization: Different subtasks require genuinely different capabilities or tool access. A coding agent that writes code, a testing agent that validates it, and a documentation agent that explains it each need different context and tools.
  3. 3Context window limits: The full task context does not fit in a single prompt. Decomposing into subtasks with focused context windows can solve problems that hit the context limit in a monolithic design.
  4. 4Check-and-verify patterns: A second agent reviewing the first agent's output catches errors that the first agent cannot see in its own output — similar to code review.
Warning:If your reason for using multi-agent is 'to make the system more capable', that is not a good reason. A well-prompted single agent with the right tools is almost always more reliable than a poorly-designed multi-agent system. Start single-agent and migrate only when you hit a genuine limitation.

The Orchestrator-Worker Pattern

The most production-ready multi-agent pattern. The orchestrator receives the task, plans the execution, delegates to worker agents, and synthesizes results. Workers execute specific subtasks and return results to the orchestrator — they do not communicate with each other directly.

python
from langgraph.graph import StateGraph, END
from typing import TypedDict, Annotated
import operator

class ResearchState(TypedDict):
    query: str
    subtasks: list[str]
    results: Annotated[list[str], operator.add]
    final_report: str

def orchestrator(state: ResearchState) -> ResearchState:
    # Break the query into parallelizable subtasks
    plan = planner_llm.invoke(state["query"])
    return {"subtasks": plan.subtasks}

def worker(state: ResearchState, subtask: str) -> dict:
    # Each worker executes one focused subtask
    result = research_llm.invoke(subtask)
    return {"results": [result.content]}

def synthesizer(state: ResearchState) -> ResearchState:
    # Combine all worker results into a final report
    report = synthesis_llm.invoke({
        "query": state["query"],
        "findings": state["results"]
    })
    return {"final_report": report.content}

LangGraph vs CrewAI — When to Use Each

These are the two frameworks I use most often for production multi-agent systems. They solve different problems:

  • LangGraph: Explicit state machine — you define nodes, edges, and transitions. Full control over execution flow. Best for production systems where predictability and debuggability matter more than developer convenience. Harder learning curve, better outcomes.
  • CrewAI: Higher-level abstraction — define agents with roles and goals, and CrewAI manages the coordination. Best for prototyping and use cases where the agent interactions are genuinely role-based (like a team of specialists). Faster to start, harder to debug at the edges.
  • AutoGen: Microsoft's framework, strong for code generation and execution use cases. The conversational agent pattern (agents talking to each other) is well-implemented here.
  • Raw LangChain: For simple sequential chains, LangGraph is overkill. Plain LangChain LCEL is cleaner for linear pipelines with 2–3 steps.

The Failure Modes That Kill Production Agents

Every multi-agent production incident I have investigated traces back to one of these four failure modes:

  1. 1Agent loops: The agent calls a tool, misinterprets the result, calls the tool again, and gets stuck in an infinite loop. Fix: explicit step limits, loop detection, and circuit breakers on tool calls.
  2. 2Context accumulation: Each agent step appends to a growing context window. Long-running agents eventually overflow the context, causing degraded or nonsensical outputs. Fix: summarize intermediate results rather than appending raw tool outputs.
  3. 3Tool call hallucination: The agent invents tool calls with plausible-looking but invalid arguments. Fix: validate all tool inputs against a schema before execution; never pass LLM-generated inputs directly to external systems.
  4. 4Cascading errors: One agent produces a slightly wrong output; the next agent takes it as ground truth and amplifies the error. Fix: explicit validation checkpoints between agent handoffs; fail loudly rather than propagating bad state.
Tip:Add a maximum step count to every agent from day one. An agent that can run indefinitely will, eventually, get stuck in a loop and run up a large API bill or consume server resources until someone notices.

Evaluation Framework for Multi-Agent Systems

Multi-agent systems are harder to evaluate than single models because the failure can occur at any node. A useful evaluation framework has three levels:

  • Unit tests per agent: Test each agent in isolation with fixed inputs and expected output ranges. Catches regressions when models are updated.
  • Integration tests for common paths: Run the full pipeline on a representative sample of real inputs. Validate that the final output meets quality thresholds.
  • Trajectory evaluation: For each test run, log the full agent execution trace — every tool call, every intermediate output. Review these traces for unexpected behavior even when the final output is correct.

The trajectory review step is the one most teams skip and regret. A correct final answer achieved by an unexpected path is a sign of brittleness — the system got lucky this time and will fail on a slight variation of the same input.

Working on something similar?

I take on 1–2 new projects per month. If you have a use case that needs this kind of engineering, tell me about it.

Get in touch