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

  1. Configure the Google Cloud project, billing, required APIs, authentication, IAM roles, region, environment variables, and any Cloud Storage staging bucket.
  2. Design the agent instruction, tools, model, memory and session scopes, guardrails, A2A skills, and deployment interface.
  3. Test individual tools directly, then test the agent locally with Runner, InMemorySessionService, or the relevant framework executor before deployment.
  4. 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.
  5. Package the deployable agent with root_agent.py, AdkApp, ModuleAgent, source_packages, requirements, Dockerfile, build_options, or Terraform artifacts as appropriate.
  6. Deploy to Vertex AI Agent Engine, Agent Runtime, Cloud Run, GKE, Managed Agents, or Express Mode with explicit runtime dependencies and resource settings.
  7. 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.
  8. 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)

Embeddings & Vector Search (1)

Gemini (37)

Open Models (4)

Vertex AI Search (4)

Workshops (1)


Part of the Generative AI Google Brain · Agents & ADK - Best Practices