在
技能
架构中,专门的能力被打包为可调用的"技能",以增强
智能体
的行为。技能主要是提示词驱动的专业化能力,智能体可以按需调用。
For a complete implementation, see the tutorial below.
主要特点
- 提示词驱动的专业化:技能主要由专门的提示词定义
- 渐进式披露:技能根据上下文或用户需求变得可用
- 团队分布:不同的团队可以独立开发和维护技能
- 轻量级组合:技能比完整的子智能体更简单
何时使用
当您想要一个具有多种可能专业化的单一 智能体 、不需要在技能之间强制执行特定约束,或者不同的团队需要独立开发能力时,请使用技能模式。常见示例包括编码助手(不同语言或任务的技能)、知识库(不同领域的技能)和创意助手(不同格式的技能)。基本实现
Tutorial: Build a SQL assistant with on-demand skills
Learn how to implement skills with progressive disclosure, where the agent loads specialized prompts and schemas on-demand rather than upfront.
Extending the pattern
When writing custom implementations, you can extend the basic skills pattern in several ways:- Dynamic tool registration : Combine progressive disclosure with state management to register new tools as skills load. For example, loading a “database_admin” skill could both add specialized context and register database-specific tools (backup, restore, migrate). This uses the same tool-and-state mechanisms used across multi-agent patterns—tools updating state to dynamically change agent capabilities.
- Hierarchical skills : Skills can define other skills in a tree structure, creating nested specializations. For instance, loading a “data_science” skill might make available sub-skills like “pandas_expert”, “visualization”, and “statistical_analysis”. Each sub-skill can be loaded independently as needed, allowing for fine-grained progressive disclosure of domain knowledge. This hierarchical approach helps manage large knowledge bases by organizing capabilities into logical groupings that can be discovered and loaded on-demand.