Google ADKgoogle-adk · Python 3.10+
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
14 small wins to finish your pathNext lesson

Sub agents

An agent can have other agents underneath it. The parent decides who handles what.

python
from google.adk.agents.llm_agent import Agent

billing = Agent(
    model="gemini-flash-latest",
    name="billing",
    description="Handles invoices, refunds and payment problems.",
    instruction="You answer billing questions only.",
)

technical = Agent(
    model="gemini-flash-latest",
    name="technical",
    description="Handles bugs, errors and setup problems.",
    instruction="You answer technical questions only.",
)

root_agent = Agent(
    model="gemini-flash-latest",
    name="root_agent",
    instruction="Route the user to the right specialist.",
    sub_agents=[billing, technical],
)
Delegation runs on description
The parent chooses a sub agent by reading its description. Two vague descriptions mean work goes to the wrong one, and it will look like a model problem when it is a wording problem.

Every expert started right here.