The other evening I had the ADK docs open, staring at agents, tools, sessions, and runners all landing at once. I copied the example, ran adk web, and the dropdown was empty. The code was fine. I had simply run the command from the wrong folder.
Here is what I'd say up front: with ADK, running something once beats reading about it first. I'll keep the theory short and give you code that runs, with the checks arranged in the order you'll actually trip over them. By the end you should have a small weather agent answering in your own browser.
What you'll build
Ask "What's the weather in Tokyo?" and the agent calls a Python function named get_weather by itself, then turns the result into one natural sentence. There's no real weather API here, only fixed dummy data.
The point is the basic ADK loop: the model thinks, calls a tool, and puts the result into words. Once that loop is clear, swapping get_weather for "check inventory" or "post to Slack" barely changes the shape of the code.
Step 1: Set up the environment (5 min)
ADK needs Python 3.10 or newer. The official quickstart also starts with a virtual environment, so I'll do the same.
# Create a working folder and activate a virtualenv
mkdir adk-tutorial && cd adk-tutorial
python3 -m venv .venv
source .venv/bin/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
# Install ADK
pip install google-adk
# Sanity check (should print a version)
adk --versionIf you see adk: command not found, either the virtualenv isn't active or pip points at a different Python. Check that which python and which pip both resolve inside .venv.
Step 2: Create the folder structure (3 min)
ADK works on the rule that the folder name is the agent name. It feels odd at first, but it saves you confusion when you run adk web later.
The official docs also offer adk create, which scaffolds agent.py, .env, and __init__.py for you. I'll make the files by hand here so you can see each piece.
# Create a folder for the agent
mkdir weather_agent
cd weather_agent
# Create the two Python files
touch __init__.py agent.py| Path | Role |
|---|---|
adk-tutorial/ | Working folder. You launch adk web from here |
weather_agent/__init__.py | One line that imports agent.py |
weather_agent/agent.py | The agent itself |
weather_agent/.env | Your API key (created next) |
__init__.py needs just one line:
# weather_agent/__init__.py
from . import agentWithout that import, the agent never shows up in the list. I stared at the empty dropdown for about five minutes my first time.
Put the key you generated in Google AI Studio in a .env file inside the agent folder. The official quickstart points at my_agent/.env as well.
# Run inside the weather_agent folder
cat > .env << 'INNER'
GOOGLE_API_KEY="YOUR_GEMINI_API_KEY"
INNERReplace YOUR_GEMINI_API_KEY with your own key, and add .env to .gitignore so it never gets committed.
Step 3: Write the agent (10 min)
Paste this into weather_agent/agent.py:
# weather_agent/agent.py
from google.adk.agents import Agent
def get_weather(city: str) -> dict:
"""Return dummy current weather for the given city.
Args:
city: City name in English (e.g. "Tokyo", "Osaka")
Returns:
A dict with status, temperature_c and condition.
"""
# In production this would call a real API. Fixed values keep the demo predictable.
weather_data = {
"Tokyo": {"temperature_c": 22, "condition": "sunny"},
"Osaka": {"temperature_c": 24, "condition": "cloudy"},
"Sapporo": {"temperature_c": 14, "condition": "rain"},
}
if city in weather_data:
return {"status": "success", "city": city, **weather_data[city]}
return {"status": "error", "message": f"No weather data registered for {city}."}
# ADK looks for a variable named "root_agent" at startup
root_agent = Agent(
name="weather_agent",
model="gemini-3.8-flash",
description="A small assistant that answers weather questions.",
instruction=(
"You are a weather assistant. When the user asks about a city, "
"always call the get_weather tool and answer in one natural sentence "
"based on its result. Pass city names in English (e.g. Tokyo)."
),
tools=[get_weather],
)The most important thing here is that the variable is named root_agent. Name it anything else and the UI shows nothing, with no error to point you at the cause.
The second is the docstring on get_weather. ADK reads it to tell the model what the function does. If it's empty, the model can't tell when to call the tool, and your function gets ignored.
About the model name: as of this update in October 2026, the Gemini API docs recommend gemini-3.8-flash as the stable Flash model for new projects. The official quickstart uses the gemini-flash-latest alias, but I pinned a name so the behavior stays put. Models turn over quickly, so check the model list and the deprecations page before you copy this.
Step 4: Run it and talk to it (5 min)
Before launching, check where you are. Go back one level up from weather_agent/, into adk-tutorial/, then run:
cd ..
adk webOpen http://localhost:8000, pick weather_agent from the dropdown at the top left, and type:
What's the weather in Tokyo?
If it works, you'll get something like "It's 22°C and sunny in Tokyo." Open the Trace panel on the right and you can see get_weather being called, with its arguments, in order.
The official docs state that ADK Web is for development and debugging only, not production. Treat this setup as a practice bench.
If you'd rather stay in the terminal, this also works from adk-tutorial/:
adk run weather_agentWhere it tends to go wrong
| Symptom | Cause and fix |
|---|---|
| Agent missing from the list | You ran adk web inside weather_agent/. Launch from adk-tutorial/ and check the import in __init__.py |
| Model answers without calling the tool | The docstring is empty or too thin. Describe arguments, return value, and when to use it |
| API key error | Check where .env lives. It belongs in weather_agent/.env, with the key in quotes |
| 429 rate limit | The free tier caps requests per minute. Leave a little gap between attempts |
| Model name error | Models get swapped out. Check the deprecations page to see whether your chosen name is still current |
The first row cost me my first evening. I kept suspecting the code when the thing to suspect was the folder I ran it from.
When an agent won't start, suspect where you ran it before you suspect the code. It's still the first thing I check with ADK.
Next steps
Once it runs, move toward something real.
Start by replacing get_weather with a real function. Read a CSV, query an internal API, send a notification: wrap one small daily chore as a function and hand it over.
You can also skip ADK and build the loop yourself. I wrote about that trade-off in a production custom agent loop without ADK.
When you head toward production, you'll want safety nets built on callbacks. ADK callbacks and guardrails covers that, and measuring memory loss after ADK session compaction helps when conversations get long.
For now, add one more city to get_weather and restart adk web. Seeing a small change show up on screen once makes everything after it easier.