Build

Agent teams

Agent.sub_agents, AgentTeam, and tools vs agents mode.

Prefer Agent(..., sub_agents=[...]).build() or AgentTeam.from_root(...). build() returns a TeamApp with chat, invoke, stream, usage, and with_thread. The fluent AgentTeam(...).add_agent(...) API remains for compatibility.

Tools mode (default)

The orchestrator is one agent. Each specialist is wrapped with subagent_as_tool. The specialist receives a rewritten query string — not the raw shared chat. Control always returns a tool result.

Agents mode

Orchestrator and specialists are sibling graph nodes. Delegation uses handoff tools that return Command(goto=..., graph=Command.PARENT). Prefer the same Agent.sub_agents shape — pass mode="agents" into build().

python
from convax_adk import AdkSettings, Agent, resolve_model

settings = AdkSettings()
settings.team_mode = "agents"
settings.return_to_parent = True

travel = Agent(
    name="travel_expert",
    description="Handle flight status.",
    system_prompt="Answer flight questions.",
    return_to_parent=True,
)
closer = Agent(
    name="closer",
    description="Give a final closing answer and end the turn.",
    system_prompt="Close the conversation clearly.",
    return_to_parent=False,
)

root = Agent(
    name="ops",
    description="Routes specialists.",
    system_prompt="Coordinate travel_expert and closer.",
    model=resolve_model(),
    sub_agents=[travel, closer],
)
app = root.build(settings=settings, mode="agents")
# Equivalent: AgentTeam.from_root(root, settings=settings, mode="agents").build()
  • return_to_parent=True — specialist finishes, edge back to orchestrator
  • return_to_parent=False — specialist finishes at END and keeps the last word

Orchestrator skills

Put orchestrator skills on the root agent via skills=..., or call team.set_orchestrator_skills(...) when using the fluent facade. Skills never auto-attach across agents.