Skip to main content
It’s still Thursday. A minute ago you ran:
Those three files are your entire agent. Below we walk through each file, explain what it does, and show how to run and debug the agent locally.

What ADK expects: the three files

agent.py — the heart of your agent

ADK expects a variable named root_agent in agent.py. The loader imports your package and looks specifically for that exact variable name. Do not rename it. Minimal example:
Always keep the variable named root_agent. If you rename it, ADK will not find your agent.
If you accidentally rename the variable, ADK fails to load the agent. For example:
Running ADK after renaming produces:

init.py — make the folder importable

__init__.py contains a single import so ADK can import the package by folder name. You will rarely need to edit this file.

.env — store your API key locally

Put your GOOGLE_API_KEY in the .env file so you don’t have to re-export it every time:
Never commit .env to version control. It contains your API key and must remain secret.
If you prefer to set the key for a single run without modifying .env, pass it inline:

Running the agent locally

Start an interactive chat session with:
A typical terminal conversation looks like:
This behavior is expected for the minimal agent: it can reply but has no domain context (for example, order data), so responses are generic.

Inspecting what the agent does: ADK Web

When you want visibility into the agent’s internal behavior (useful for debugging why it suggested a refund, which model was called, or which tools ran), run:
ADK Web opens a local development UI in your browser with two main panels:
  • Chat: interact with the agent like the terminal session.
  • Trace: a detailed execution trace showing which model was invoked, inputs and outputs, and — once you add tools — which tools ran and their results.
This trace is essential when debugging complex agents or investigating unexpected behavior.
A dark-themed UI mockup titled "ADK Web" showing side-by-side Chat and Trace panels. The Chat shows "You: Where's my order?" and "Agent: Sorry, I don't have access to order information," while the Trace lists the model and input/output details.

Next steps

Now that you can create, run, and inspect a minimal agent, the next step is to expand agent.py field-by-field: add domain context, integrate tools or data sources, and configure the model behavior so the agent can act on real information.

Watch Video