1.1 KiB
1.1 KiB
title, type, tags, sources, last_updated
| title | type | tags | sources | last_updated | |
|---|---|---|---|---|---|
| System-Prompt-Layering | concept |
|
2026-05-02 |
Definition
System Prompt Layering 是一种前端提示词与 Agent 核心提示词分层叠加的机制,确保前端传入的提示词不会覆盖 Agent 原有的工具集和能力。
Mechanism
当通过 API Server 调用 Hermes Agent 时:
- 基础层:Agent 核心系统提示词(包含完整工具集、Skills、记忆配置)
- 叠加层:前端传入的 system prompt(Chat Completions 的
system消息,或 Responses API 的instructions字段) - 结果:两层提示词叠加,Agent 保留全部原生能力
Example
// Chat Completions 请求
{
"model": "hermes-agent",
"messages": [
{"role": "system", "content": "你是一个友好的助手"}, // 叠加层
{"role": "user", "content": "hello"}
]
}
Key Benefit
前端可以定制对话风格(如角色扮演、语气调整),同时不影响 Agent 的核心工具能力。