Google ADKgoogle-adk 2.8 · Python 3.10+
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

Install it and make an agent

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

bash
pip install google-adk

Python 3.10 or later. A virtual environment is the usual advice and it applies here, because ADK brings a web server and a lot of integrations with it.

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 something actually 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.

No key yet
The generated project expects a Gemini API key in .env. You do not need one to follow this course: the next lesson writes a model that answers with no network at all. Lesson 23 sets a real key up, when you want one.
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. Notice nothing else changes.

Little by little, you're building something great.