Google ADK Python Skill
Expert guide for Google's Agent Development Kit (ADK) Python — open-source, code-first toolkit for building, evaluating, and deploying AI agents. Optimized for Gemini, model-agnostic by design.
When to Activate
- Build single or multi-agent systems with tool integration
- Implement A2A protocol for remote agent communication
- Integrate MCP servers as agent tools
- Use workflow agents (sequential, parallel, loop) for pipelines
- Manage sessions, state, memory, and artifacts
- Add callbacks, plugins, or observability hooks
- Deploy to Cloud Run, Vertex AI Agent Engine, or GKE
- Evaluate agents with
adk eval framework
Agent Structure Convention (Required)
my_agent/
├── __init__.py # MUST: from . import agent
└── agent.py # MUST: root_agent = Agent(...) OR app = App(...)
Quick Start
pip install google-adk # stable (weekly releases)
uv sync --all-extras # dev setup (uv required, Python 3.10+, 3.11+ recommended)
from google.adk import Agent
root_agent = Agent(
name="assistant",
model="gemini-2.5-flash",
instruction="You are a helpful assistant.",
description="General assistant agent.",
tools=[get_weather],
)
App Pattern (Production)
from google.adk import Agent
from google.adk.apps import App
from google.adk.apps.app import EventsCompactionConfig
from google.adk.plugins.save_files_as_artifacts_plugin import SaveFilesAsArtifactsPlugin
app = App(
name="my_app",
root_agent=Agent(name="my_agent", model="gemini-2.5-flash", ...),
plugins=[SaveFilesAsArtifactsPlugin()],
events_compaction_config=EventsCompactionConfig(compaction_interval=2),
)
Use App when needing plugins, event compaction, or custom lifecycle management.
CLI Tools
| Command |
Purpose |
adk web <agents_dir> |
Dev UI (recommended for development) |
adk run <agent_dir> |
Interactive CLI testing |
adk api_server <agents_dir> |
FastAPI production server |
adk eval <agent> <evalset.json> |
Run evaluation suite |
Agent Types
| Type |
Use Case |
Agent / LlmAgent |
Dynamic routing, tool use, reasoning |
SequentialAgent |
Fixed-order pipeline |
ParallelAgent |
Concurrent execution |
LoopAgent |
Iterative processing |
RemoteA2aAgent |
Remote agent via A2A protocol |
Key APIs
| Feature |
API |
| State |
tool_context.state[key] = value |
| Artifacts |
tool_context.save_artifact(name, part) |
| Callbacks |
before_agent_callback, after_model_callback, etc. |
| MCP Tools |
MCPToolset(connection_params=StdioConnectionParams(...)) |
| Sub-agents |
Agent(..., sub_agents=[agent1, agent2]) |
| Human-in-loop |
LongRunningFunctionTool(func=my_func) |
| Plugins |
App(..., plugins=[MyPlugin()]) |
Model Support
Latest: gemini-2.5-flash (default), gemini-2.5-pro, gemini-2.0-flash (sunsets Mar 2026)
Preview: gemini-3-flash-preview, gemini-3-pro-preview
Also: Anthropic Claude, Ollama, LiteLLM, vLLM, Model Garden
Best Practices
- Code-first — define agents in Python for version control and testing
- Agent convention — always use
root_agent or app variable in agent.py
- Modular agents — specialize per domain, compose via
sub_agents
- Workflow selection — workflow agents for predictable, LlmAgent for dynamic
- State —
ToolContext.state for ephemeral, MemoryService for long-term
- Safety — callbacks for guardrails, tool confirmation for sensitive ops
- Evaluate — test with
adk eval + evalset JSON before deployment
References
Detailed guides (load as needed):
references/agent-types-and-architecture.md — Agent types, workflows, custom agents
references/tools-and-mcp-integration.md — Custom tools, MCP, tool filtering
references/multi-agent-and-a2a-protocol.md — Sub-agents, A2A, coordinator patterns
references/sessions-state-memory-artifacts.md — State, artifacts, sessions, memory
references/callbacks-plugins-observability.md — Lifecycle hooks, plugins, tracing
references/evaluation-testing-cli.md — adk eval, CLI, evalset format
references/deployment-cloud-run-vertex-gke.md — Cloud Run, Vertex AI, GKE
External Resources
1---2name: ck-google-adk-python3description: Build AI agents with Google ADK Python. Multi-agent systems, A2A protocol, MCP tools, workflow agents, state/memory, callbacks/plugins, Vertex AI deployment, evaluation.4license: Apache-2.05---6
7# Google ADK Python Skill
8
9Expert guide for Google's Agent Development Kit (ADK) Python — open-source, code-first toolkit for building, evaluating, and deploying AI agents. Optimized for Gemini, model-agnostic by design.
10
11## When to Activate
12
13- Build single or multi-agent systems with tool integration
14- Implement A2A protocol for remote agent communication
15- Integrate MCP servers as agent tools
16- Use workflow agents (sequential, parallel, loop) for pipelines
17- Manage sessions, state, memory, and artifacts
18- Add callbacks, plugins, or observability hooks
19- Deploy to Cloud Run, Vertex AI Agent Engine, or GKE
20- Evaluate agents with `adk eval` framework
21
22## Agent Structure Convention (Required)
23
24```
25my_agent/
26├── __init__.py # MUST: from . import agent
27└── agent.py # MUST: root_agent = Agent(...) OR app = App(...)
28```
29
30## Quick Start
31
32```bash
33pip install google-adk # stable (weekly releases)
34uv sync --all-extras # dev setup (uv required, Python 3.10+, 3.11+ recommended)
35```
36
37```python
38from google.adk import Agent
39
40root_agent = Agent(
41 name="assistant",
42 model="gemini-2.5-flash",
43 instruction="You are a helpful assistant.",
44 description="General assistant agent.",
45 tools=[get_weather],
46)
47```
48
49## App Pattern (Production)
50
51```python
52from google.adk import Agent
53from google.adk.apps import App
54from google.adk.apps.app import EventsCompactionConfig
55from google.adk.plugins.save_files_as_artifacts_plugin import SaveFilesAsArtifactsPlugin
56
57app = App(
58 name="my_app",
59 root_agent=Agent(name="my_agent", model="gemini-2.5-flash", ...),
60 plugins=[SaveFilesAsArtifactsPlugin()],
61 events_compaction_config=EventsCompactionConfig(compaction_interval=2),
62)
63```
64
65Use `App` when needing plugins, event compaction, or custom lifecycle management.
66
67## CLI Tools
68
69| Command | Purpose |
70|---------|---------|
71| `adk web <agents_dir>` | Dev UI (recommended for development) |
72| `adk run <agent_dir>` | Interactive CLI testing |
73| `adk api_server <agents_dir>` | FastAPI production server |
74| `adk eval <agent> <evalset.json>` | Run evaluation suite |
75
76## Agent Types
77
78| Type | Use Case |
79|------|----------|
80| `Agent` / `LlmAgent` | Dynamic routing, tool use, reasoning |
81| `SequentialAgent` | Fixed-order pipeline |
82| `ParallelAgent` | Concurrent execution |
83| `LoopAgent` | Iterative processing |
84| `RemoteA2aAgent` | Remote agent via A2A protocol |
85
86## Key APIs
87
88| Feature | API |
89|---------|-----|
90| State | `tool_context.state[key] = value` |
91| Artifacts | `tool_context.save_artifact(name, part)` |
92| Callbacks | `before_agent_callback`, `after_model_callback`, etc. |
93| MCP Tools | `MCPToolset(connection_params=StdioConnectionParams(...))` |
94| Sub-agents | `Agent(..., sub_agents=[agent1, agent2])` |
95| Human-in-loop | `LongRunningFunctionTool(func=my_func)` |
96| Plugins | `App(..., plugins=[MyPlugin()])` |
97
98## Model Support
99
100Latest: `gemini-2.5-flash` (default), `gemini-2.5-pro`, `gemini-2.0-flash` (sunsets Mar 2026)
101Preview: `gemini-3-flash-preview`, `gemini-3-pro-preview`
102Also: Anthropic Claude, Ollama, LiteLLM, vLLM, Model Garden
103
104## Best Practices
105
1061. **Code-first** — define agents in Python for version control and testing
1072. **Agent convention** — always use `root_agent` or `app` variable in `agent.py`
1083. **Modular agents** — specialize per domain, compose via `sub_agents`
1094. **Workflow selection** — workflow agents for predictable, LlmAgent for dynamic
1105. **State** — `ToolContext.state` for ephemeral, `MemoryService` for long-term
1116. **Safety** — callbacks for guardrails, tool confirmation for sensitive ops
1127. **Evaluate** — test with `adk eval` + evalset JSON before deployment
113
114## References
115
116Detailed guides (load as needed):
117
118- `references/agent-types-and-architecture.md` — Agent types, workflows, custom agents
119- `references/tools-and-mcp-integration.md` — Custom tools, MCP, tool filtering
120- `references/multi-agent-and-a2a-protocol.md` — Sub-agents, A2A, coordinator patterns
121- `references/sessions-state-memory-artifacts.md` — State, artifacts, sessions, memory
122- `references/callbacks-plugins-observability.md` — Lifecycle hooks, plugins, tracing
123- `references/evaluation-testing-cli.md` — adk eval, CLI, evalset format
124- `references/deployment-cloud-run-vertex-gke.md` — Cloud Run, Vertex AI, GKE
125
126## External Resources
127
128- GitHub: https://github.com/google/adk-python
129- Docs: https://google.github.io/adk-docs/
130- Samples: https://github.com/google/adk-python/tree/main/contributing/samples
131- llms.txt: https://raw.githubusercontent.com/google/adk-python/refs/heads/main/llms.txt