一、问题的起点
先看一个明确的目标:怎样让智能体能够无限制地新增技能包,而且不用修改核心代码?
这个诉求在工程上其实就是可扩展性与可维护性。当技能从 3 个增长到 300 个时,如果每加一个技能都要回头改动主流程,系统很快就会变成一团泥潭。Hermes agent 给出的解法是:分层解耦,每一层各自负责专一的职责,不同层级之间互不干扰。
二、四层架构:把 Agent 当成一家公司
Hermes agent 把整个智能体的能力严格拆成四层,自上而下依次是:
- 接入层 → 统一入口、鉴权、格式化输出
- 核心编排层 → 理解意图、拆解任务、调度执行
- 技能管理层 → 扫描、加载、缓存、校验技能包
- 工具执行层 → 真正干活的代码
一个很好用的类比是公司组织架构:越往上层越负责重要的智能决策,越往底层越倾向于真实的执行落地;就像公司里越往基层的员工,负责越具体、越落实到位的工作。
第 1 层:接入层(统一入口)
接入层是整个系统的统一入口,负责统一接收用户请求。请求可能来自终端、Hermes agent 的桌面端可视化页面,也可能来自第三方平台(例如通过 QQ 机器人助手)。
它的三件事:
- 统一接收——不管从哪个入口发来的信息,都能统一收下
- 鉴权认证——认证用户是否有调用智能体系统的权限
- 统一输出——统一数据格式并返回结果
关键约束:接入层不处理任何业务逻辑。它就像公司最上层的管理者,只负责对接市场需求、交付最终结果。
第 2 层:核心编排层(大脑)
用户请求进来后,"真正决定用户想干什么、按几个步骤执行、先做什么后做什么",都由核心编排层处理。它就像智能体的大脑:
- 理解用户意图,分析语音/文本内容
- 提取任务
- 把任务拆解成多个步骤
- 按流程调度执行每一个步骤
第 3 层:技能管理层(技能管家)
想清楚每一步后,就要去找对应的能力——"找能力、管能力"交给技能管理层。它像一个技能管家,主要职责是:
- 扫描技能包
- 加载对应技能
- 将技能缓存
- 校验技能包的安全性
- 管理技能的生命周期
这一层的核心价值在于解耦:后续新增、删除或更新任何技能包,只需要改动这一层,不需要改动其他层级。但要注意——它只负责技能管理,不负责真正的落地执行。
第 4 层:工具执行层(双手)
真正负责落地执行的是工具执行层,它就像人的双手,执行真正干活的代码:
- 可以是一个函数
- 可以是一个脚本文件
- 也可以是调用外部 API
这些工具都统一在这一层注册,供上层技能层调用。
分层带来的直接收益
一层一层往下交接,带来的直接好处是:技能调度逻辑和底层执行逻辑被彻底隔离开。以后需要新增任何技能,不需要修改其他层级的代码——这就是智能体系统工程化设计的体现,让系统做到可扩展、可维护。
三、四个落地组件
讲完架构分层,再落到四个具体组件——它们是上述四层架构的实现载体。
1. 任务规划器(对应编排层)
核心职责:把用户一句模糊的语言拆解、理解核心意图,再变成智能体可以执行的任务流程。
因为用户的需求往往模糊、复杂,只有一个主问题;智能体需要先明确需求,再拆分成有依赖关系的子任务。
举例:用户说"帮我检查代码质量并生成报告",任务规划器会拆成两个步骤:
- 先分析需要检查的代码
- 分析完后再生成检查报告
拆完后,交给技能路由。
2. 技能路由器(跨层桥梁)
这是一个特殊组件:它横跨技能编排层与技能管理层,由编排层触发调用,但比对的是技能管理层维护的技能索引——可以理解为连接两层的桥梁,而不是单独属于某一层。
核心职责:给每个子任务准确匹配最合适的技能,也就是分析出每一步需要用到哪个技能包。
完整流程:
- 读取子任务描述
- 在技能索引中比对所有技能包的名称与描述,做语义匹配
- 筛选出最匹配的技能包
- 加载该技能包的完整内容
- 把加载出来的参数传递给下一层执行
一句话概括:规划器做计划,路由器把计划中的每一步和对应能力匹配上。
3. 技能管理器(核心中枢)
这是技能系统中的核心中枢,也是本节最重要的组件。所有技能(包括生命周期)都由它统一管控。执行流程是:
- 发现:找到系统中存放技能包的目录
- 扫描解析:自动扫描目录,解析其中的元数据
- 构建索引:建立全局索引,这样智能体才知道当前有哪些技能可用
- 分层加载:构建好索引后才方便做分层加载,按需加载、不占用过多资源
- 缓存:把已加载过的技能包缓存到内存,避免每次重复扫描、重复读取,提升响应速度
- 安全检查:整条链路上始终贯穿——对技能内容做注入检查,防止恶意提示词或非法逻辑混入技能包
因此,技能管理器本身不负责执行具体业务逻辑,它管的是所有技能包从被发现到被使用的全过程。
4. 工具注册中心(能力注册)
先区分两个概念:技能是业务能力的抽象描述,工具是真正可执行的代码实现。
工具注册中心把所有可执行的工具代码在此注册——可以是函数、脚本文件,或通过 MCP 连接的外部工具。它的设计价值在于解耦:把工具与技能解耦。上传的技能包只需要说明"我需要什么工具"以及"调用工具的路径"。
这样分层管理后:要修改技能包 → 去技能管理器;要管理所有工具 → 去工具注册中心。按职责划分,分别管理技能包与工具文件。
四、七步执行闭环
把架构和组件串起来,就是 Hermes 中按七步执行流程实现的任务闭环:
这七个步骤串起来,就是把前面的四层架构 + 四个组件按时间顺序执行一遍。
五、最值得记住的设计思想
有一个设计思想特别值得注意:技能的加载周期和任务的执行周期是精准绑定的——需要用的时候才去加载,用完后释放冗余资源。
正是这一点,让 Hermes agent 能做到轻量化、低资源消耗、支持海量技能扩展。换句话说,架构的价值不仅在"能分层",更在于"分层之后每层的开销都可控"。
六、小结
本文的脉络:
- 四层架构的分层解耦思想:接入层 → 核心编排层 → 技能管理层 → 工具执行层
- 四大核心组件:任务规划器、技能路由器、技能管理器、工具注册中心,各自的职责与相互关系
- 七步执行闭环:接收请求 → 拆子任务 → 匹配技能 → 取工具 → 执行 → 释放资源 → 返回结果
到这里,我们对技能包相关的架构设计思想与组件协同关系都做了分析。但当前还停留在认知层——后续需要搭建一套简化的架构设计代码,把理论变成可运行的 Python 代码,落地成一个知识技能可扩展的轻量级智能体系统。
本文由 AI图鉴自动抓取并翻译,版权归原作者所有;如需查看原文请点下方链接。
I. Starting point of the problem
First, there is a clear objective: how can AI agent be able to add skills packages without restriction and without changing the core code?
The claim is in effect expansive and maintenanceist. When skills grow from 3 to 300, if each skill is to change the main process back, the system quickly becomes a muddy patch. The solution given by Hermes delegate is to decompose the layers, each of which is responsible for a single function, without interference between the different levels.
II. Four-tier architecture: treating Agent as a company
Hermes anent has severed the entire AI agent capability into four layers, top down:
- Access layer – Unified access, assurance, format output
- Core layer, understand intent, dismantle tasks, schedule execution.
Scanning, loading, cache, verifying skill packages
- The tool enforcement level.
A good analogy is the corporate organizational structure: the higher the top, the more responsible for important intellectual decision-making, the lower the bottom, the more oriented towards real implementation; just as the staff in the company move to the grass-roots level, the more specific, the more in place.
Level 1: Access layer (Unified entrance)
The level of access is the single entry point for the system as a whole and is responsible for the unified receipt of user requests. The request may come from a desktop-end visualization page of the terminal, Hermes anent, or from a third-party platform (e.g. via a QQQ robotian assistant).
It's three things:
- Unanimously receive -- receive the information from whatever entrance.
- Forensic authentication — authentication of the user's access to AI agent system permission
- Harmonized Output - Harmonized Data Formats and Return Results
Key constraints: Access layers do not address any business logic. It is like the top managers of a company and is responsible only for matching market demand and delivering the final results.
Layer 2: Core layer (brain)
When the user requests to come in, "real determination of what the user wants to do, how many steps to do, what to do first" is handled by the core layer. It's like AI agent's brain:
- Understand user intent and analyse voice/text content
- Ripping jobs.
- Dismantling the mission into multiple steps.
- Run every step by process.
Level 3: Skills management (skill housekeeper)
Think clearly of each step and then find a match — "Capacity, Managership" to the skilled management. It's like a skilled butler, whose main duties are:
- Scan skill pack
- Loading matching skills
- Skill cache.
- Validation of security of skill packages
- Life cycle of management skills
The core value of this layer lies in decoupling: any skill packages will be added, deleted or updated as a follow-up, with only changes to this layer and no changes to other layers. However, care should be taken — it is responsible only for skills management and not for real implementation.
Layer 4: Tool Implementation Level (Hands)
The real responsible implementation is the tool implementation level, which is like the hands of a man, the code for real work:
- Could be a function.
- Could be a script.
- Or call the outside API.
These tools are centrally registered at this level and are available at the upper skill level.
Direct proceeds from stratification
The direct benefit of a one-tier transition is that the skills movement logic and the bottom implementation logic are completely isolated. Any additional skills will be required in the future, and no changes to the codes at other levels will be required - This is a reflection of the engineering design of the AI agent system to make it scalable and sustainable.
Three or four landing components
At the end of the architecture layer, four more specific components — these are the realization carriers of the above-mentioned four layers of architecture — were dropped.
1. Mission planner (comparable layer)
Core responsibilities: Dismantling the user ' s vague language and understanding the core intent into a task process that AI agent can perform.
Since user needs are often vague and complex, there is only one main problem; AI agent needs to identify needs before split becomes subtask, which is dependent.
For example, the user says, "Help me check the quality of the code and generate the report", and the task planner breaks into two steps:
- Analyse the codes that need to be checked.
- Generate inspection reports after analysis.
When it's done, give it to the skills route.
2. Skills routers (cross-layer bridges)
This is a special component: it cuts across the skill hierarchy and skills management and is triggered by the hierarchy, but compared to the skills index maintained by the skills management, which can be understood as a bridge connecting two layers, rather than being a separate layer.
Core responsibilities: Accurately match each subtask with the most appropriate skills, i.e., analyse which skill packs are needed for each step.
Full process:
- Read subtask description.
- Matching the names and descriptions of all skill packages with semantics in the skills index
- Sieve out the best match.
- Load the complete contents of the skill kit.
- Pass the loaded parameters to the next level of execution.
In summary, the planner plans and the router matches each step of the plan with the corresponding capacity.
3. Skills manager (core hub)
This is the core hub of the skills system and the most important component of this section. All skills (including life cycle) are centrally controlled by it. The implementation process is:
- Found: find a directory of skills packages stored in the system
- Scan Resolution: Automatically scan directories to analyze metadata
- Indexing: create a global index so that AI agent knows what skills are available
- Layer loading: build index to facilitate layer loading, load on demand, without excessive resources
- cache: Bring loaded skill pack cache to memory, avoid every double scan, repeat reading and increase response speed
- Security checks: throughout the chain - Injection of skill content to prevent malicious prompt or illegal logic from blending into skill packages
Therefore, the skills manager itself is not responsible for the implementation of the specific business logic, but is responsible for the entire process of all skill packages from their discovery to their use.
4. Tool registration centre (capacity registration)
First, two concepts are distinguished: skills are abstract descriptions of operational capabilities and tools are truly implementable codes.
The Tool Registration Centre registers all enforceable tool codes here - it can be a function, a script file, or an external tool connected through MCP. Its design value lies in decoupling: decorating tools and skills. The uploading of the skill pack just needs to indicate "what tools I need" and "the path to the call tool."
This layer is managed by modifying the skill pack to the skills manager; managing all tools to the tool registration centre. Management of skills packages and tool files by function.
Four or seven steps to implement the closed circle.
Collating structures and components is the seven-step process closed loop in Hermes:
These seven steps are followed by a four-layer structure plus four components in chronological order.
V. The most noteworthy design thinking
One design idea is particularly noteworthy: the skill loading cycle and the mission implementation cycle are precisely tied — loading only when needed and releasing redundant resources when spent.
That's what makes Hermes anent light quantization, low resource consumption, and support for massive skill expansion. In other words, the value of the architecture is not only in the "capable layer" but also in the "controllable cost of every layer after the layer."
Summary
Here's the connection:
- The idea of a four-layer architecture: an access layer, a core layer, a skills management layer, a tool implementation layer.
- Four core components: mission planners, skills routers, skills managers, tool registration centres, respective roles and interrelationships
- Seven steps to implement closed loops: receive requests → subtask Z match skills Z take tools → release resources → return results
Here, we've done an analysis of the architecture thinking and component synergy associated with the skill pack. But it is still on the cognitive level — it will follow with a simplified architecture design code that will transform the theory into a functional Python code and a light-size AI agent system with expanded knowledge skills.
Auto-fetched and translated by AI Atlas. All rights belong to the original author.