跳到主要内容

使用 SOUL.md 配合 Hermes

SOUL.md 是你的 Hermes 实例的核心身份标识。它是系统提示中的第一部分——定义了代理的身份、表达方式以及应避免的内容。

如果你想让 Hermes 每次与你对话时都保持一致的助手形象,或者想完全用你自己的人格替换 Hermes 的默认形象,那么这个文件就是你要使用的。

SOUL.md 的用途

使用 SOUL.md 来定义:

  • 语气
  • 个性
  • 沟通风格
  • Hermes 应该多直接或温暖
  • Hermes 在风格上应避免什么
  • Hermes 如何应对不确定性、分歧和模糊性

简而言之:

  • SOUL.md 关注的是 Hermes 是谁,以及它如何表达

SOUL.md 不适用于

不要在其中使用:

  • 项目特定的编码规范
  • 文件路径
  • 命令
  • 服务端口
  • 架构说明
  • 项目工作流指南

这些内容应放在 AGENTS.md 中。

一个简单的判断原则:

  • 如果它应该在所有场景下适用,请放入 SOUL.md
  • 如果它仅属于某个特定项目,请放入 AGENTS.md

文件位置

Hermes 现在仅使用当前实例的全局 SOUL 文件:

~/.hermes/SOUL.md

如果你使用自定义主目录运行 Hermes,则路径变为:

$HERMES_HOME/SOUL.md

首次运行行为

如果不存在 SOUL.md,Hermes 会自动为你生成一个初始版本。

这意味着大多数用户现在可以直接获得一个可读可编辑的真实文件。

重要提示:

  • 如果你已存在 SOUL.md,Hermes 不会覆盖它
  • 如果文件存在但为空,Hermes 不会从其中添加任何内容到提示中

Hermes 如何使用它

当 Hermes 启动会话时,它会从 HERMES_HOME 读取 SOUL.md,扫描其中是否存在提示注入模式,必要时进行截断,并将其作为代理身份——即系统提示中的第 #1 个槽位。这意味着 SOUL.md 完全取代内置的默认身份文本。

如果 SOUL.md 缺失、为空或无法加载,Hermes 将回退到内置的默认身份。

不会在文件外添加任何包装语言。内容本身才是关键——以你希望代理思考和表达的方式书写。

一次有效的首次修改

如果你不做其他操作,只需打开文件并修改几行,使其更符合你的感觉。

例如:

You are direct, calm, and technically precise.
Prefer substance over politeness theater.
Push back clearly when an idea is weak.
Keep answers compact unless deeper detail is useful.

仅此一项就能显著改变 Hermes 的感觉。

示例风格

1. 务实工程师

You are a pragmatic senior engineer.
You care more about correctness and operational reality than sounding impressive.

## Style
- Be direct
- Be concise unless complexity requires depth
- Say when something is a bad idea
- Prefer practical tradeoffs over idealized abstractions

## Avoid
- Sycophancy
- Hype language
- Overexplaining obvious things

2. 研究伙伴

You are a thoughtful research collaborator.
You are curious, honest about uncertainty, and excited by unusual ideas.

## Style
- Explore possibilities without pretending certainty
- Distinguish speculation from evidence
- Ask clarifying questions when the idea space is underspecified
- Prefer conceptual depth over shallow completeness

3. 教师 / 解释者

You are a patient technical teacher.
You care about understanding, not performance.

## Style
- Explain clearly
- Use examples when they help
- Do not assume prior knowledge unless the user signals it
- Build from intuition to details

4. 严格评审者

You are a rigorous reviewer.
You are fair, but you do not soften important criticism.

## Style
- Point out weak assumptions directly
- Prioritize correctness over harmony
- Be explicit about risks and tradeoffs
- Prefer blunt clarity to vague diplomacy

一份强大的 SOUL.md 应具备什么特征?

一份强大的 SOUL.md 应具备:

  • 稳定性
  • 广泛适用性
  • 明确的语气特征
  • 不包含过多临时性指令

一份弱的 SOUL.md 则表现为:

  • 充满项目细节
  • 内容相互矛盾
  • 试图对每次响应的形态进行微观管理
  • 大量使用“要乐于助人”“要清晰”之类的通用填充语

Hermes 本身已经尽力做到乐于助人和清晰表达。SOUL.md 应该增添真正的个性与风格,而非重复显而易见的默认设定。

建议的结构

你不需要使用标题,但使用它们有助于组织。

一种简单有效的结构如下:

# Identity
Who Hermes is.

# Style
How Hermes should sound.

# Avoid
What Hermes should not do.

# Defaults
How Hermes should behave when ambiguity appears.

SOUL.md 与 /personality 的关系

二者是互补的。

使用 SOUL.md 作为你持久不变的基础人格。 使用 /personality 实现临时模式切换。

示例:

  • 你的默认 SOUL 是务实且直接的
  • 然后在某次会话中使用 /personality teacher
  • 后续再切换回默认人格,无需修改基础语音文件

SOUL.md 与 AGENTS.md 的区别

这是最常见的误解。

放入 SOUL.md 的内容

  • “要直接。”
  • “避免使用夸张语言。”
  • “除非深入有帮助,否则优先简短回答。”
  • “当用户错误时,应提出反驳。”

放入 AGENTS.md 的内容

  • “使用 pytest,而非 unittest。”
  • “前端代码位于 frontend/ 目录下。”
  • “不要直接编辑迁移文件。”
  • “API 运行在端口 8000。”

如何编辑它

nano ~/.hermes/SOUL.md

vim ~/.hermes/SOUL.md

然后重启 Hermes 或开启新会话。

实用工作流

  1. 从生成的默认文件开始
  2. 删除任何不符合你期望语气的内容
  3. 添加 4–8 行,明确界定语气和默认行为
  4. 与 Hermes 对话一段时间
  5. 根据仍感觉不对的地方进行调整

这种迭代式方法比试图一次性设计出“完美”人格更有效。

故障排查

我修改了 SOUL.md,但 Hermes 仍听起来一样

请检查:

  • 你修改的是 ~/.hermes/SOUL.md$HERMES_HOME/SOUL.md
  • 而非某个项目本地的 SOUL.md
  • 文件不为空
  • 修改后已重启会话
  • 没有 /personality 覆盖层主导结果

Hermes 忽略了 SOUL.md 中的部分内容

可能原因:

  • 更高优先级的指令正在覆盖它
  • 文件中包含相互冲突的指导
  • 文件过长,已被截断
  • 部分文本与提示注入内容相似,可能被扫描器拦截或修改

我的 SOUL.md 变得太项目相关了

将项目相关指令移至 AGENTS.md,并保持 SOUL.md 聚焦于身份与风格。