Skip to main content
A Team composes multiple agents under a leader that orchestrates their execution. The leader gets auto-injected tools for delegation and task management. No manual wiring needed.
from definable.agent import Agent
from definable.agent.team import Team, TeamMode

researcher = Agent(model="gpt-4o", instructions="You are a research specialist.")
writer = Agent(model="gpt-4o", instructions="You are a technical writer.")

team = Team(
    name="content-team",
    model="gpt-4o",
    members=[researcher, writer],
    mode=TeamMode.coordinate,
    instructions="Produce well-researched technical content.",
)

result = await team.arun("Write an article about quantum computing.")
print(result.content)

Execution Modes

ModeBehaviorBest for
coordinate (default)Leader picks members, crafts targeted tasks, synthesizesComplex tasks requiring judgment about which specialists to involve
routeLeader routes to a single specialist, returns their response directlyClassification and dispatch (support tickets, query routing)
collaborateAll members execute in parallel, leader synthesizesMultiple perspectives (analysis, brainstorming, review)
tasksLeader decomposes goal into task list, delegates autonomouslyMulti-step projects with dependencies between subtasks

Guides

Build Teams

Create teams with members and execution modes.

Run Teams

Execute teams and handle responses.

Delegation

How the leader delegates to members.

Usage Examples

Coordinate Team

Leader picks members and synthesizes.

Route Team

Classify and dispatch to a single specialist.

Collaborate Team

All members in parallel, leader merges.

Tasks Team

Autonomous task decomposition and delegation.

Resources