Google ADK (Agent Development Kit)
Google's toolkit for building agents on Gemini — tools, sessions, and deployment paths.
Interview tip Mention Gemini models, Google Cloud auth, and how ADK structures agents similarly to other frameworks.
① What you must know (30 sec)
The Agent Development Kit (ADK) is Google's framework for building Gemini-powered agents with tools, multi-turn sessions, and first-class deployment to Vertex AI and Cloud Run. It structures agents similarly to other frameworks — instructions + model + tools + loop — but optimized for Google Cloud auth, grounding, and enterprise compliance.
Analogy: ADK is to Gemini agents what Firebase is to mobile apps — opinionated tooling that pairs naturally with Google's cloud stack.
② How it works
ADK components
Agent definition→Gemini model→Tools (custom + Google)→Session state→Deploy (Vertex / Run)
Agent — system instructions, model (gemini-2.0-flash / pro), tool registry
Tools — Python functions, Google Search grounding, code execution
Session — multi-turn memory keyed by user or conversation ID
Runner — orchestrates agent loop with callbacks and safety settings
Deploy — package agent to Vertex AI Agent Engine or Cloud Run container
Start in Google AI Studio for rapid prototyping; migrate to Vertex AI for VPC, IAM, audit logs, and SLA.
③ Step-by-step (hands-on)
Step 1 — Set up GCP project
Enable Vertex AI API, create service account with aiplatform.user role. For experiments, AI Studio API key is faster.
Step 2 — Install ADK
Follow Google quickstart — pip install google-adk (or current package name per docs). Verify Gemini model access in your region.
Step 3 — Define one agent
Instructions, model=gemini-2.0-flash, description of persona and constraints. Mirror your first-agent pattern.
Step 4 — Register a custom tool
Python function with type hints and docstring — ADK generates schema. Test tool independently first.
Step 5 — Add session handling
Persist conversation state across turns for support or coaching use cases.
Step 6 — Deploy to Vertex or Cloud Run
Containerize agent, configure IAM, set min instances for latency, enable Cloud Logging and Monitoring.
④ Code / config patterns
| Surface | Use case | Auth |
|---|---|---|
| AI Studio | Prototypes, personal projects | API key |
| Vertex AI | Production, enterprise | Service account / IAM |
| Agent Engine | Managed agent hosting | GCP IAM + VPC-SC |
| Cloud Run | Custom scaling, HTTP API | Workload identity |
# Conceptual ADK agent sketch
agent = Agent(
model="gemini-2.0-flash",
instruction="You are a helpful support agent. Use tools when needed.",
tools=[get_order_status, search_kb]
)
session = agent.create_session(user_id="u123")
response = session.send("Where is order 45678?")
# Tool loop handled by ADK runner⑤ Production & pitfalls
| Pitfall | Why it hurts | Fix |
|---|---|---|
| API key in production | No IAM audit trail | Vertex AI with service accounts on prod |
| Region/model availability mismatch | 404 or quota errors | Check model list per region before design |
| Unbounded tool access | Data leaks across tenants | Scope tools by user context in function |
| Skipping safety settings | Harmful or off-brand outputs | Configure Gemini safety filters and system instructions |
| No Cloud Logging | Cannot debug prod agent runs | Structured logs per session and tool call |
| Framework lock-in without eval | Hard to swap models later | Benchmark against raw Gemini API baseline |
Production tips:
- VPC Service Controls for sensitive data on Vertex
- Quota and budget alerts per project
- Grounding with Google Search for factual queries where appropriate
- Canary deploy new agent versions with traffic split
⑥ Interview / on-the-job Q&A
| Question | Answer |
|---|---|
| What is ADK? | Google toolkit to define, test, and deploy Gemini agents with tools and sessions. |
| ADK vs raw Gemini API? | ADK adds agent loop, tool wiring, session management, and deployment helpers. |
| AI Studio vs Vertex? | Studio for fast experiments; Vertex for production IAM, compliance, and scale. |
| Which Gemini model? | Flash for speed/cost; Pro for complex reasoning — match to task eval. |
| How add custom tools? | Register Python functions; ADK exposes them to the model like function calling. |
| Deployment options? | Vertex Agent Engine (managed), Cloud Run (containers), or self-hosted with ADK runner. |
⑦ Tools & ecosystem
- Platform: Google AI Studio, Vertex AI, Cloud Run
- Models: gemini-2.0-flash, gemini-2.0-pro
- Grounding: Google Search, Vertex AI Search
- Observability: Cloud Logging, Cloud Monitoring
⑧ Revision checklist
- GCP project with Vertex AI API enabled
- Auth strategy chosen (API key dev, IAM prod)
- One agent with one custom tool working locally
- Session persistence tested across 3+ turns
- Safety settings and instructions reviewed
- Tools scoped to authenticated user context
- Cloud Logging enabled before prod deploy
- Budget alerts configured
- Eval compared Flash vs Pro on representative tasks