Agent Development Kit (ADK)
Agent Development Kit (ADK) is a flexible and modular framework for developing and deploying AI agents. While optimized for Gemini and the Google ecosystem, ADK is model-agnostic, deployment-agnostic, and is built for compatibility with other frameworks.
ADK is designed to make agent development feel more like software development, making it easier for developers to create, deploy, and orchestrate agentic architectures ranging from simple tasks to complex workflows.
Set up Environment & Install ADK
Create and activate a virtual environment (recommended):
bash
# Create virtual environment python -m venv .venv # Activate (each new terminal) # macOS/Linux source .venv/bin/activate # Windows CMD .venv\Scripts\activate.bat # Windows PowerShell .venv\Scripts\Activate.ps1
Install ADK
Install ADK by running the following command:
bash
pip install google-adk
Create an Agent Project
Run the following command to create a new agent project:
bash
adk create my_agent
Project Structure
The created agent project has the following structure:
Folder Structure
📁 my_agent/ ├── 📄 agent.py # main agent code ├── 📄 .env # API keys or project IDs └── 📄 __init__.py
Update Your Agent Project
The agent.py file contains a root_agent definition, which is the only required element of an ADK agent. You can also define tools for the agent to use.
Below is an example of adding a get_current_time tool:
Python
from google.adk.agents.llm_agent import Agent
# Mock tool implementation
def get_current_time(city: str) -> dict:
"""Returns the current time in a specified city."""
return {"status": "success", "city": city, "time": "10:30 AM"}
root_agent = Agent(
model='gemini-3-flash-preview',
name='root_agent',
description="Tells the current time in a specified city.",
instruction="You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.",
tools=[get_current_time],
) Set Your API Key
This project uses the Gemini API, which requires an API key. You can create an API key from Google AI Studio.
Store your API key in the .env file:
bash
echo 'GOOGLE_API_KEY="YOUR_API_KEY"' > .env
Replace YOUR_API_KEY with your actual API key.
Run Your Agent
You can run your ADK agent using either the command-line interface or the web interface:
- Run with command-line interface:
- Use the following command:
bash
adk run my_agent
- Run with web interface:
- Start the web interface using the following command:
bash
adk web --port 8000
Note: Run this command from the parent directory that contains your my_agent/ folder.
This command starts a web server with a chat interface. You can access it at:
- http://localhost:8000
- http://127.0.0.1:8000
Select your agent from the top-left corner and start interacting with it.