P

Multi Agent System: Definition and Examples

A Multi Agent System is an architecture where multiple autonomous AI agents collaborate, coordinate, and communicate with each other to solve complex tasks that a single agent could not accomplish effectively.

Full definition

A Multi Agent System (MAS) refers to a set of intelligent agents that interact within a shared environment. Each agent has its own capabilities, goals, and knowledge, and can act autonomously while coordinating with others. This approach is inspired by distributed systems and collective intelligence observed in nature.

In the context of generative AI and prompt engineering, a multi-agent system typically involves multiple instances of language models (LLMs) that assume specialized roles. For example, one agent may act as a researcher, another as a writer, and a third as a critic. Each agent receives a distinct system prompt that defines its expertise, responsibilities, and rules for communicating with other agents.

The main benefit of a MAS lies in decomposing complex problems. Rather than asking a single LLM to handle everything — research, analysis, writing, verification — these responsibilities are distributed among specialized agents. This leads to more reliable results, as each agent can focus on what it does best, while benefiting from the work of others.

Multi-agent architectures vary widely: some are hierarchical (an orchestrator agent delegates to others), others are collaborative (agents negotiate among peers), and still others are competitive (agents propose competing solutions that an arbiter evaluates). Frameworks like AutoGen, CrewAI, or the Claude Agent SDK now facilitate the implementation of these systems.

Etymology

The term 'Multi Agent System' originates from distributed artificial intelligence research in the 1980s. The word 'agent' comes from the Latin 'agens' (one who acts). The concept first developed in robotics and simulation, before being massively adopted in the LLM domain from 2023 onwards with the emergence of projects like AutoGPT and BabyAGI.

Concrete examples

Content creation with cross-review

You are part of a 3-agent system. Agent 1 (Writer): writes a blog post on the given topic. Agent 2 (Editor): improves style, clarity, and structure. Agent 3 (Fact-checker): verifies factual claims and flags errors. You are Agent 2. Here is the text produced by Agent 1: [TEXT]. Improve it while keeping the original tone.

Code analysis by specialized agents

You are a 'Security Reviewer' agent in a multi-agent code review system. Other agents handle performance and readability. Focus solely on security vulnerabilities (SQL injection, XSS, secret management). Analyze the following code and produce a structured report with severity level for each finding.

Structured debate for decision-making

Simulate a multi-agent system with 3 perspectives on the following question: 'Should we migrate our monolith to microservices?' Agent A defends the migration, Agent B defends the status quo, Agent C is a neutral mediator who summarizes. Each agent argues in 3 points, then Agent C produces a final recommendation.

Practical usage

In prompt engineering, you can simulate a multi-agent system within a single prompt by assigning distinct roles and structuring the exchanges between them. For more advanced cases, use frameworks like CrewAI or the Claude Agent SDK to orchestrate real autonomous agents. The key is to clearly define responsibilities, communication formats, and validation criteria between agents.

Related concepts

AI AgentOrchestrationChain of ThoughtTool Use

FAQ

What is the difference between a multi-agent system and a simple chatbot?
A classic chatbot is a single agent that responds to queries. A multi-agent system involves multiple specialized agents that collaborate, each with a distinct role and set of skills. This allows for handling more complex tasks with better quality, as each agent focuses on its area of expertise.
Can one create a multi-agent system with a single language model?
Yes, it is entirely possible. You can simulate multiple agents within a single prompt by assigning them different roles and structuring their interactions. You can also make multiple API calls to the same model with different system prompts for each agent. The key is the clear separation of responsibilities.
What are the main challenges of a multi-agent system?
The main challenges include coordination between agents (avoiding infinite loops or contradictions), cost management (each agent consumes tokens), clear role definition to avoid redundancies, and setting up a conflict resolution mechanism when agents produce divergent results.

See also

How to use this prompt

  1. Copy the prompt with the button above.
  2. Paste it into ChatGPT, Claude or your favorite AI assistant.
  3. Replace the bracketed variables with your details, then refine the result.

About Prompt Guide

Prompt Guide is a free library of 2500+ ready-to-use prompts for ChatGPT, Claude and other AIs, with guides to learn prompting and tools to build and optimize your own prompts.

More definitions

Get new prompts every week

Join our newsletter.