A multi-agent system uses multiple agents with different responsibilities to work on one larger goal.

Instead of one agent doing everything, work is divided among specialized agents.

Simple example

Goal:

Review a backend pull request.

Possible agents:

flowchart TB
    A["Coordinator"] --> B["Code review agent"]
    A --> C["Security agent"]
    A --> D["Test agent"]
    B --> E["Combined result"]
    C --> E
    D --> E

Why use multiple agents?

It can help when:

Common coordination patterns

Coordinator and specialists

One coordinator divides the task, sends work to specialist agents, and combines the results.

Parallel workers

Several agents perform independent tasks at the same time.

Example:

Research API options
Research database options
Research security requirements

Reviewer pattern

One agent creates a result, and another checks it against clear criteria.

Shared state and handoffs

Agents need a structured way to communicate:

{
  "task": "Check authorization in order routes",
  "findings": [
    {
      "file": "orders.js",
      "issue": "Ownership is not checked",
      "severity": "high"
    }
  ]
}

Structured handoffs are more reliable than sending a long, unorganized chat transcript.

The coordinator should track:

More agents do not automatically mean better results

Multi-agent systems add:

For many tasks, one agent with good tools is simpler and better.

When not to use multiple agents

Avoid them when:

Start with the simplest design. Add agents only when specialization or parallel work produces measurable improvement.

Security rules

Each agent should receive only:

A report-writing agent should not receive a payment tool.

A multi-agent system is a team of specialized AI workers. Use it only when dividing the work is clearer and more valuable than using one capable agent.