◉GEMINI LABJP
●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer●2.5 ROUTE — From today, 12/1, calls to gemini-2.5-pro and 2.5-flash are rerouted to newer models automatically●CLI 0.71.1 — Gemini CLI stable is still v0.71.1, with a 0.73 nightly published on 11/30●INTRO END — Introductory pricing for 3.8, 3.7 and 3.6 Flash ends on 12/31. 30 days left●VERTEX — Developers are asking how to run Gemini CLI with Vertex AI credentials●NEON — Gemini 4 Neon became generally available on 11/18 (paid tier only)●IMAGE TEXT — A new test shows text inside an image can sway Gemini's answer
Articles/Dev Tools
⟐ Dev Tools/2026-05-02Beginner

Google ADK Quickstart — Build Your First AI Agent in 30 Minutes

A hands-on Google Agent Development Kit (ADK) walkthrough for absolute beginners — from install to a working agent in 30 minutes, with the gotchas called out as you hit them.

gemini121adkagent-development-kitpython113tutorial9beginner17

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 --version

If 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
PathRole
adk-tutorial/Working folder. You launch adk web from here
weather_agent/__init__.pyOne line that imports agent.py
weather_agent/agent.pyThe agent itself
weather_agent/.envYour API key (created next)

__init__.py needs just one line:

# weather_agent/__init__.py
from . import agent

Without 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"
INNER

Replace 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 web

Open 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_agent

Where it tends to go wrong

SymptomCause and fix
Agent missing from the listYou ran adk web inside weather_agent/. Launch from adk-tutorial/ and check the import in __init__.py
Model answers without calling the toolThe docstring is empty or too thin. Describe arguments, return value, and when to use it
API key errorCheck where .env lives. It belongs in weather_agent/.env, with the key in quotes
429 rate limitThe free tier caps requests per minute. Leave a little gap between attempts
Model name errorModels 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.

Share

Thank You for Reading

Gemini Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⟐ Dev Tools2026-10-20
Typed @config and the Wrong File Went In? Checking Gemini CLI's @ Reference for Silent First-Match Picks
A bug report says Gemini CLI's @ reference silently picks the first hit when a name is ambiguous. Here is how I check for same-name files before typing @, with a small Python script and a test run.
⟐ Dev Tools2026-10-06
Three Veo 3.1 previews stop on Oct 22. I started with an inventory of every call site
Three Veo 3.1 preview models shut down on Oct 22, with gemini-omni-1.1-flash as the listed replacement. Before swapping model names, here is a search script that finds every call site in a repo, and a config pattern that stops loudly after the deadline instead of drifting to another model.
⟐ Dev Tools2026-09-15
The approval rules I had written never matched once — auditing my Gemini CLI policies
A deny rule I trusted for half a year had never matched. The pattern was tested against a JSON string, the folder I kept my rules in is not read, and ask_user turns into deny the moment nobody is watching. Here is the audit, and the script I wrote to keep doing it.