In plain terms
A team is several AI agents working together — like a department instead of a single employee. One agent researches, another writes, a third reviews. A team coordinates them so the customer gets one polished answer. You choose how they cooperate:- Coordinate — a manager splits the work and merges the results (“you research, you draft, you edit”).
- Route — a receptionist sends each request to the right specialist (“billing question → billing agent”).
- Broadcast — ask everyone at once and combine their answers (good for second opinions).
- Collaborate — the agents discuss until they agree (for high-stakes decisions).
The analogy: one agent is an employee; a team is the org chart. You use a team when a job is too big or too varied for one specialist.Teams enable multiple agents to work together. Choose how tasks are distributed: an orchestrator can pick agents, route to the best one, broadcast to all, or run iterative collaboration rounds.
Multi-Agent Collaboration
Coordinate
An orchestrator model picks which member agent handles the task.
Route
Routes to the single best agent based on input.
Broadcast
Sends input to ALL agents and merges results.
Collaborate
Iterative rounds between agents (maxRounds configurable).
TeamMode
TeamConfig
string
required
Display name for the team.
TeamMode
required
How the team distributes work:
coordinate, route, broadcast, or collaborate.ModelProvider
required
The orchestrator model (for coordinate/route) or shared model for the team.
Array<Agent | A2ARemoteAgent>
required
Member agents. Remote A2A agents are allowed — the team treats them like local ones.
string
System instructions for the orchestrator (coordinate/route) or shared team context.
Record<string, unknown>
Starting
ctx.sessionState shared into member runs.StorageDriver
Storage for team session state.
number
Max collaboration rounds. Collaborate mode only. Ignored otherwise.
EventBus
Custom bus. Default: a private bus for this team. Emits
team.delegate.boolean
default:"true"
Put this team in the global registry (HTTP transport discovers it).
false for tests.UnifiedMemoryConfig
Shared memory. A member that has no
memory of its own uses this, so Researcher and Writer can see the same facts.Methods
SameRunOpts as agent.run() (sessionId, userId, tenantId, metadata, apiKey, signal, dependencies).
Getters:
name, mode, members, eventBus.
Basic Example
Next Steps
Coordinate Mode
Orchestrator picks which agent handles each task.
Route Mode
Route to the single best agent.
Broadcast Mode
All agents process; merge results.
Collaborate Mode
Iterative rounds between agents.