Skip to main content
Start simple: a model, team members, and instructions. Add functionality as needed.

Minimal Example

research_team.py
from agno.team import Team
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.tools.hackernews import HackerNewsTools
from agno.tools.yfinance import YFinanceTools

news_agent = Agent(
    name="News Agent",
    role="Get trending tech news from HackerNews",
    tools=[HackerNewsTools()]
)

finance_agent = Agent(
    name="Finance Agent",
    role="Get stock prices and financial data",
    tools=[YFinanceTools()]
)

team = Team(
    name="Research Team",
    members=[news_agent, finance_agent],
    model=OpenAIResponses(id="gpt-4o"),
    instructions="Delegate to the appropriate agent based on the request."
)

team.print_response("What are the trending AI stories and how is NVDA stock doing?", stream=True)

Team Modes

Teams default to coordinate mode (leader delegates and synthesizes). Set mode to change how the leader collaborates with members.
from agno.team.mode import TeamMode
from agno.models.openai import OpenAIResponses

team = Team(
    name="Language Router",
    members=[...],
    model=OpenAIResponses(id="gpt-4o"),
    mode=TeamMode.route
)
ModeConfigurationUse case
Coordinatemode=TeamMode.coordinate (default)Decompose work, delegate to members, synthesize results
Routemode=TeamMode.routeRoute to a single specialist and return their response directly
Broadcastmode=TeamMode.broadcastDelegate the same task to all members and synthesize
Tasksmode=TeamMode.tasksRun a task list loop until the goal is complete
Tasks mode runs an iterative task loop. Use max_iterations to cap how many cycles the leader can run.
from agno.models.openai import OpenAIResponses

team = Team(
    name="Ops Team",
    members=[...],
    model=OpenAIResponses(id="gpt-4o"),
    mode=TeamMode.tasks,
    max_iterations=6
)

Team Members

Each member should have a name and role. The team leader uses these to decide who handles what.
news_agent = Agent(
    name="News Agent",                              # Identifies the agent
    role="Get trending tech news from HackerNews",  # Tells the leader what this agent does
    tools=[HackerNewsTools()]
)
For better tracing, also set an id:
news_agent = Agent(
    id="news-agent",
    name="News Agent",
    role="Get trending tech news from HackerNews",
    tools=[HackerNewsTools()]
)
When both id and name are set on a member, team delegation uses id as the member identifier.

Nested Teams

Teams can contain other teams. The top-level leader delegates to sub-team leaders, who delegate to their members.
from agno.team import Team
from agno.agent import Agent

team = Team(
    name="Language Team",
    members=[
        Agent(name="English Agent", role="Answer in English"),
        Agent(name="Chinese Agent", role="Answer in Chinese"),
        Team(
            name="Germanic Team",
            role="Handle German and Dutch questions",
            members=[
                Agent(name="German Agent", role="Answer in German"),
                Agent(name="Dutch Agent", role="Answer in Dutch"),
            ],
        ),
    ],
)

Model Inheritance

Team members inherit the model from their parent team if not explicitly set.
from agno.team import Team
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
from agno.models.anthropic import Claude

# This agent uses its own model (Claude)
agent_with_model = Agent(
    name="Claude Agent",
    model=Claude(id="claude-sonnet-4-5"),
    role="Research with Claude"
)

# This agent inherits gpt-4o from the team
agent_without_model = Agent(
    name="Inherited Agent",
    role="Research with inherited model"
)

team = Team(
    name="Research Team",
    model=OpenAIResponses(id="gpt-4o"),  # Default for team and members without a model
    members=[agent_with_model, agent_without_model]
)

Callable Factories

Build dynamically configurable teams with Callable Factories. Agno framework supports the Callable Factory Pattern for Team configurations just as it does for individual Agents. This allows you to dynamically resolve team members, tools, and knowledge at runtime based on the specific session or user context. You can pass a function to the members, tools, or knowledge parameters of a Team. The framework uses signature inspection to inject the team instance and run_context.
from agno.team import Team
from agno.agent import Agent
from agno.models.openai import OpenAIChat

def get_team_members(team: Team, run_context: any):
    """
    Dynamic member factory: 
    Only include the 'Analyst' if the user is a premium user.
    """
    members = [Agent(name="Generalist", model=OpenAIChat(id="gpt-5"))]
    
    # Logic based on session/user metadata
    if run_context.user_id == "premium_user_123":
        members.append(Agent(name="Analyst", role="High-level data insights"))
        
    return members

# Initialize team with the factory function
agent_team = Team(
    name="Dynamic Team",
    members=get_team_members,  # Callable factory
    show_tool_calls=True,
    cache_callables=True       # Optional: Cache the result for the session
)

Callable Caching Settings

Callable factories can be cached per user or session, or by a custom key.
SettingPurpose
cache_callablesEnable or disable caching for callable factories
callable_tools_cache_keyCustom cache key for tools factory
callable_knowledge_cache_keyCustom cache key for knowledge factory
callable_members_cache_keyCustom cache key for members factory
Clear cached results when you need to force re-resolution:
team.clear_callable_cache(kind="tools")
Use aclear_callable_cache() in async code.

Team Features

Teams support the same features as agents:
FeatureDescription
InstructionsGuide the team leader on how to coordinate
ModeChoose the coordination strategy (coordinate, route, broadcast, tasks)
DatabasePersist session history and state
ReasoningEnable the leader to plan before delegating
KnowledgeGive the leader access to a knowledge base
MemoryStore and recall information across sessions
ToolsGive the leader tools to use directly
See the guides below to add these features.

Next Steps

TaskGuide
Run teamsRunning Teams
Control delegationDelegation
Add chat historyChat History
Manage sessionsSessions
Handle input/outputInput and Output
Add knowledgeKnowledge
Add guardrailsGuardrails

Developer Resources