Agents¶
智能体¶
In Agent Development Kit (ADK), an Agent is a self-contained execution unit designed to act autonomously to achieve specific goals. Agents can perform tasks, interact with users, utilize external tools, and coordinate with other agents.
在 Agent Development Kit (ADK) 中,智能体 是一个独立的执行单元,旨在自主行动以实现特定目标。智能体可以执行任务、与用户交互、利用外部工具以及与其他智能体协调。
The foundation for all agents in ADK is the BaseAgent class. It serves as the fundamental blueprint. To create functional agents, you typically extend BaseAgent in one of three main ways, catering to different needs – from intelligent reasoning to structured process control.
ADK 中所有智能体的基础是 BaseAgent 类。它作为基本的蓝图。要创建功能智能体,您通常以三种主要方式之一扩展 BaseAgent,以满足不同的需求——从智能推理到结构化过程控制。

Core Agent Categories¶
核心智能体类别¶
ADK provides distinct agent categories to build sophisticated applications:
ADK 提供不同的智能体类别来构建复杂的应用程序:
-
LLM Agents (
LlmAgent,Agent): These agents utilize Large Language Models (LLMs) as their core engine to understand natural language, reason, plan, generate responses, and dynamically decide how to proceed or which tools to use, making them ideal for flexible, language-centric tasks. Learn more about LLM Agents... -
Workflow Agents (
SequentialAgent,ParallelAgent,LoopAgent): These specialized agents control the execution flow of other agents in predefined, deterministic patterns (sequence, parallel, or loop) without using an LLM for the flow control itself, perfect for structured processes needing predictable execution. Explore Workflow Agents... -
Custom Agents: Created by extending
BaseAgentdirectly, these agents allow you to implement unique operational logic, specific control flows, or specialized integrations not covered by the standard types, catering to highly tailored application requirements. Discover how to build Custom Agents...
Choosing the Right Agent Type¶
选择正确的智能体类型¶
The following table provides a high-level comparison to help distinguish between the agent types. As you explore each type in more detail in the subsequent sections, these distinctions will become clearer.
下表提供了高级别比较,以帮助区分智能体类型。当您在后续部分更详细地探索每种类型时,这些区别将变得更加清晰。
| Feature | LLM Agent (LlmAgent) |
Workflow Agent | Custom Agent (BaseAgent subclass) |
|---|---|---|---|
| Primary Function | Reasoning, Generation, Tool Use | Controlling Agent Execution Flow | Implementing Unique Logic/Integrations |
| Core Engine | Large Language Model (LLM) | Predefined Logic (Sequence, Parallel, Loop) | Custom Code |
| Determinism | Non-deterministic (Flexible) | Deterministic (Predictable) | Can be either, based on implementation |
| Primary Use | Language tasks, Dynamic decisions | Structured processes, Orchestration | Tailored requirements, Specific workflows |
Agents¶
智能体 Working Together: Multi-Agent Systems¶
While each agent type serves a distinct purpose, the true power often comes from combining them. Complex applications frequently employ multi-agent architectures where:
- LLM Agents handle intelligent, language-based task execution.
- Workflow Agents manage the overall process flow using standard patterns.
-
Custom Agents provide specialized capabilities or rules needed for unique integrations.
-
LLM 智能体 处理智能的、基于语言的任务执行。
- 工作流智能体 使用标准模式管理整体过程流。
- 自定义智能体 为独特集成提供专业能力或规则。
Understanding these core types is the first step toward building sophisticated, capable AI applications with ADK.
理解这些核心类型是使用 ADK 构建复杂、强大的 AI 应用程序的第一步。
What's Next?¶
接下来是什么?¶
Now that you have an overview of the different agent types available in ADK, dive deeper into how they work and how to use them effectively:
既然您已经了解了 ADK 中可用的不同智能体类型,请深入了解它们的工作原理以及如何有效地使用它们:
- LLM Agents: Explore how to configure agents powered by large language models, including setting instructions, providing tools, and enabling advanced features like planning and code execution.
- Workflow Agents: Learn how to orchestrate tasks using
SequentialAgent,ParallelAgent, andLoopAgentfor structured and predictable processes. - Custom Agents: Discover the principles of extending
BaseAgentto build agents with unique logic and integrations tailored to your specific needs. - Multi-Agents: Understand how to combine different agent types to create sophisticated, collaborative systems capable of tackling complex problems.
- Models: Learn about the different LLM integrations available and how to select the right model for your agents.