Documentation Index
Fetch the complete documentation index at: https://docs.definable.ai/llms.txt
Use this file to discover all available pages before exploring further.
Build a team where the leader selects which members to delegate to based on the task.
Create the team
import asyncio
from definable.agent import Agent
from definable.agent.team import Team, TeamMode
researcher = Agent(
model="gpt-4o",
instructions="You are a research specialist. Find facts, data, and sources.",
)
writer = Agent(
model="gpt-4o",
instructions="You are a technical writer. Write clear, well-structured content.",
)
editor = Agent(
model="gpt-4o",
instructions="You are an editor. Polish prose, fix errors, improve clarity.",
)
team = Team(
name="content-team",
model="gpt-4o",
members=[researcher, writer, editor],
mode=TeamMode.coordinate,
instructions="Produce well-researched, polished technical articles.",
)
async def main():
result = await team.arun("Write a 500-word article about AI agents in production.")
print(result.content)
asyncio.run(main())
Export your API key
export OPENAI_API_KEY=sk-***
Run
python coordinate_team.py
The leader delegates to the researcher first, passes findings to the writer, then sends the draft to the editor.