Google Agent Development Kit (ADK): How to deploy Your First Agent to Vertex AI Agent Engine

aiwithbrandonAbout 6 min readMay 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts

  • Agent Development Kit (ADK): Google's agentic framework for building agents, similar to Langchain or CrewAI. It's open-source, free to use, and supports various models (including OpenAI and cloud models).
  • Vertex AI Agent Engine: Google's platform for deploying agents, simplifying the deployment process and offering a pay-as-you-go pricing model. It supports various agent frameworks.
  • Deployment: All the instructions needed to run an agent, including code, dependencies, and configurations.
  • Session: A conversation with a deployed agent, consisting of messages exchanged between the user and the agent.
  • Google Cloud CLI: A command-line tool for interacting with Google Cloud Platform, enabling local access to Gemini keys and deployment capabilities.
  • Google Cloud Project: A container for organizing all your Google Cloud resources.
  • Cloud Storage Bucket: A storage location in Google Cloud for storing deployed agents and related resources.
  • Traces: A record of messages passed back and forth between an agent and its users, allowing for debugging and performance analysis.

Deploying Agents from Agent Development Kit to Google Cloud Agent Engine

1. Introduction

The video demonstrates how to deploy agents built with Google's Agent Development Kit (ADK) to Google's Agent Engine on Vertex AI. It provides a step-by-step guide, including setting up cloud resources, installing necessary tools, and deploying the agent. The source code and instructions are available for free download.

2. Core Technologies: Agent Development Kit and Vertex AI Agent Engine

  • Agent Development Kit (ADK):
    • Google's agentic framework for building agents.
    • Similar to Langchain, CrewAI, and LlamaIndex.
    • Allows passing in any model (OpenAI, cloud models, etc.).
    • Free to use and open-source.
  • Vertex AI Agent Engine:
    • Google's platform for easy agent deployment.
    • Supports various agent frameworks (CrewAI, Langchain, LlamaIndex, etc.).
    • Allows making requests to deployed agents like regular APIs.
    • Pay-as-you-go pricing model: pay for tokens used, CPU usage, and memory.
    • Example pricing: approximately $0.11 per hour with one core and 1 GB memory.

3. Five Steps to Deploy Agents to the Cloud

  1. Create an Agent using ADK:
    • The video provides a pre-built "shortbot" agent that shortens messages.
    • The agent is structured similarly to Langchain and CrewAI, with a name, model, description, and instructions.
    • Tools can be passed in as Python functions with parameters, types, and docstrings.
  2. Set up Cloud Resources:
    • Create a new project in Google Cloud Platform (GCP).
    • Enable and set up AI resources within the project.
  3. Install Google Cloud CLI:
    • Install Google Cloud CLI on your local computer.
    • This allows you to log in, access cloud resources, and connect to Vertex AI.
  4. Connect to Vertex AI:
    • Use Google Cloud CLI to connect your local computer to your Google Cloud project.
    • This provides access to Gemini keys and other resources needed to run the agent locally.
  5. Deploy Agent to the Cloud:
    • Use provided scripts to deploy the agent to the cloud.

4. Step-by-Step Walkthrough

4.1. Step 1: Agent Overview

  • The "shortbot" agent takes a message and shortens it.
  • The agent definition includes a name, model, description, and instructions.
  • Tools are defined as Python functions with type hints and docstrings.
  • Instructions are provided to install the project using Poetry:
    • Install Poetry.
    • Run poetry install to install dependencies (including Google Agent Development Kit).
    • Activate the environment.
    • Run ADK web to spin up a web version of the agent (requires Google Cloud CLI setup in step 4).
  • The agent's web interface allows sending messages and viewing responses, including the original and shortened character counts.
  • Agent Development Kit organizes agents into folders, with an agent.py file containing the agent definition. The folder name and agent name must match.

4.2. Step 2: Create Google Cloud Platform Account and Project

  • Navigate to Google Cloud Platform (GCP).
  • Sign up for a Google Cloud account (may require a payment method for accessing newer features).
  • Create a new project:
    • Give the project a name (e.g., "ADK shortbot YouTube").
    • Select a billing account.
    • Select an organization (if applicable).
    • Click "Create."
  • Select the new project.

4.3. Step 3: Enable AI Resources

  • Enable Vertex AI:
    • Search for "Vertex AI" in the GCP console.
    • Click "Enable All Recommended APIs."
  • Create a Cloud Storage Bucket:
    • Search for "bucket" and go to "Cloud Storage Buckets."
    • Click "Create."
    • Give the bucket a name (e.g., "ADK shortbot YouTube").
    • Click "Continue" through the default settings.
    • Ensure "Enforce public access prevention" is checked.
    • Click "Create."
  • Update environment variables:
    • Copy the Project ID from the Google Cloud console.
    • Set the cloud location (e.g., "US Central 1").
    • Find the bucket name in the Cloud Storage Buckets interface.
    • Update the environment variables with the project ID, cloud location, and bucket name.

4.4. Step 4: Set up Google Cloud CLI

  • Install Google Cloud CLI:
    • Follow the instructions on the Google Cloud CLI installation page for your platform.
    • Run the provided command to install it.
  • Initialize Google Cloud CLI:
    • Run gcloud init.
    • Authenticate with your Google account using gcloud auth login.
    • Select the Google Cloud project you created.
    • Optionally configure a default zone.
  • Verify the setup by running ADK web to start the local agent.

4.5. Step 5: Deploy Agent to Agent Engine

  • Core Concepts:
    • The goal is to bundle the agent into a container and deploy it to Vertex AI Agent Engine.
    • A "reasoning engine" is created by passing the root agent (shortbot) to Agent Engine.
    • A "deployment" is created by passing the application to Agent Engine, along with any requirements and extra packages.
    • A "session" is a conversation with a deployed agent.
  • Deployment Process:
    • Use the provided script to create, delete, and list deployments.
    • Use the script to chat with sessions and send messages.
    • Run poetry run deploy remote to see available commands.
    • Run poetry run deploy remote -d-create to create a deployment.
    • The script installs dependencies, saves everything to the Google Storage bucket, and deploys the agent to Agent Engine.
    • Monitor the deployment progress in the Google Cloud console.
    • List deployments using poetry run deploy remote --list.
    • Create a new session using poetry run deploy remote --create-session --resource-id <resource_id>.
    • Send a message to the session using poetry run deploy remote --send --resource-id <resource_id> --user-id test_user --session-id <session_id> --message "Your message".

5. Bonus: Traces and Logs

  • View traces in the Google Cloud console by searching for "traces" and clicking "Trace Explorer."
  • Traces show the messages sent between the agent and users, as well as the LLM calls and responses.
  • Use filters to analyze specific events, such as LLM calls.

6. Conclusion

The video provides a comprehensive guide to deploying agents from Google's Agent Development Kit to Google Cloud Agent Engine. By following the step-by-step instructions, developers can easily create, deploy, and interact with their agents in the cloud. The video also highlights the importance of understanding core concepts such as deployments, sessions, and traces for effective agent management and debugging. The provided source code and free community support further enhance the learning experience.

AI summaries can miss context or contain errors. Check important details against the original video.

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.