Skip to content

Fathom Layer / Practical guides

Building a multi-agent workflow with CrewAI and MCP

Read the context. Follow the sections. Find your next informed step.

Your reading route

Start at the beginning or jump to the section you need.

5 sections in this guide

A "swarm" is usually the wrong mental model. What works in production is a small, fixed set of specialised agents with defined hand-offs — a pipeline, not a crowd. CrewAI gives you the agent/task/crew structure; MCP gives every agent the same clean access to tools.

The architecture that holds up

   Planner ──► Researcher ──► Writer ──► Reviewer
      │            │            │           │
      └──────── shared MCP servers (search, files, DB) ────────┘

Each agent has: one role, one model, a bounded token budget, and access to only the MCP tools its job needs. Hand-offs pass structured data, not free text.

Why long-horizon swarms fail

95% per-step reliability over 10 steps → 0.95^10 ≈ 60% task success
99% per-step reliability over 10 steps → 0.99^10 ≈ 90%

Errors compound multiplicatively. More agents = more steps = lower success. The fix is fewer steps, verification sub-steps (a cheap model checks an expensive model's output), and bounded retries — not a bigger model.

Build order

  1. One agent, one tool, end to end. Get a single task working before you add a second agent.
  2. Add agents only at real hand-off points — where the output type genuinely changes (raw notes → draft → reviewed draft).
  3. Budget every agent. A hard token/step cap per run. An uncapped agent loop is your top cost incident.
  4. Scope MCP access per agent. The writer does not need shell access.
  5. Gate irreversible actions. Anything that writes to prod or sends a message prompts a human.

Local vs API

For the planner and reviewer, a mid-size local model (14–32B) is fine and keeps data in-house. The researcher, if it does hard synthesis, may warrant an API model. Route by need, not by default.

The rule

Start with a two-agent pipeline. Add a third only when you can name the specific hand-off it enables. If you're reaching for five agents, you're solving an orchestration problem you could solve with three well-scoped ones and better verification.

Inspect the references

External links recorded in this guide.

Links in the guide text and its source record are collected here. A publication or record update date does not establish when a claim was checked.

Read our evidence approach
0 external links

No external source links recorded in this guide.

Continue learning

All guides