Chapter 9 · Agent Team Basics: Collaboration Patterns
Learning objectives: Understand Agno Team's "leader-member" architecture, master the mechanisms and suitable scenarios for four collaboration modes — coordinate / route / broadcast / tasks — and build a researcher + writer two-member team from scratch.
9.1 Why You Need Teams
A single Agent's context and role definition are limited: asking it to research, write a report, and review simultaneously makes the prompt increasingly bloated and tools interfere with each other. Team splits tasks across multiple specialized Agents (members), with a leader model responsible for dispatch and synthesis — like a small team where everyone focuses on their own work and the lead takes responsibility for the final deliverable.
When NOT to use a Team
Each delegation in a Team is an independent model call, bringing higher latency, token cost, and coordination complexity. The official recommendation: if a single-domain task can be handled by one Agent, use a single Agent — don't go multi-agent just for the sake of it.
from agno.agent import Agent
from agno.team import Team
team = Team(
members=[
Agent(name="English Support", role="Answer customer questions in English"),
Agent(name="Chinese Support", role="Answer customer questions in Chinese"),
],
)9.2 Four Collaboration Modes
Agno specifies the mode explicitly via the mode parameter (import TeamMode from agno.team.mode). The four modes determine the leader's dispatch path:
| Mode | Config | Behavior |
|---|---|---|
| Coordinate (default) | mode=TeamMode.coordinate | Leader picks members, writes sub-tasks for each, then synthesizes results |
| Route | mode=TeamMode.route | Leader routes the request to one most-suitable member and returns that member's reply directly |
| Broadcast | mode=TeamMode.broadcast | Same task sent to all members, then all answers are aggregated |
| Tasks | mode=TeamMode.tasks | Leader maintains a shared task list, executing items one by one until the goal is reached |
Version note
Early versions used two boolean switches — respond_directly=True (equivalent to route) and delegate_to_all_members=True (equivalent to broadcast) — to express modes. The current recommendation is to use mode= uniformly; legacy flags remain compatible when mode is not set.
from agno.team import Team, TeamMode
router_team = Team(
name="Language Router",
members=[english_agent, chinese_agent],
mode=TeamMode.route,
determine_input_for_members=False, # Pass user's original words directly to members without leader rewriting
)Selection mantra: coordinate for decomposition+synthesis, route for classification forwarding, broadcast for multi-angle cross-verification, tasks for list-driven progress.
from agno.team import Team, TeamMode
# broadcast: same task to all members, then aggregate (old写法 delegate_to_all_members=True)
review_team = Team(
name="Multi-Perspective Review Panel",
model=model,
members=[lawyer, engineer, marketer],
mode=TeamMode.broadcast,
)
# tasks: leader maintains shared task list and advances item by item; suited for long-delivery chains
delivery_team = Team(
name="Delivery Team",
model=model,
members=[planner, developer, tester],
mode=TeamMode.tasks,
)9.3 How the Leader Dispatches
The full flow under coordinate mode:
- The Team receives the user input;
- The leader analyzes the input and decides which members to dispatch to;
- The leader writes specific sub-tasks for each selected member (not a simple forward);
- Members execute independently and return results (independent members can run concurrently);
- The leader synthesizes all outputs into the final reply.
The leader can also call tools directly or answer on its own (simple questions need not disturb members). Setting stable explicit ids on members aids dispatch tracking and debugging.
9.4 Hands-On: Researcher + Writer Two-Member Team
# research_writer_team.py
import os
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.team import Team, TeamMode
from agno.tools.duckduckgo import DuckDuckGoTools
model = OpenAIChat(
id="deepseek-chat",
api_key=os.getenv("DEEPSEEK_API_KEY"),
base_url="https://api.deepseek.com/v1",
)
researcher = Agent(
name="Researcher",
id="researcher",
role="Responsible for web research; output only facts and sources",
tools=[DuckDuckGoTools()], # Researcher's exclusive tool: search
)
writer = Agent(
name="Writer",
id="writer",
role="Responsible for turning research into fluent prose; does not fact-check",
)
team = Team(
name="Content Editorial Board",
model=model, # The leader also needs a model for dispatch and synthesis
members=[researcher, writer],
mode=TeamMode.coordinate,
instructions=[
"First dispatch the researcher to collect material, then hand the material to the writer for drafting.",
"Final output: an essay under 300 words with source citations.",
],
markdown=True,
)
team.print_response("Introduce the core value of the MCP protocol")After running, the logs show two phases: first the researcher's tool calls and returns, then the writer generating the article from the material, and finally the leader polishing the output.
9.5 Debugging and Cost Control
- See the dispatch chain: enable
debug_mode=Trueor inspect each member's independent response and metrics; confirm the leader dispatched to the right members; - Constrain instructions:
instructionsshould make clear "who goes first, what's the output"; vague instructions cause the leader to waver back and forth; - Control scale: 2–4 members is typical; for more roles consider nested Teams or the fixed orchestration in the next chapter's Workflow;
- Tier models: the leader can use a cheap fast model; heavy-lift members get stronger models on demand.
Chapter Summary
- Team = leader (dispatch/synthesis) + multiple specialized members (execution);本质 is trading extra model calls for separation of concerns;
TeamModefour modes: coordinate (decompose+synthesize), route (single-path forwarding), broadcast (all-members parallel), tasks (task-list driven); prefer explicitmode=declaration;- Coordinate flow: analyze → pick members → write sub-tasks → members execute concurrently → synthesize reply;
determine_input_for_members=Falselets user input pass through to members unchanged;- Don't use a Team for tasks a single Agent can handle — watch latency and token cost.
🧪 随堂测验
点击你认为正确的选项。答错时会展示正确答案与原因解析。
1. What is Agno Team's default collaboration mode?
2. To "send the same question to all members and aggregate diverse viewpoints", which mode should you use?
3. Regarding the trade-off between Team and a single Agent, which statement is correct?
4. In route mode, to pass the user's original input through without rewriting, which parameter?
🛠️ Hands-On Exercises
- Change the team from 9.4 to
routemode and add a "translator" member; observe how requests are routed to different members. - Use
broadcastmode to have three differently-styled members critique the same passage; compare how the leader synthesizes divergent opinions. - Give the researcher member a custom
@tooltool; verify that Team members can have different tool sets from the leader.
With basic collaboration patterns mastered, next chapter dives deeper into Team shared state and member communication: Chapter 10: Team Advanced; then Chapter 11 covers deterministic Workflow orchestration.