Agents & ADK
Agents & ADK on Google Cloud is the practice of building, testing, deploying, and operating tool-using generative AI agents with Google ADK and managed Google Cloud services. The material centers on Vertex AI Agent Engine/Agent Runtime, Agent Platform, Sessions, Memory Bank, A2A interoperability, MCP tools, managed agents, and evaluation workflows.
Synthesized across 72 notebooks. See the source pages under Notebooks below for line-level grounding.
Engineers typically start by defining an agent’s instruction, tools, model, session behavior, and deployment target, then test tools and the full agent locally before deploying. ADK agents are commonly wrapped with AdkApp, deployed to Vertex AI Agent Engine or Agent Runtime, and queried through SDK, HTTP, streaming, WebSocket, or A2A interfaces.
Long-running and production-like agents need managed state. Vertex AI Sessions preserve conversation history, Memory Bank extracts and retrieves meaningful long-term user facts, and scopes such as user_id keep memories isolated across customers or guests.
The broader ecosystem includes MCP and Cloud API Registry for external tools, Agent Engine Sandbox for code execution, A2A Agent Cards for agent-to-agent discovery, Managed Agents API for hosted custom agents, Skill Registry for reusable skills, and Gen AI Evaluation or tracing tools for measuring behavior before and after deployment.
Canonical workflow
- Configure the Google Cloud project, billing, required APIs, authentication, IAM roles, region, environment variables, and any Cloud Storage staging bucket.
- Design the agent instruction, tools, model, memory and session scopes, guardrails, A2A skills, and deployment interface.
- Test individual tools directly, then test the agent locally with Runner, InMemorySessionService, or the relevant framework executor before deployment.
- Add managed services as needed: VertexAISessionService for durable sessions, VertexAiMemoryBankService or PreloadMemoryTool for long-term memory, sandbox execution for generated code, and tracing or evaluation hooks.
- Package the deployable agent with root_agent.py, AdkApp, ModuleAgent, source_packages, requirements, Dockerfile, build_options, or Terraform artifacts as appropriate.
- Deploy to Vertex AI Agent Engine, Agent Runtime, Cloud Run, GKE, Managed Agents, or Express Mode with explicit runtime dependencies and resource settings.
- Query the deployed agent through SDKs, direct HTTP, streaming, WebSocket, or A2A, creating sessions or context_id values when continuity is required and polling long-running tasks to terminal states.
- Inspect session events, traces, logs, artifacts, evaluation results, and memory retrieval behavior, then tune prompts, tools, thresholds, and cleanup all demo resources.
Best practices
See Agents & ADK - Best Practices for the full distilled guide.
- Test tool functions directly before wiring them into an agent, and test the full agent locally before deploying to Agent Engine or Agent Runtime.
- Keep deployment constructors lightweight and pickle-able; move heavy initialization into set_up and use root_agent.py or ModuleAgent when local objects contain non-serializable MCP or registry state.
- Wrap ADK agents in AdkApp for Agent Engine deployment and list all runtime dependencies explicitly in requirements, build options, source packages, or container configuration.
- Store production session state outside the agent runtime with VertexAISessionService, especially for Cloud Run, GKE, or scaled deployments where in-memory state is unreliable.
- When using ADK memory tools, provide both the memory tool on the Agent and the memory_service on the Runner; provide a session_service on the Runner when using managed sessions.
- Scope Memory Bank data with stable keys such as user_id, use PreloadMemoryTool or semantic retrieval for relevant context, and use TTL, managed topics, and revision labels for governance.
Key models & APIs
- gemini-2.5-flash, gemini-2.0-flash, gemini-2.0-flash-live-preview-04-09, gemini-live-2.5-flash-native-audio, gemini-3.5-flash, gemini-3.1-flash-lite, text-embedding-005, gemini-embedding-001, text-embedding-004, claude-sonnet-4@20250514, vertex_ai/claude-sonnet-4-5@20250929, vertex_ai/meta/llama-3.3-70b-instruct-maas, antigravity-preview-05-2026, Vertex AI Agent Engine, Vertex AI Agent Runtime, Agent Platform API, Managed Agents API, Google ADK / google-adk, agent_engines.AdkApp, VertexAISessionService, VertexAiMemoryBankService, PreloadMemoryTool, Agent Engine Sandbox, AgentEngineSandboxCodeExecutor, BuiltInCodeExecutor, A2A SDK, DataA2AService, A2A Agent Cards, MCPToolset, Cloud API Registry, Skill Registry, Gemini Data Analytics, BigQuery, Cloud SQL for PostgreSQL vector stores, Vertex AI Vector Search, Cloud Run, Google Kubernetes Engine, Cloud Storage staging buckets, Gen AI Evaluation, Phoenix/OpenInference tracing
Notebooks (72)
Agents & ADK (25)
- Get started with Vertex AI Memory Bank — Builds a Vertex AI Memory Bank hotel concierge that stores and retrieves guest preferences across sessions.
- Governance with Vertex AI Memory Bank — Builds a governed Vertex AI Memory Bank with TTL, topics, revision history, rollback, and cleanup.
- Get started with Memory Bank on ADK — Build ADK agents that generate, retrieve, preload, and customize Agent Engine Memory Bank memories.
- Building a Multimodal Trip Planner with ADK on Vertex AI Agent Engine Memory Bank — Builds and deploys a multimodal ADK trip planner using Vertex AI Agent Engine Memory Bank.
- Get started with A2A on Agent Engine — Builds, deploys, and queries an A2A Q&A agent on Vertex AI Agent Engine.
- Getting Started with Bidirectional Streaming v2 on Agent Runtime — Builds and deploys Agent Runtime bidirectional streaming agents, including a Live API audio agent.
- Claude with ADK on Vertex AI Agent Engine — Builds and deploys a Claude-powered ADK Reddit agent on Vertex AI Agent Engine with memory and tracing.
- Deploy your containerized agent on Agent Runtime (prev. Agent Engine) — Deploys a BYOC ADK weather agent to Agent Runtime and queries it through the Vertex AI API.
- Deploy your first agent to Vertex AI Agent Engine — Deploys ADK agents to Vertex AI Agent Engine with Express Mode, agent object, and inline source workflows.
- Get started with Agent Engine Terraform Deployment — Deploy Vertex AI Agent Engine agents with Terraform, cloudpickle packaging, and ADK tools.
- Get started with Cloud API Registry on Vertex AI Agent Engine — Builds and deploys an ADK BigQuery data analyst agent using Cloud API Registry on Vertex AI Agent Engine.
- Get started with Code Execution on Vertex AI Agent Engine — Runs LLM-generated Python securely with Vertex AI Agent Engine Sandbox and ADK agents.
- Getting Started with Live API on Agent Engine — Deploys bidirectional streaming agents on Vertex AI Agent Engine using Gemini Live API audio and ADK tools.
- MCP on Vertex AI Agent Engine with custom installation scripts — Deploys a Reddit MCP tool agent to Vertex AI Agent Engine with custom install scripts.
- Building multi-agent systems with Vertex AI and Claude — Builds a Vertex AI Agent Engine multi-agent market analysis system with Gemini, Claude, ADK, A2A, and MCP.
- Building Multi-Agent Systems with Vertex AI and Llama model — Builds a traced Vertex AI multi-agent trading analyst with Gemini, Llama, ADK, A2A, and MCP tools.
- Get started with Sessions and Memory Bank for ADK agents in Cloud Run — Builds an ADK weather agent with Vertex AI Sessions, Memory Bank, and Cloud Run deployment.
- Gemini Data Analytics: A2A HTTP API Sample — Calls Gemini Data Analytics DataA2AService over HTTP for agent cards, messages, artifacts, and cancellation.
- Gemini Data Analytics: A2A SDK API Sample — Uses the A2A Python SDK to send synchronous-style requests to Gemini Data Analytics.
- Intro to Gemini Data Analytics — Shows how to create Gemini Data Analytics agents over BigQuery, Looker, or Looker Studio and chat with them.
- Get started with Sessions and Memory Bank for ADK agents in Google Kubernetes Engine — Builds an ADK weather agent with Vertex AI Sessions, Memory Bank, and GKE deployment.
- Intro to Managed Agents API on Agent Platform (cURL) — Shows how to manage and interact with Managed Agents on Agent Platform using REST and cURL.
- Intro to Managed Agents API on Agent Platform (Python) — Shows how to create, inspect, interact with, and delete Managed Agents with google-genai.
- Managed Agents API - Analyzing the 2026 World Cup — Deploys a Managed Agents API World Cup analyst agent with GCS skills and multi-turn interactions.
- Intro to Skill Registry — Introduces Skill Registry for creating, ingesting, registering, and semantically retrieving agent skills.
Embeddings & Vector Search (1)
- 🛡️ AI Brand Safety: Three-Tier Agent Anomaly Detection — Builds ADK agent anomaly detection with Gemini baselines, Vector Search scoring, and tiered audits.
Gemini (37)
- Vertex AI Agent Engine in Express Mode — Build, test, deploy, and query a Gemini ADK currency agent on Vertex AI Agent Engine Express Mode.
- Evaluate a CrewAI agent on Vertex AI Agent Engine (Customized template) — Evaluates a CrewAI Gemini agent on Vertex AI Agent Engine with tool, trajectory, and response metrics.
- Evaluating a LangChain Agent on Vertex AI Agent Engine (Prebuilt template) — Deploys and evaluates a LangChain Gemini agent on Vertex AI Agent Engine using Gen AI Evaluation.
- Evaluate a LangGraph agent on Vertex AI Agent Engine (Customized template) — Builds a Gemini LangGraph agent on Agent Engine and evaluates tools, trajectories, and responses.
- Intro to Building and Deploying an Agent with Agent Engine in Vertex AI — Builds, tests, deploys, streams, customizes, and deletes a LangChain Gemini agent on Vertex AI Agent Engine.
- Persisting LangChain History with Vertex AI Session Service — Persists LangChain chat and tool history in Vertex AI Agent Engine Session Service.
- Building and Deploying a Human-in-the-Loop LangGraph Application with Agent Engine on Vertex AI — Builds, tests, deploys, and resumes a human-in-the-loop LangGraph agent on Vertex AI Agent Engine.
- Get started with Vertex AI Memory Bank - ADK — Builds an ADK agent with Vertex AI Memory Bank for long-term user memory across sessions.
- Get started with Vertex AI Memory Bank - CrewAI — Integrates Vertex AI Memory Bank with CrewAI agents for persistent long-term conversational memory.
- Get started with Vertex AI Memory Bank - LangGraph — Builds a LangGraph chatbot with Vertex AI Memory Bank for long-term personalized memory.
- AG2 (formerly Autogen) Multi-Agents Example on Vertex AI Agent Engine — Builds and deploys an AG2 multi-agent research app to Vertex AI Agent Engine.
- Building and Deploying a LangGraph Agent with Agent Engine in Vertex AI — Builds, tests, deploys, and deletes a Gemini LangGraph agent on Vertex AI Agent Engine.
- Building a Multi-Agent RAG Application with LangGraph and Agent Engine — Builds and deploys a LangGraph multi-agent RAG app on Vertex AI Agent Engine with Cloud SQL vector stores.
- Function Calling Agent — Builds a Gemini function-calling retail assistant over Cymbal Retail data in BigQuery.
- Guardrail Classifier Agent — Builds a LangGraph guardrail classifier agent for Cymbal retail chat using Gemini on Vertex AI.
- Semantic Router Agent — Builds a LangGraph semantic router that sends retail queries to mocked Gemini expert assistants.
- Task Planner Agent — Builds a LangGraph task-planner agent that plans, searches with Gemini, reflects, and responds.
- Constructing a LangGraphAgent — Wraps a simple LangGraph StateGraph in LangGraphAgent and tests stateful/stateless streaming.
- Query a Remote LangGraph Agent Server — Queries a local or Cloud Run LangGraph RemoteGraph agent and displays streamed agent outputs and state.
- Intro to Computer Use with Gemini — Builds a Gemini Computer Use browser agent loop with Playwright and screenshots.
- Introduction to Gemini Deep Research Agent — Shows how to run Gemini Deep Research Agent with streaming, multimodal input/output, and grounding tools.
- Create & Deploy Agent and Run Gen AI Agent Evaluation — Creates, deploys, runs, and evaluates an ecommerce ADK agent on Vertex AI Agent Engine.
- Create a Gen AI Agent Evaluation for a Deployed Agent — Runs inference and creates a persisted Gen AI Agent Evaluation for a deployed Vertex AI agent.
- Evaluate agent final answer with custom parsing — Evaluates agent final answers using Vertex AI EvalTask with a custom JSON parser for autorater output.
- Evaluating Agents - Evaluate a CrewAI agent with Vertex AI Gen AI Evaluation Service — Evaluates a CrewAI product agent with Vertex AI Gen AI Evaluation metrics and BYOD evaluation data.
- Evaluating Agents - Evaluate a LangGraph agent with Vertex AI Gen AI Evaluation Service — Evaluates a LangGraph Gemini agent with Vertex AI Gen AI Evaluation metrics and BYOD data.
- Evaluate your ADK agent using Vertex AI Gen AI Evaluation service — Evaluates an ADK product research agent with Vertex AI Gen AI Evaluation metrics.
- Overview — Evaluates a CrewAI research crew with Phoenix tracing and Vertex AI trajectory metrics.
- Gen AI Eval - Multi-turn Agent Eval, User Simulation, Metric Registration, Auto-Loss Analysis — Evaluates ADK travel agents with Vertex Gen AI Eval multi-turn simulation, custom metrics, and loss analysis.
- View Gen AI Agent Evaluation Run Results — Retrieves a Vertex AI Gen AI evaluation run and displays its embedded report.
- Intro to Model Context Protocol (MCP) integration with Vertex AI — Shows how to connect Gemini on Vertex AI to custom and prebuilt MCP servers.
- From API to Report: Building a Currency Analysis Agent with LangGraph and Gemini — Builds a LangGraph currency analysis agent using Gemini on Vertex AI and an exchange-rate API.
- Build Your Own AI Podcasting Agent with LangGraph, Gemini, and Chirp 3 — Builds a LangGraph podcast agent using Gemini research loops and Chirp 3 text-to-speech audio.
- LlamaIndex RAG Workflows using Gemini and Firestore — Builds a LlamaIndex RAG workflow with Gemini, Vertex embeddings, and Firestore storage.
- 🛡️ Agentic GraphRAG: Cybersecurity Threat Intelligence — Builds and deploys an ADK GraphRAG threat-intel agent using Neo4j and Vertex AI Agent Engine.
- GraphRAG on Google Cloud With Spanner and Vertex AI Agent Engine — Builds a GraphRAG Q&A agent with Spanner Graph, Gemini, ADK, and Vertex AI Agent Engine.
- 🌿 Eco-Nomad Swarm: 100% Real-Data Sustainable Travel Orchestration — Builds a Vertex AI ADK travel swarm using Neo4j GraphRAG and live APIs for sustainable trip briefs.
Open Models (4)
- Building an ADK agent using QWEN 3 on Vertex AI — Builds and deploys an ADK weather agent using Qwen3 on Vertex AI and Agent Engine.
- Running Qwen 3 with Ollama in Cloud Run for Agents — Deploys Qwen3:8b with Ollama on GPU Cloud Run and uses it as an ADK agent model.
- Running a Gemma 2-based agentic RAG with Ollama on Vertex AI and LangGraph — Deploys a Gemma 2 Ollama container on Vertex AI and uses it in a LangGraph SQL RAG agent.
- Build and deploy a Hugging Face smolagent using DeepSeek-r1 on Vertex AI — Deploys DeepSeek R1 Distill Qwen 7B on Vertex AI and wraps it in a smolagents math verifier agent.
Vertex AI Search (4)
- Gemini Enterprise custom agent with prompt management — Builds a Gemini Enterprise ADK SQL agent using Vertex AI Prompt Management and schema file context.
- Gemini Enterprise custom agent with Vertex AI session — Builds a Gemini Enterprise travel agent using ADK sub-agents and persistent Vertex AI sessions.
- MCP Server with Gemini Enterprise — Builds an MCP HR leave tool on Cloud Run, connects it to an ADK Gemini agent, and registers it with Gemini Enterprise.
- Open Source Models (Gemma) as a agent with Gemini Enterprise — Deploys Gemma on Cloud Run, wraps it with ADK, deploys to Agent Engine, and registers it in Gemini Enterprise.
Workshops (1)
- AI Agents for Engineers (Evolution of AI Agents) — Compares zero-shot, LangChain, and LangGraph essay generation with Gemini and Tavily search.
Related concepts
- Agent Engine · Function Calling & Tools · Evaluation · RAG & Grounding · Applied Use Cases · MLOps & Deployment · Open & Partner Models · Embeddings & Vector Search
Part of the Generative AI Google Brain · Agents & ADK - Best Practices