Google ADKgoogle-adk 2.8 · Python 3.10+
Dashboard
0%
1
Curious builder0 XP earned · 300 to level 2
0 daysFinish a lesson to begin
Badge collection0 of 6 unlocked
28 small wins to finish your pathNext lesson →

Installation and setup

One install, and an agent is an object you can print. Nothing runs when you make one, which is worth seeing before anything else.

pip install google-adk

It needs Python 3.10 or later. ADK brings a web server and many integrations with it, so the download is large.

An agent, made but not run

Example
agent = LlmAgent(
    name="support",
    model="gemini-flash-latest",
    description="Answers questions about orders.",
    instruction="Help customers with their orders.",
    tools=[lookup_order],
)

print("name: ", agent.name)
print("model:", agent.model)
print("tools:", [t.__name__ for t in agent.tools])

Nothing was sent anywhere. Creating an agent builds a description of one: a name, a model to use, an instruction, and the functions it may call. The model string is not checked until the agent runs.

The four fields worth knowing on day one

FieldWhat it is for
nameHow ADK refers to this agent, and how another agent hands work to it
modelWhich model to use, as a string or a model object
descriptionWhat this agent is for. Another agent reads it when deciding whether to hand over
instructionWhat this agent should do. The model reads it every turn

The difference between description and instruction catches everybody once. The instruction is for the model doing the work. The description is for whoever is deciding which agent should do it, which becomes lesson 16.

The project layout ADK expects

There is a command that makes one for you, and it is worth running once to see the shape.

bash
adk create my_agent
text
my_agent/
    agent.py      # the agent, in a variable called root_agent
    .env          # API keys or project ids
    __init__.py

The only thing ADK requires is a variable named root_agent in agent.py. That is what the command line tools and the dev UI look for, which is lesson 24.

Before the real model
The generated project expects a Gemini API key in .env. The next lesson writes a model that answers without a network call, which is what every lesson up to 24 runs on. Lesson 25 sets a real one up.
Try it yourself
  • Run adk create my_agent and read the three files it wrote.
  • Change the instruction in the snippet above and print it again. Only the instruction changes.

Little by little, you're building something great.