Agent Development Kit (ADK)¶
智能体开发工具包 (ADK)¶
Build, Evaluate and Deploy agents, seamlessly!
无缝构建、评估和部署智能体!
ADK is designed to empower developers to build, manage, evaluate and deploy AI-powered agents. It provides a robust and flexible environment for creating both conversational and non-conversational agents, capable of handling complex tasks and workflows.
ADK旨在帮助开发者构建、管理、评估和部署AI驱动的智能体。它为创建对话式和非对话式智能体提供了强大而灵活的环境,能够处理复杂的任务和工作流程。

Core Concepts¶
核心概念¶
ADK is built around a few key primitives and concepts that make it powerful and flexible. Here are the essentials:
ADK建立在几个关键原语和概念之上,使其强大而灵活。以下是基本概念:
-
Agent: The fundamental worker unit designed for specific tasks. Agents can use language models (
LlmAgent) for complex reasoning, or act as deterministic controllers of the execution, which are called "workflow agents" (SequentialAgent,ParallelAgent,LoopAgent). 智能体: 为特定任务设计的基本工作单元。智能体可以使用语言模型 (LlmAgent) 进行复杂推理,或作为执行的确定性控制器,被称为"工作流智能体" (SequentialAgent,ParallelAgent,LoopAgent)。 -
Tool: Gives agents abilities beyond conversation, letting them interact with external APIs, search information, run code, or call other services. 工具: 赋予智能体超越对话的能力,让它们能够与外部API交互、搜索信息、运行代码或调用其他服务。
-
Callbacks: Custom code snippets you provide to run at specific points in the agent's process, allowing for checks, logging, or behavior modifications. 回调: 您提供的自定义代码片段,在智能体流程的特定点运行,允许检查、日志记录或行为修改。
-
Session Management (
Session&State): Handles the context of a single conversation (Session), including its history (Events) and the agent's working memory for that conversation (State). 会话管理 (Session&State): 处理单个对话 (Session) 的上下文,包括其历史 (Events) 和该对话的智能体工作内存 (State)。 -
Memory: Enables agents to recall information about a user across multiple sessions, providing long-term context (distinct from short-term session
State). 记忆: 使智能体能够在多个会话中回忆关于用户的信息,提供长期上下文(与短期会话State不同)。 -
Artifact Management (
Artifact): Allows agents to save, load, and manage files or binary data (like images, PDFs) associated with a session or user. 工件管理 (Artifact): 允许智能体保存、加载和管理与会话或用户关联的文件或二进制数据(如图像、PDF)。 -
Code Execution: The ability for agents (usually via Tools) to generate and execute code to perform complex calculations or actions. 代码执行: 智能体(通常通过工具)生成和执行代码以执行复杂计算或操作的能力。
-
Planning: An advanced capability where agents can break down complex goals into smaller steps and plan how to achieve them like a ReAct planner. 规划: 智能体将复杂目标分解为更小步骤并计划如何实现它们的高级能力,如ReAct规划器。
-
Models: The underlying LLM that powers
LlmAgents, enabling their reasoning and language understanding abilities. 模型: 驱动LlmAgent的底层LLM,使其具备推理和语言理解能力。 -
Event: The basic unit of communication representing things that happen during a session (user message, agent reply, tool use), forming the conversation history. 事件: 代表会话期间发生的事情(用户消息、智能体回复、工具使用)的基本通信单元,形成对话历史。
-
Runner: The engine that manages the execution flow, orchestrates agent interactions based on Events, and coordinates with backend services. 运行器: 管理执行流程、基于事件编排智能体交互以及与后端服务协调的引擎。
Note: Features like Multimodal Streaming, Evaluation, Deployment, Debugging, and Trace are also part of the broader ADK ecosystem, supporting real-time interaction and the development lifecycle.
注意: 多模态流式传输、评估、部署、调试和追踪等功能也是更广泛ADK生态系统的一部分,支持实时交互和开发生命周期。
Key Capabilities¶
关键能力¶
ADK offers several key advantages for developers building agentic applications:
ADK为构建智能体应用程序的开发者提供了几个关键优势:
-
Multi-Agent System Design: Easily build applications composed of multiple, specialized agents arranged hierarchically. Agents can coordinate complex tasks, delegate sub-tasks using LLM-driven transfer or explicit
AgentToolinvocation, enabling modular and scalable solutions. 多智能体系统设计: 轻松构建由多个层次排列的专用智能体组成的应用程序。智能体可以协调复杂任务,使用LLM驱动的传输或显式AgentTool调用委托子任务,实现模块化和可扩展的解决方案。 -
Rich Tool Ecosystem: Equip agents with diverse capabilities. ADK supports integrating custom functions (
FunctionTool), using other agents as tools (AgentTool), leveraging built-in functionalities like code execution, and interacting with external data sources and APIs (e.g., Search, Databases). Support for long-running tools allows handling asynchronous operations effectively. 丰富的工具生态系统: 为智能体配备多样化能力。ADK支持集成自定义函数 (FunctionTool),将其他智能体用作工具 (AgentTool),利用内置功能如代码执行,以及与外部数据源和API(如搜索、数据库)交互。对长时间运行工具的支持允许有效处理异步操作。 -
Flexible Orchestration: Define complex agent workflows using built-in workflow agents (
SequentialAgent,ParallelAgent,LoopAgent) alongside LLM-driven dynamic routing. This allows for both predictable pipelines and adaptive agent behavior. 灵活编排: 使用内置工作流智能体 (SequentialAgent,ParallelAgent,LoopAgent) 以及LLM驱动的动态路由来定义复杂的智能体工作流。这允许既可预测的管道和自适应智能体行为。 -
Integrated Developer Tooling: Develop and iterate locally with ease. ADK includes tools like a command-line interface (CLI) and a Developer UI for running agents, inspecting execution steps (events, state changes), debugging interactions, and visualizing agent definitions. 集成开发工具: 轻松在本地开发和迭代。ADK包括命令行界面 (CLI) 和开发者UI等工具,用于运行智能体、检查执行步骤(事件、状态更改)、调试交互和可视化智能体定义。
-
Native Streaming Support: Build real-time, interactive experiences with native support for bidirectional streaming (text and audio). This integrates seamlessly with underlying capabilities like the Multimodal Live API for the Gemini Developer API (or for Vertex AI), often enabled with simple configuration changes. 原生流式传输支持: 构建实时交互体验,支持双向流式传输(文本和音频)。这与底层功能(如Gemini开发者API的多模态实时API或Vertex AI的多模态实时API)无缝集成,通常只需简单的配置更改即可启用。
-
Built-in Agent Evaluation: Assess agent performance systematically. The framework includes tools to create multi-turn evaluation datasets and run evaluations locally (via CLI or the dev UI) to measure quality and guide improvements. 内置智能体评估: 系统评估智能体性能。该框架包括创建多轮评估数据集和在本地运行评估(通过CLI或开发UI)的工具,以衡量质量并指导改进。
-
Broad LLM Support: While optimized for Google's Gemini models, the framework is designed for flexibility, allowing integration with various LLMs (potentially including open-source or fine-tuned models) through its
BaseLlminterface. 广泛的LLM支持: 虽然针对Google的Gemini模型进行了优化,但该框架设计灵活,允许通过各种LLM(可能包括开源或微调模型)的BaseLlm接口集成。 -
Artifact Management: Enable agents to handle files and binary data. The framework provides mechanisms (
ArtifactService, context methods) for agents to save, load, and manage versioned artifacts like images, documents, or generated reports during their execution. 工件管理: 使智能体能够处理文件和二进制数据。该框架提供机制 (ArtifactService, 上下文方法),让智能体能够在执行期间保存、加载和管理版本化工件,如图像、文档或生成的报告。 -
Extensibility and Interoperability: ADK promotes an open ecosystem. While providing core工具, it allows developers to easily integrate and reuse third-party tools and data connectors. 可扩展性和互操作性: ADK促进开放生态系统。在提供核心工具的同时,它允许开发者轻松集成和重用第三方工具和数据连接器。
-
State and Memory Management: Automatically handles short-term conversational memory (
Statewithin aSession) managed by theSessionService. Provides integration points for longer-termMemoryservices, allowing agents to recall user information across multiple sessions. 状态和记忆管理: 自动处理由SessionService管理的短期对话内存 (Session中的State)。为长期Memory服务提供集成点,允许智能体在多个会话中回忆用户信息。

Get Started¶
开始使用¶
- Ready to build your first agent? Try the quickstart
- 准备好构建您的第一个智能体了吗? 尝试快速入门