Component | What It Does | Example |
Agents | Autonomous units that perceive, decide, and act | A planner, a researcher, a reviewer |
Roles and goals | Define what each agent is responsible for and what it is trying to achieve | "Find sources" for one agent, "check accuracy" for another |
Environment | The shared world agents act in and observe | A warehouse floor, a codebase, a document store |
Communication | How agents exchange information | Direct messages, a shared message board, or standard protocols |
Coordination | The logic that assigns work and resolves conflicts | An orchestrator, a voting rule, or an auction |
Memory | What agents remember, privately or in a shared store | A shared notebook, a vector database, saved summaries |
Tools | Actions an agent can take beyond reasoning | Web search, code execution, database queries, APIs |
LLM Guardrails and oversight | Limits and checks on agent behavior | Permission rules, budgets, human approval for risky steps |
Observability | Records of what each agent did and why | Traces, logs, and cost tracking |
Communication Between Agents
Communication is where multi-agent systems usually succeed or fail. Agents can pass messages directly, write to and read from a shared space known as a blackboard, or hand work along a pipeline.
Two open standards now cover much of this ground.
The Model Context Protocol, or MCP, standardizes how an agent connects to tools and data.
The Agent2Agent protocol, or A2A, standardizes how agents from different vendors and frameworks discover each other and exchange tasks.
Both are hosted by the Linux Foundation, and the foundation said in April 2026 that more than 150 organizations supported A2A, which had reached a stable 1.0 specification.
Architecture of Multi-Agent Systems
The multi-agent system architecture describes how agents are organised, how they communicate, and who decides what happens next. Not every system needs a central agent to manage the others.
The common multi-agent system architecture approaches include:
Centralized Architecture: A central agent assigns tasks, collects results, and makes decisions. The other agents focus on their assigned work.
Decentralized Architecture: Each agent makes its own decisions and communicates directly with other agents without relying on a central controller.
Hierarchical Architecture: Higher-level planning agents handle task distribution, while lower-level agents carry out specific tasks.
Hybrid Architecture: The system combines centralized and decentralized approaches. Some decisions are made centrally, while agents retain the freedom to handle individual tasks.
Different Types of Multi-Agent Systems
Multi-agent systems can be grouped in several ways. The table below sorts them by how the agents behave and how they relate to one another.
Type | Description | Example | Best For |
Reactive | Agents respond directly to what they sense, with simple rules and no long-term planning | Robots that avoid obstacles in a warehouse | Fast, simple behavior in predictable settings |
Deliberative (BDI) | Agents hold beliefs, desires, and intentions and plan before acting | A delivery agent that plans routes around promises it has made | Goal-driven tasks that need explicit reasoning |
Hybrid | Agents combine quick reactions with slower planning | An autonomous vehicle that brakes at once but also plans its route | Real-time systems that also need foresight |
Learning (multi-agent reinforcement learning) | Agents improve through trial and reward, often alongside other learners | Game-playing teams and traffic signal control | Dynamic environments where good rules are hard to write |
LLM-based | Each agent is a language model with its own instructions, tools, and memory | A research team of planner, searcher, and reviewer agents | Open-ended knowledge work, coding, and analysis |
Cooperative | Agents share a common goal and work toward it together | Robots moving a heavy object together | Tasks where the group succeeds or fails as one |
Competitive | Agents have opposing goals | Trading agents bidding against each other | Markets, negotiation, and security testing |
Mixed (cooperative and competitive) | Teams cooperate inside and compete between groups | Team-based games and supply chains with rival firms | Simulations of realistic economic settings |
Homogeneous | All agents have the same abilities | A swarm of identical drones | Scalable, interchangeable workers |
Heterogeneous | Agents have different skills and tools | A planner, a coder, and a tester | Tasks that need varied expertise |
Building a Multi-Agent System in Python
The example below follows the orchestrator-worker approach, one of the agentic design patterns used to coordinate multiple AI agents. A planner splits a goal into subtopics, three researcher agents work on them in parallel, their findings go to a shared memory, a writer drafts a summary, and a reviewer checks the draft.
If the reviewer finds something missing, the writer revises. The model call is a stand-in function, so the code runs with only the standard library.
Python Code Example
from concurrent.futures import ThreadPoolExecutor
# ---- 1. Stand-in for a language model call --------------------------------
# Replace this one function with a real model call to run the system for real.
def llm(role: str, task: str) -> str:
if role == "planner":
return "pricing | delivery | returns"
if role == "researcher":
facts = {
"pricing": "Plans start at 10 dollars a month.",
"delivery": "Standard delivery takes 3 to 5 days.",
"returns": "Returns are accepted within 30 days.",
}
return facts[task.strip()]
if role == "writer":
lines = [l for l in task.split("\n") if l.startswith("- ")]
if "FEEDBACK" not in task: # a first draft that forgets a topic
lines = lines[:-1]
return "Summary: " + " ".join(l[2:] for l in lines)
if role == "reviewer":
missing = [t for t in ("pricing", "delivery", "returns")
if {"pricing": "10 dollars", "delivery": "3 to 5 days",
"returns": "30 days"}[t] not in task]
return "APPROVE" if not missing else "REVISE: add " + ", ".join(missing)
return ""
# ---- 2. Agents and shared memory -------------------------------------------
class Agent:
def init(self, name: str, role: str):
self.name, self.role = name, role
def run(self, task: str, log: list) -> str:
result = llm(self.role, task)
log.append(f"{self.name}: {result}")
return result
planner = Agent("Planner", "planner")
researchers = [Agent(f"Researcher-{i + 1}", "researcher") for i in range(3)]
writer = Agent("Writer", "writer")
reviewer = Agent("Reviewer", "reviewer")
# ---- 3. The orchestrator ------------------------------------------------------
def run_system(goal: str, max_rounds: int = 3) -> str:
log, memory = [], {}
subtopics = [s.strip() for s in planner.run(goal, log).split("|")]
with ThreadPoolExecutor() as pool: # workers run in parallel
jobs = {t: pool.submit(a.run, t, log) for t, a in zip(subtopics, researchers)}
for topic, job in jobs.items():
memory[topic] = job.result() # shared memory (a blackboard)
notes = "\n".join(f"- {v}" for v in memory.values())
feedback = ""
for round_no in range(1, max_rounds + 1):
draft = writer.run(f"Write a summary.\n{notes}{feedback}", log)
verdict = reviewer.run(draft, log)
if verdict == "APPROVE":
print("\n".join(log))
return draft
feedback = f"\nFEEDBACK: {verdict}"
print("\n".join(log))
return "Escalate to a human: reviewer never approved."
final = run_system("Summarize our store policies for a new customer")
print("\nFINAL:", final)
A test run prints the message trace below. The researchers' lines can appear in a different order from run to run, because they work in parallel.
Planner: pricing | delivery | returns
Researcher-1: Plans start at 10 dollars a month.
Researcher-2: Standard delivery takes 3 to 5 days.
Researcher-3: Returns are accepted within 30 days.
Writer: Summary: Plans start at 10 dollars a month. Standard delivery takes 3 to 5 days.
Reviewer: REVISE: add returns
Writer: Summary: Plans start at 10 dollars a month. Standard delivery takes 3 to 5 days. Returns are accepted within 30 days.
Reviewer: APPROVE
FINAL: Summary: Plans start at 10 dollars a month. Standard delivery takes 3 to 5 days. Returns are accepted within 30 days.
This is a deliberately small multi agent system example, but its shape matches much larger ones: a planner, parallel workers, shared memory, and a reviewer with a limit on retries.
Moving to a Real System
To use real models, replace the llm function with a call to your provider's API, passing each agent's role as its system prompt. In practice, expect to add error handling, timeouts, token budgets, and logging for every message.
You can also assign different models to different agents, such as a stronger model for the planner and reviewer and a cheaper one for the researchers. Frameworks save effort once the system grows. LangGraph, CrewAI, the OpenAI Agents SDK, Microsoft Agent Framework, and Google's Agent Development Kit all support multi-agent patterns, and each offers its own tools for handoffs, shared state, and tracing.
Advantages and Limitations of Multi-Agent Systems
Multi-agent systems offer flexibility and shared problem-solving, but they also introduce challenges in coordination and communication.
Advantages | Limitations |
Specialist agents can each use a focused context and a small set of tools | Many agents mean many model calls, so costs and latency rise sharply |
Independent subtasks run in parallel, which shortens total time | Coordination adds complexity, and agents can misunderstand or contradict each other |
Work can exceed what one context window can hold | Errors can spread from one agent to the next |
A separate reviewer can catch mistakes the author misses | Debugging is harder because behavior comes from interactions, not a single prompt |
Parts can be swapped, upgraded, or scaled on their own | Results are less predictable, since agents are non-deterministic |
Failure of one agent need not stop the whole system, especially in decentralized designs | Security risks such as prompt injection can spread across agents through shared messages and external tool responses. |
Different models and vendors can be mixed | Not every task benefits, especially tightly coupled ones that need one shared context |
Mirrors how human teams divide work | Without good evaluation, it's hard to tell whether the extra agents help |
Why Multi-Agent Systems Fail
Researchers at UC Berkeley studied failures across several popular multi-agent frameworks and more than 200 task traces, and they grouped what they saw into 14 failure modes in three categories.
The first is specification problems, such as an agent ignoring its role or repeating steps.
The second is inter-agent misalignment, such as agents withholding information, ignoring each other's input, or drifting off the task.
The third is weak verification, such as stopping too early or checking the wrong things.
Their takeaway was that gains over single-agent setups are often small, and that many failures come from system design and not only from weak models. That matches practical experience: clear roles, structured handoffs, and real verification matter more than adding more agents.
Conclusion
True power in MAS is based on proper division, communication and coordination of actions among the agents. An increase in the number of agents is not necessarily an indicator of increased efficiency, since performance depends on good design and clear assignments of roles.
Work with one agent and add more where necessary. Focus on communication, dealing with errors, and constant testing.