框架 · Google
快速了解 Google ADK
Google 的 Agent Development Kit 提供 Python、TypeScript、Go、Java 和 Kotlin SDK,并将评估功能集成在核心中。它优先支持 Gemini,也可通过适配器接入其他模型,并可部署到 Google Cloud 上的 Agent Runtime。
适用于: 使用多种语言、希望构建优先支持 Gemini 的 agent、内置评估功能并直接部署到 Google Cloud 的团队。
关键信息
- 维护者
- 语言
- Python, TypeScript, Go, Java, Kotlin
- 许可证
- Apache-2.0
- 最新版本
Python 2.10.0· 2026年9月25日- 代码仓库
- google/adk-python
- 托管选项
- Agent Runtime on Gemini Enterprise Agent Platform (formerly Vertex AI Agent Engine); also Cloud Run, GKE
快速入门
安装软件包、设置凭据,然后运行官方文档中的最简 agent。这里使用的模型 ID 与文档一致,但你的账户可能尚未启用这些模型。
Python
pip install google-adk && adk create my_agent (run with: adk run my_agent or adk web --port 8000)from google.adk.agents.llm_agent import Agent
# Mock tool implementation
def get_current_time(city: str) -> dict:
"""Returns the current time in a specified city."""
return {"status": "success", "city": city, "time": "10:30 AM"}
root_agent = Agent(
model='gemini-flash-latest',
name='root_agent',
description="Tells the current time in a specified city.",
instruction="You are a helpful assistant that tells the current time in cities. Use the 'get_current_time' tool for this purpose.",
tools=[get_current_time],
)TypeScript
npm install @google/adk (inferred from package name; not copied from docs)import { LlmAgent, GOOGLE_SEARCH } from '@google/adk';
const agent = new LlmAgent({
name: 'researcher',
model: 'gemini-flash-latest',
instruction: 'You help users research topics thoroughly.',
tools: [GOOGLE_SEARCH],
});功能
| 支持任意模型 | 是 | 优先支持 Gemini;其他模型可通过 LiteLLM 和本地适配器接入 |
|---|---|---|
| MCP 客户端 | 是 | McpToolset;可选择对每个工具单独要求确认 |
| MCP 服务器 | 是 | 通过 to_mcp_server() 将 agent 暴露为 MCP server |
| 多 agent | 是 | 支持子 agent 树;ADK 2.0 起还支持图工作流 |
| 持久化运行 | 是 | 恢复已停止的 agent;Agent Runtime 可保留长时间运行状态 |
| 人工审批 | 是 | 通过 require_confirmation=True 要求确认工具调用 |
| 追踪 | 是 | 基于 OpenTelemetry;在 Google Cloud 上使用 Cloud Trace |
| 评测 | 是 | 评估是 ADK 的核心功能 |
近期更新
- ADK 2.0 新增了基于图的工作流。
- 新增 Kotlin SDK,与 Python、TypeScript、Go 和 Java SDK 并列。
- 文档迁移至 adk.dev。
- Vertex AI Agent Engine 更名为 Gemini Enterprise Agent Platform 上的 Agent Runtime。