Skip to main content

Google ADK Crash Course

A comprehensive tutorial series for learning Google’s Agent Development Kit (ADK) from zero to hero. Build flexible, model-agnostic AI agents with Google’s powerful framework, from simple text processing to advanced multi-agent orchestration patterns.
Updated for Gemini 3 Flash: All tutorials use the new Gemini 3 Flash model (gemini-3-flash-preview)

What is Google ADK?

Google ADK (Agent Development Kit) is a flexible and modular framework for developing and deploying AI agents. It’s optimized for Gemini but is model-agnostic and deployment-agnostic, making it compatible with other frameworks.

Flexible Orchestration

Define workflows using workflow agents or LLM-driven dynamic routing for sophisticated control.

Multi-Agent Architecture

Build modular applications with multiple specialized agents that collaborate seamlessly.

Rich Tool Ecosystem

Use pre-built tools, create custom functions, or integrate 3rd-party libraries like LangChain.

Model-Agnostic Design

Work with Gemini, OpenAI, Claude, or any other model provider.

Deployment Ready

Containerize and deploy agents anywhere with deployment-agnostic architecture.

Built-in Evaluation

Assess agent performance systematically with integrated evaluation tools.

Plugin System

Handle cross-cutting concerns like logging, monitoring, and error handling.

Safety & Security

Built-in patterns for trustworthy agents with callback monitoring.

Complete Learning Path

This crash course covers 9 comprehensive tutorials:

🌱 Foundation

1

Tutorial 1: Your First ADK Agent

Starter Agent - Create your first Google ADK agentLearn basic agent creation with the LlmAgent class:
from google.adk.agents import LlmAgent

agent = LlmAgent(
    name="creative_writing_agent",
    model="gemini-3-flash-preview",
    description="A creative writing assistant",
    instruction="""
    You are a creative writing assistant.
    Help users develop story ideas and characters.
    """
)
What you’ll build: Creative writing assistant with story development capabilitiesRun it: Use adk web to launch interactive interface

🔄 Model Flexibility

1

Tutorial 2: Model-Agnostic Agents

Multi-Model Support - Build agents that work with any modelADK’s model-agnostic design lets you use different AI providers:OpenAI Integration:
from google.adk.agents import LlmAgent

openai_agent = LlmAgent(
    name="openai_agent",
    model="gpt-4o",
    description="OpenAI-powered agent"
)
Anthropic Claude Integration:
claude_agent = LlmAgent(
    name="claude_agent",
    model="claude-3-5-sonnet-20241022",
    description="Claude-powered agent"
)
What you’ll build:
  • OpenAI GPT-4o agent
  • Anthropic Claude agent
  • Model comparison workflows

📊 Structured Data

1

Tutorial 3: Structured Output Agents

Type-Safe Responses - Work with Pydantic schemasExtract and validate structured data using Pydantic models:
from pydantic import BaseModel
from google.adk.agents import LlmAgent

class SupportTicket(BaseModel):
    customer_name: str
    issue_type: str
    priority: str
    description: str

agent = LlmAgent(
    name="ticket_agent",
    model="gemini-3-flash-preview",
    output_schema=SupportTicket
)
What you’ll build:
  • Customer support ticket extractor
  • Email parser with structured validation
  • Data extraction agents

🔧 Tool Integration

1

Tutorial 4: Tool-Using Agents

Four Types of Tools - Comprehensive tool integrationADK supports multiple tool types for maximum flexibility:1. Built-in Tools (Gemini models only):
from google.adk.agents import LlmAgent
from google.adk.tools import GoogleSearchTool, CodeExecutionTool

agent = LlmAgent(
    name="researcher",
    model="gemini-3-flash-preview",
    tools=[GoogleSearchTool(), CodeExecutionTool()]
)
2. Function Tools:
def calculate_price(quantity: int, unit_price: float) -> float:
    """Calculate total price"""
    return quantity * unit_price

agent = LlmAgent(
    name="calculator",
    tools=[calculate_price]
)
3. Third-party Tools (LangChain, CrewAI):
from langchain.tools import WikipediaQueryRun
from google.adk.tools import LangChainTool

wiki_tool = LangChainTool(WikipediaQueryRun())
agent = LlmAgent(tools=[wiki_tool])
4. MCP Tools (Model Context Protocol):
from google.adk.mcp import MCPClient

# Connect to MCP server
mcp_client = MCPClient("filesystem")
tools = mcp_client.get_tools()
agent = LlmAgent(tools=tools)
What you’ll build:
  • Web search agents with Google Search
  • Code execution agents
  • Custom function integrations
  • LangChain tool wrappers
  • MCP server connections

💾 Memory & State

1

Tutorial 5: Memory Agents

Session Management - Persistent conversation memoryIn-Memory Conversations:
from google.adk.agents import LlmAgent
from google.adk.runners import Runner
from google.adk.sessions import InMemorySession

session = InMemorySession()
runner = Runner(agent, session=session)

# Conversation with memory
result1 = runner.run("My name is Alice")
result2 = runner.run("What's my name?")  # Remembers!
Persistent Storage with SQLite:
from google.adk.sessions import SQLiteSession

session = SQLiteSession(db_path="conversations.db")
runner = Runner(agent, session=session)

# Conversations persist across restarts
What you’ll build:
  • Conversational agents with memory
  • Multi-session managers
  • Persistent conversation storage

🔔 Monitoring & Control

1

Tutorial 6: Callbacks

Lifecycle Monitoring - Track agent behaviorThree types of callbacks for complete visibility:1. Agent Lifecycle Callbacks:
def on_agent_start(context):
    print(f"Agent {context.agent.name} starting")

def on_agent_end(context):
    print(f"Agent completed in {context.duration}s")

agent = LlmAgent(
    name="monitored_agent",
    callbacks=[
        AgentCallback(
            on_start=on_agent_start,
            on_end=on_agent_end
        )
    ]
)
2. LLM Interaction Callbacks:
def on_llm_request(context):
    print(f"Sending request: {context.messages}")

def on_llm_response(context):
    print(f"Received: {context.response}")
3. Tool Execution Callbacks:
def on_tool_start(context):
    print(f"Executing tool: {context.tool_name}")

def on_tool_end(context):
    print(f"Tool result: {context.result}")
What you’ll build:
  • Agent performance monitors
  • LLM usage trackers
  • Tool execution loggers
2

Tutorial 7: Plugins

Cross-Cutting Concerns - Global agent behaviorPlugins handle concerns across all agents:
from google.adk.plugins import Plugin

class LoggingPlugin(Plugin):
    def on_request(self, context):
        log.info(f"Request: {context.input}")
    
    def on_response(self, context):
        log.info(f"Response: {context.output}")
    
    def on_error(self, context):
        log.error(f"Error: {context.error}")

# Apply globally
runner = Runner(agent, plugins=[LoggingPlugin()])
Plugin capabilities:
  • Global callback management
  • Request/response modification
  • Error handling and logging
  • Usage analytics and monitoring
What you’ll build: Logging, monitoring, and analytics plugins

🤝 Multi-Agent Systems

1

Tutorial 8: Simple Multi-Agent

Multi-Agent Researcher - Coordinated specialist agentsBuild a research pipeline with multiple specialized agents:
from google.adk.agents import LlmAgent

# Specialized agents
research_agent = LlmAgent(
    name="researcher",
    model="gemini-3-flash-preview",
    instruction="Conduct comprehensive web research",
    tools=[GoogleSearchTool()]
)

summarizer_agent = LlmAgent(
    name="summarizer",
    instruction="Synthesize research into insights"
)

critic_agent = LlmAgent(
    name="critic",
    instruction="Analyze quality and provide recommendations"
)

# Coordinator
coordinator = LlmAgent(
    name="coordinator",
    instruction="Orchestrate research workflow",
    tools=[
        research_agent.as_tool(),
        summarizer_agent.as_tool(),
        critic_agent.as_tool()
    ]
)
Workflow: Research → Summarize → Critique → ReportWhat you’ll build: Comprehensive research system with specialist agents
2

Tutorial 9: Multi-Agent Patterns

Advanced Orchestration - Three workflow patterns1. Sequential Agent - Deterministic pipeline:
from google.adk.agents import SequentialAgent, LlmAgent

sequential = SequentialAgent(
    name="business_planner",
    sub_agents=[
        market_research_agent,  # Step 1
        swot_analysis_agent,    # Step 2
        strategy_agent,         # Step 3
        implementation_agent    # Step 4
    ]
)
Use case: Business implementation plans with market research, SWOT analysis, strategy development, and implementation planning2. Loop Agent - Iterative refinement:
from google.adk.agents import LoopAgent

loop = LoopAgent(
    name="tweet_crafter",
    sub_agent=draft_agent,
    max_iterations=5,
    stop_condition=lambda ctx: ctx.result.quality_score > 0.9
)
Use case: Iterative content refinement until quality threshold met3. Parallel Agent - Concurrent execution:
from google.adk.agents import ParallelAgent

parallel = ParallelAgent(
    name="competitor_analyzer",
    sub_agents=[
        product_analyzer,
        pricing_analyzer,
        market_analyzer,
        tech_analyzer
    ],
    merge_strategy="comprehensive_report"
)
Use case: Simultaneous competitor analysis across multiple dimensionsWhat you’ll build:
  • Sequential business planning pipeline
  • Iterative content crafting loop
  • Parallel competitive analysis

Quick Start

1

Prerequisites

Install Python 3.11+ and get your Google AI API key:
# Get API key from:
# https://aistudio.google.com/
2

Install Google ADK

pip install google-adk
3

Create Your First Agent

from google.adk.agents import LlmAgent

agent = LlmAgent(
    name="my_first_agent",
    model="gemini-3-flash-preview",
    description="My first ADK agent",
    instruction="You are a helpful assistant."
)
4

Run with ADK Web

adk web
Open the local URL and select your agent to start chatting!

Tutorial Structure

Each tutorial follows a consistent structure:
Concept explanations, learning objectives, and detailed documentation
Agent implementation with clear, commented code
Streamlit web interface for interactive testing (when applicable)
Python dependencies for the tutorial

Key Features & Capabilities

Model Providers Supported

agent = LlmAgent(
    name="gemini_agent",
    model="gemini-3-flash-preview"
)

Tool Integration Examples

from google.adk.tools import GoogleSearchTool, CodeExecutionTool

agent = LlmAgent(
    name="researcher",
    model="gemini-3-flash-preview",
    tools=[GoogleSearchTool(), CodeExecutionTool()]
)

Workflow Agent Patterns

Sequential

Deterministic PipelineExecute sub-agents in order, each building on previous results.Best for: Step-by-step processes, analysis pipelines

Loop

Iterative RefinementRepeat sub-agent execution until condition met or max iterations reached.Best for: Quality improvement, content refinement

Parallel

Concurrent ExecutionRun multiple sub-agents simultaneously and merge results.Best for: Independent analyses, multi-dimensional evaluation

Real-World Applications

Research Systems

Multi-agent research pipelines with web search, summarization, and critique

Business Planning

Sequential analysis from market research through implementation planning

Content Creation

Iterative refinement loops for high-quality content generation

Data Extraction

Structured data extraction with Pydantic validation

Competitive Analysis

Parallel evaluation across multiple dimensions and competitors

Model Comparison

Test and compare different AI models for your use case

ADK Advantages

Use any model provider (Gemini, OpenAI, Claude) without changing code. Switch models based on cost, performance, or capabilities.
Deploy anywhere - containers, serverless, on-premise. No vendor lock-in.
Built-in tools, custom functions, LangChain integration, CrewAI tools, and MCP support.
Sequential, loop, and parallel workflow patterns out of the box.
Callbacks, plugins, error handling, and monitoring built-in.

Prerequisites

Required: Python 3.11+, Google AI API key, basic Python knowledge
Optional: Understanding of async patterns, Pydantic basics, API concepts

Environment Setup

Create a .env file in your project:
.env
GOOGLE_API_KEY=your_ai_studio_key_here
Get your API key from Google AI Studio

Learning Tips

1

Follow In Order

Tutorials build on each other - start with Tutorial 1
2

Use ADK Web

The adk web command provides an excellent testing interface
3

Try Streamlit Apps

Many tutorials include Streamlit interfaces for hands-on learning
4

Experiment with Models

ADK’s model-agnostic design makes it easy to compare providers
5

Explore Patterns

Try different workflow patterns to understand their use cases

Common Issues & Solutions

  • Ensure GOOGLE_API_KEY is set in .env file
  • Verify key is valid from Google AI Studio
  • Check key has necessary permissions
  • Install ADK: pip install google-adk
  • Verify Python 3.11+
  • Check requirements.txt dependencies installed
  • Built-in tools (GoogleSearchTool) only work with Gemini models
  • Use function tools for model-agnostic implementations
  • Check model name spelling and availability

Progress Tracker

  • Tutorial 1: First ADK agent
  • Tutorial 2: Model-agnostic agents
  • Tutorial 3: Structured outputs
  • Tutorial 4: Tool integration (all 4 types)
  • Tutorial 5: Memory and sessions
  • Tutorial 6: Callbacks for monitoring
  • Tutorial 7: Plugins for cross-cutting concerns
  • Tutorial 8: Simple multi-agent researcher
  • Tutorial 9: Advanced workflow patterns 🎯

Additional Resources

ADK Documentation

Official Google ADK documentation and guides

Google AI Studio

Get API keys and test models

Gemini API Reference

Detailed Gemini API documentation

Pydantic Documentation

Learn about data validation

Next Steps

Start Learning

Set up your environment and begin with Tutorial 1: Your First ADK Agent
Happy learning! 🚀

Build docs developers (and LLMs) love