02. AI Agent Fundamentals
Single-Agent vs Multi-Agent Systems
A single-agent system uses one policy loop with tools. A multi-agent system coordinates specialized agents with roles, handoffs, or parallel work. Start simple β add agents only when specialization clearly pays off.
What you will learn
- Define single-agent and multi-agent systems clearly
- Name common multi-agent topologies
- Decide when splitting into agents helps vs hurts
- Map CrewAI / AutoGen-style designs to patterns
- Answer interview questions with short, solid answers
Definition
A single-agent system has one decision-maker (one primary policy / LLM loop) that may use many tools and memory stores. A multi-agent system has two or more agents with distinct roles or policies that communicate to finish a shared goal.
Multi-agent is an organization pattern. Each member is still a classic type (often goal-based). Frameworks like CrewAI, AutoGen, or LangGraph graphs are ways to implement the pattern β not a reason to invent agents for every function.
Introduction
This lesson (#6 in AI Agent Fundamentals) follows Autonomous, Reactive and Proactive Agents. You know decision types and initiative; now you choose how many agents to run.
Default to a strong single agent. Split only when context, tools, or review quality demand hard boundaries.
Why the choice matters
- Extra agents multiply cost, latency, and failure modes
- Clear roles can improve quality (writer vs critic)
- Wrong split creates chatty handoffs and lost context
- Interviewers expect a reasoned default, not βalways multi-agentβ
Single-agent systems
One orchestrated loop: observe, reason, call tools, update memory, stop on goal. Tools and prompts may be large, but ownership stays with one controller.
- Strengths - simpler debugging, shared context, fewer race conditions
- Strengths - easier permissions and evals on one trace
- Limits - long prompts; role confusion; weak self-critique
- Best for - most MVPs, support bots, coding agents with one repo scope
Multi-agent systems
Multiple agents specialize β research, write, review, execute β and pass artifacts or messages. An orchestrator, graph, or protocol defines who speaks next.
- Router - dispatcher sends the task to one specialist
- Sequential crew - pipeline handoffs (research then draft then review)
- Parallel + merge - specialists work together, then aggregate or vote
- Hierarchical - manager agent plans; workers execute
- Needs - shared contracts for messages, state, and stop rules
When to stay single vs go multi
Let bottlenecks drive the split β not blog posts.
- Stay single when one domain and one tool belt suffice
- Add sequential agents when review quality needs a separate critic role
- Add a router when intents need different tools or policies
- Add parallel agents when exploration or diversity improves outcomes
- Avoid multi-agent when you only need helper functions β use tools instead
Trade-offs
- Cost / latency - multi-agent usually higher
- Quality - can rise with critique and specialization
- Debuggability - single traces are easier; multi needs correlation IDs
- Safety - more agents means more permission surfaces
- Coordination risk - deadlocks, ping-pong, duplicated work
Mapping to Agentic AI products
Many βmulti-agentβ demos are a single agent with prompt sections. True multi-agent means separate runnable policies with explicit handoffs.
- LangGraph / state graphs - encode single or multi topologies
- CrewAI-style roles - sequential or hierarchical crews
- AutoGen-style chat - conversational multi-agent
- MCP / tools - shared actuators; not automatically multi-agent
- Human-in-the-loop - often a required βagentβ in the graph
Program / implementation notes
Define message schemas, ownership of state, and who may call which tools before writing prompts.
- Give each agent a written job, inputs, outputs, and stop condition
- Share a global task ID across handoffs for tracing
- Prefer passing artifacts (docs, diffs) over endless chat transcripts
- Cap turns between agents to prevent ping-pong
- Next: Agent Environment, Perception and Decision-Making
Advantages and limitations
- Advantage (single): speed to ship and debug
- Advantage (multi): specialization and structured critique
- Advantage (multi): parallel exploration when it matters
- Limitation (multi): cost, complexity, and fragile coordination
- Limitation (single): may overload one context window / role
- Limitation (both): bad goals stay bad β topology will not save them
Key points
- Single-agent: one primary decision loop with tools.
- Multi-agent: multiple role-based agents with orchestration.
- Common patterns: router, sequential crew, parallel+merge, hierarchy.
- Default single-agent; split for clear specialization needs.
- Tools are not agents β do not multiply agents for every function.
- Contracts, traces, and turn caps make multi-agent operable.
FAQs
Is using many tools the same as multi-agent?
No. One agent can call many tools. Multi-agent means multiple decision-makers with roles and coordination, not just a large tool list.
When is a critic agent worth it?
When self-review in one prompt is weak and a separate review pass with a different rubric measurably improves quality.
Do multi-agent systems need different models?
Not required. Roles can share one model with different prompts/tools, or use different models for cost and skill fit.
What fails first in multi-agent designs?
Vague handoff contracts, missing stop rules, and uncorrelated logs that make failures hard to replay.
Interview questions
- Single-agent vs multi-agent systems?
Answer Single-agent uses one primary policy loop. Multi-agent coordinates two or more role-based agents through handoffs, routing, or parallel collaboration.
- When would you choose multi-agent?
Answer When specialization, hard role separation, routing across tool domains, or parallel critique clearly improves outcomes enough to justify cost and complexity.
- Name common multi-agent patterns.
Answer Router/dispatcher, sequential crew/pipeline, parallel specialists with merge, and hierarchical manager-worker.
- Are tools the same as agents?
Answer No. Tools are actuators a policy can call. Agents are decision-makers. Prefer tools inside one agent until roles truly need separation.
- What are the main risks of multi-agent systems?
Answer Higher cost and latency, coordination failures, permission sprawl, and harder debugging without shared trace IDs.
- How do frameworks like CrewAI or AutoGen fit?
Answer They implement multi-agent organization patterns (crews, chats, graphs). You still must design roles, contracts, and stop conditions.
- How would you migrate from single to multi-agent?
Answer Measure a bottleneck, extract one specialist behind a clear interface, keep shared task IDs, and compare quality/cost against the single-agent baseline.
Related topics
Practice task
Complete each numbered practice step in a notebook or doc before opening the next lesson.
- Write one-sentence definitions of single-agent and multi-agent systems.
- Sketch router, sequential, and parallel+merge from memory.
- For a research+blog workflow, argue single vs sequential crew in five bullets.
- List four contracts every handoff message should include.
- Answer interview questions 1, 3, and 5 in two sentences each.