Concept 1What is an LlmAgent class?
02b-multi-agent-workflow · Art #2b

In ADK, an agent is a declarative blueprint (LlmAgent):

  • Identity (name & description): in a multi-agent system, the parent agent reads each child's description to decide who gets the task!
  • Brain (model): decoupled model identifier (e.g. gemini-2.5-flash).
  • Behavior (instruction): system prompt supporting live {state_key} interpolation.
  • Tools and helpers (tools and sub_agents): supporting the agent in doing its tasks.
adk_agent_app/agent.py (Branch 02b-multi-agent-workflow)
from google.adk.agents import LlmAgent
root_agent = Agent(
name="Gatekeeper",
model="gemini-2.5-flash",
description="Root agent for the Sosta app",
instruction="""
You are the welcoming Gatekeeper of the Sosta app.
1. Greet the user politely and ask if they are already registered.
2. IF YES: Ask for their User ID and use 'is_registered_user_tool'
to check it.
- If it exists, transfer them to the 'Cameriere'.
- If not, inform them there was an error and ask to try again.
3. IF NO: Ask if they want to register.
- If yes, transfer them to the 'Registratore'.
- If no, politely say goodbye and end the conversation.
""",
tools=[is_registered_user_tool],
sub_agents=[registratore_agent, cameriere_agent]
)