This repository contains sample code that will allow you to learn the features of Google ADK and how to use it.
Through the course of the steps in this repository, you will learn:
- 01_basic_agents: How to create a basic agent using ADK.
- How ADK is different from the GenAI SDK (Upcoming)
- How to define and call tools using ADK (Covered progressively, starting with exercises in 01_basic_agents)
- How to use advanced ADK features such as session, state, and memory (Upcoming)
- How to deploy an ADK app to a cloud runtime (Upcoming)
- Agent workflows (Upcoming)
- Multi-agent interactions (Upcoming)
This repository is structured into sequential steps, each in its own directory (e.g., 01_basic_agents
, 02_another_step
, etc.).
To get started with this repository:
-
Clone the repository in your IDE.
-
Set up a Python virtual environment (Note: if you don't have
uv
installed, install it usingpip install uv
- I highly recommend this tool):uv venv source .venv/bin/activate
or
python3 -m venv .venv source .venv/bin/activate
-
Install dependencies using uv:
uv sync
or
pip install -r requirements.txt
-
Go to the step you'd like to execute
cd 01_basic_agents
Each step directory contains its own
README.md
with specific instructions and explanations for that agent. -
Run the ADK server
adk web
This will start a local server (usually at
http://localhost:8000
). Open this URL in your web browser to interact with the agent for that step.
- /01_basic_agents: Learn the fundamentals of creating and running a simple ADK agent. The
README.md
in this directory includes exercises for adding tools. - (More steps will be added here as they are developed)
Follow the README.md
file within each step's directory for detailed guidance.
Any ADK agent needs to be create using the specified folder structure below.
parent_folder/
multi_tool_agent/
__init__.py
agent.py
.env
Then run the below command within a folder where you would like to create the agent to automatically bootstrap the required files.
mkdir my_agent && cd my_agent && touch __init__.py agent.py && echo "from . import agent" >> __init__.py && touch .env && echo "GOOGLE_GENAI_USE_VERTEXAI=FALSE" >> .env && echo "GOOGLE_API_KEY=<paste your key here>" >> .env
The API Key for Gemini can be obtained from Google AI Studio
I recommend that you export the API key to the environment. Either use the below command or include it in your bash or zsh env files.
export GOOGLE_API_KEY=<paste your key here>
Contributions are welcome! Please feel free to submit pull requests or open issues.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.