Building Agents with Google ADK 2.0
Google ADK 2.0
Build agents, tools and multi-step workflows with Google ADK 2.0, then evaluate them.
- Prerequisites
- Python and HTTP APIs.
- Duration
- about 6 hours of reading
- Cost
- Free, no sign-up
What you'll learn
- Define an ADK agent with function tools, run it from Python with a Runner and session service, and read its event stream.
- Connect an agent to MCP servers with McpToolset, validate typed function arguments and require confirmation for writes.
- Persist session state and long-term memory across turns, and guard model and tool calls with callbacks and plugins.
- Build graph workflows with conditional edges, pause one for human approval with RequestInput and delegate to sub-agents.
- Score an agent's tool trajectory and final response with AgentEvaluator before you change it.
Lessons
Module 1 · 6 lessonsAgents and tools
Build your first ADK agent with GeminiRead
Build a documentation assistant with Google ADK, understand its model and instructions, and run it from the terminal or development Web UI.
Run an agent and read its event streamRead
Use Python Runner to manage an ADK conversation, inspect model and tool events, select the final answer and handle streaming and model-call limits.
Give an agent typed function toolsRead
Give a Google ADK 2.0 agent typed function tools, validate every call with Pydantic before it runs, and require human approval for the tool that writes.
Connect an agent to MCP servers with McpToolsetRead
Attach a typed MCP server to a Google ADK 2.0 agent with McpToolset, expose only the tools it needs, read what reaches the model and catch a failed start.
Persist session state and long-term memoryRead
Persist Google ADK 2.0 sessions in SQLite with DatabaseSessionService, keep user state across restarts and recall earlier conversations with load_memory.
Guard model and tool calls with callbacks and pluginsRead
Guard a Google ADK 2.0 agent with a plugin that strips AWS key IDs before Gemini sees them and a callback that keeps a file tool inside its workspace.
Module 2 · 6 lessonsWorkflows and Evals
Build a graph workflow from nodes and edgesRead
Build a release-notes workflow with function nodes, a typed agent node and a deterministic check that every commit reaches the output.
Route a workflow with conditional edgesRead
Route documentation build logs with Python, use a default edge for incomplete runs and ask an agent for link suggestions only when needed.
Pause a workflow for human approvalRead
Pause a migration workflow with the SQL attached, validate a reviewer decision and resume the same session to apply or reject the change.
Build dynamic workflows in PythonRead
Review changed documentation pages with dynamic child nodes, deterministic lint checks and a bounded agent fix loop with retries and timeouts.
Delegate to sub-agents through a coordinatorRead
Build a documentation review team with a coordinator, two typed specialists and an event check that both delegations ran.
Evaluate an agent's tool trajectory and responseRead
Write evaluation cases for tool use and complete answers, run ADK AgentEvaluator and understand the limits of trajectory, ROUGE and judge scores.
Module 3 · 5 lessonsWorkflow patterns
Choose an ADK workflow patternRead
Compare ADK workflow patterns by dependencies, control and failure policy, then inspect the real lesson graphs without calling a model.
Generate and reviewRead
Build an ADK writer and reviewer that compare a release announcement with changelog facts, then enforce the typed verdict in code.
Iterative refinementRead
Refine a changelog line in an ADK 2.0 graph loop: a lint checks each draft, a back-edge sends problems to a reviser, and a state counter stops the loop.
Parallel fan-out and gatherRead
Run ADK 2.0 workflow branches in parallel and merge them with a JoinNode, then see one failed branch fail the graph and a dynamic parent keep the rest.
Hierarchical task decompositionRead
Build a depth-limited ADK AgentTool tree for an upgrade guide, check its source paths and share a model-call budget across nested runs.
