Agentic AI Notebook
Phase 16

Build an ADK Agent

~2 min read

Concept & How It Works

  • Key points are in the visual diagram above.

Learn these elsewhere (not covered in depth here)

  • ADK Workflows & Sub-Agents
  • Choosing a Framework — Phase 9

Why Does It Exist?

Google's kit is how Gemini-native teams ship agents without re-inventing orchestration on Vertex.

Real-World Analogy

A Gemini specialist with a toolkit and junior agents they can call, scheduled on Google's runtime.
Loading diagram...

Visual Workflows

What is Build an ADK Agent?

Loading diagram...

Example

Scenario

Coordinator agent with search tool and a 'refund' sub-agent. Runner.run(user_id, session_id, message).

Solution

In Google ADK, apply Build an ADK Agent to this scenario: Coordinator agent with search tool and a 'refund' sub-agent. Identify the inputs, run the technique, validate the output, and note one thing you would monitor in production.

Practice Task

Do this before moving to the next module — reading alone is not enough.

Open the Code Walkthrough below and run it locally. Change one parameter related to Build an ADK Agent (e.g. model, temperature, top_k, or tool name), observe the difference in output, and write 2–3 sentences explaining what changed.

Code Walkthrough

Highlighted lines show where Build an ADK Agent happens in the code.

Build an ADK Agent
1from google.adk.agents import LlmAgent  # import dependencies2from google.adk.runners import Runner  # import dependencies3
4refund = LlmAgent(name="refund", model="gemini-2.5-flash", instruction="Handle refunds only.")  # key line for Build an ADK Agent5root = LlmAgent(  # key line for Build an ADK Agent6    name="desk",7    model="gemini-2.5-flash",8    instruction="Route billing to refund. Else answer.",9    sub_agents=[refund],  # key line for Build an ADK Agent10    tools=[search_tool],11)12runner = Runner(agent=root)  # key line for Build an ADK Agent13# runner.run(user_id="u1", session_id="s1", new_message="refund order 99")

Commands to Remember

Commands to Remember

  • LlmAgent + Runner
  • sub_agents for specialists
  • Typed Python tools
  • Session id for memory

Common Mistakes

  • Copying a LangGraph into ADK 1:1
  • No session id

Cheat Sheet

Quick recap — the most important points from this module.

Cheat Sheet

quick ref
  • Gemini-native
  • Sub-agents not a graph
  • Session service
  • Start local