What is Google Agent SDK
Google Agent SDK (also known as Agent Development Kit, ADK) is an open-source SDK developed by Google, primarily in Python, designed to simplify and accelerate the development, testing, and deployment of AI Agents.
Developers can use this SDK to build modern AI Agents equipped with memory, tool invocation, task coordination, and other capabilities. ADK is deeply integrated with Google Gemini, Vertex AI, and various Google Cloud services.
Setup Environment and Configure Google Cloud
Go to Google Cloud Console and sign in or register an account.
Create a new project and ensure billing is enabled.
Enable the 'Vertex AI API' in the API management.
Install Google Cloud CLI (gcloud), official download page.
Update CLI components:
gcloud components update
- Log into your Google account in the terminal and generate Application Default Credentials (ADC):
gcloud auth application-default login
A browser will open, complete the login to authenticate your Google account
Create a Python Virtual Environment and Install ADK
- Create a virtual environment in your project directory:
python -m venv .venv
-
Activate the virtual environment (run this every time you open a new terminal):
- macOS/Linux:
source .venv/bin/activate
- Windows CMD:
.venv\Scripts\activate.bat
- Windows PowerShell:
.venv\Scripts\Activate.ps1
Install Google Agent SDK(ADK):
pip install google-adk
(For advanced Vertex AI features, use pip install --upgrade --quiet google-cloud-aiplatform[agent_engines,adk]
)
Create project and .env
- Create project and necessary files:
mkdir multi_tool_agent
cd multi_tool_agent
touch __init__.py agent.py .env
project structure example:
parent_folder/
multi_tool_agent/
__init__.py
agent.py
.env
- Edit the .env file and enter your Google Cloud project information (example):
GOOGLE_CLOUD_PROJECT="your-project-id"
GOOGLE_CLOUD_LOCATION="us-central1"
GOOGLE_GENAI_USE_VERTEXAI="True"
Or, if you're using an API Key (Google AI Studio):
GOOGLE_GENAI_USE_VERTEXAI=FALSE
GOOGLE_API_KEY="your-api-key"
Write Your First Agent
- In agent.py, write a simple example (refer to the official Quickstart):
from google.adk.agents import Agent
root_agent = Agent(
name="hello_agent",
model="gemini-2.5-pro-preview-05-06",
instruction="You are a friendly assistant answering user questions."
)
- In
__init__.py
Add:
from . import agent
Launch the Agent Dev Interface or Run Locally
- Go back to the parent folder and launch the dev UI:
adk web
parent_folder/ <-- Run 'adk web' here
└── your_agent_folder/
├── __init__.py
└── agent.py
Open the displayed URL in a browser (usually http://localhost:8000) to interact with the Agent.
- Or test directly in the terminal:
adk run multi_tool_agent
Advanced: Quickly Try Official Samples
- Clone the official sample repo:
git clone https://github.com/google/adk-samples.git cd adk-samples/agents
- Follow each subfolder’s README to quickly try various pre-built agents.
FAQ and Notes
- I encountered issues finding available regions and models.
- Use region: us-central1
- Region list: https://cloud.google.com/compute/docs/regions-zones?hl=en
- Use model: gemini-2.5-pro-preview-05-06
- Model list: https://cloud.google.com/vertex-ai/generative-ai/docs/models
Top comments (1)
Love this.