DEV Community

Jonathan Huang
Jonathan Huang

Posted on

Google Agent Development Kit (ADK) Introduction (1): Quickly Build Your First AI Agent

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
Enter fullscreen mode Exit fullscreen mode
  • Log into your Google account in the terminal and generate Application Default Credentials (ADC):
   gcloud auth application-default login 
Enter fullscreen mode Exit fullscreen mode

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 
Enter fullscreen mode Exit fullscreen mode
  • 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 
Enter fullscreen mode Exit fullscreen mode

(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
Enter fullscreen mode Exit fullscreen mode

project structure example:

   parent_folder/
     multi_tool_agent/
       __init__.py
       agent.py
       .env
Enter fullscreen mode Exit fullscreen mode
  • 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"
Enter fullscreen mode Exit fullscreen mode

Or, if you're using an API Key (Google AI Studio):

   GOOGLE_GENAI_USE_VERTEXAI=FALSE
   GOOGLE_API_KEY="your-api-key"
Enter fullscreen mode Exit fullscreen mode

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."
   )
Enter fullscreen mode Exit fullscreen mode
  • In __init__.py Add:
   from . import agent 
Enter fullscreen mode Exit fullscreen mode

Launch the Agent Dev Interface or Run Locally

  • Go back to the parent folder and launch the dev UI:
adk web
Enter fullscreen mode Exit fullscreen mode
parent_folder/  <-- Run 'adk web' here
└── your_agent_folder/
    ├── __init__.py
    └── agent.py
Enter fullscreen mode Exit fullscreen mode

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 
Enter fullscreen mode Exit fullscreen mode

Advanced: Quickly Try Official Samples

  • Clone the official sample repo:
  git clone https://github.com/google/adk-samples.git cd adk-samples/agents 
Enter fullscreen mode Exit fullscreen mode
  • Follow each subfolder’s README to quickly try various pre-built agents.

FAQ and Notes

Top comments (1)

Collapse
 
javierescartin profile image
Javier Escartin

Love this.