Skip to main content
Multi-agent systems in AMAS allow you to build complex AI applications by coordinating multiple specialized agents. Instead of one agent handling everything, you distribute tasks across agents with specific capabilities.

Why Use Multiple Agents?

Specialization

Each agent focuses on a specific task (research, analysis, writing) leading to better results

Modularity

Update or replace individual agents without affecting the entire system

Scalability

Add new capabilities by adding new specialized agents

Maintainability

Simpler prompts and configurations per agent make systems easier to debug and improve

Architecture Types

AMAS supports multiple architectures for coordinating agents:

Supervisor Architecture

A central supervisor agent coordinates and routes tasks to specialized worker agents.
Use when:
  • You need dynamic task routing based on request content
  • Your system handles multiple domains (e.g., research + analysis + writing)
  • The routing logic is complex and benefits from LLM decision-making
Learn more: Supervisor Pattern →

Workflow Architecture

Explicit edges define the exact flow of execution between agents.
Use when:
  • You have a predefined sequence of steps
  • You need deterministic, repeatable workflows
  • You want precise control over execution order
Learn more: Sequential Patterns →

Key Concepts

Structured Output

Agents can produce typed, validated data that subsequent agents consume. This enables reliable data passing between agents.
Learn more: Structured Output →

Agent Communication

Agents access previous agents’ outputs using template variables in their prompts:

Conditional Routing

In workflow architecture, you can add dynamic routing based on agent outputs. There are two types: Literal routing — choose from a list of agents:
Boolean routing — binary yes/no decisions:
Conditional edges use an LLM-based evaluation system (BAML structured output) with automatic retry logic to ensure reliable routing decisions. Learn more: Conditional Edges →

Common Patterns

Research → Analysis → Writing Pipeline

Sequential workflow where each agent builds on the previous:

Classification → Routing → Specialized Handling

Supervisor dynamically routes to specialists:

Quality Gate with Revision Loop

Workflow with conditional routing for quality checks:

Best Practices

Use structured output for data passing: Define clear schemas for agent outputs that subsequent agents depend on. This ensures type safety and validation.
Keep agents focused: Each agent should have a single, well-defined responsibility. Don’t create “do everything” agents.
Test agents individually: Validate each agent works correctly before integrating into multi-agent systems.
Avoid circular dependencies: Don’t create loops where agents depend on each other’s outputs without a clear exit condition.
Use descriptive agent names: Name agents by their role (e.g., sentiment_analyzer, content_writer) not generic names like agent_1.

What’s Next?

Sequential Patterns

Build linear multi-agent pipelines with structured data passing

Supervisor Pattern

Coordinate agents with dynamic routing and task delegation

Conditional Edges

Add dynamic routing logic to your workflows

Structured Output

Generate typed, validated data for agent-to-agent communication