使用 SOUL.md 配合 Hermes
SOUL.md 是你的 Hermes 實例的核心身份標識。它是系統提示中的第一部分——定義了 Agent 的身份、表達方式以及應避免的內容。
如果你想讓 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,掃描其中是否存在提示注入模式,必要時進行截斷,並將其作為Agent 身份——即系統提示中的第 #1 個槽位。這意味著 SOUL.md 完全取代內置的默認身份文本。
如果 SOUL.md 缺失、為空或無法加載,Hermes 將回退到內置的默認身份。
不會在文件外添加任何包裝語言。內容本身才是關鍵——以你希望 Agent 思考和表達的方式書寫。
一次有效的首次修改
如果你不做其他操作,只需打開文件並修改幾行,使其更符合你的感覺。
例如:
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.
## 風格
- Be direct
- Be concise unless complexity requires depth
- Say when something is a bad idea
- Prefer practical tradeoffs over idealized abstractions
## 避免事項
- Sycophancy
- Hype language
- Overexplaining obvious things
2. 研究夥伴
You are a thoughtful research collaborator.
You are curious, honest about uncertainty, and excited by unusual ideas.
## 風格
- 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.
## 風格
- 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.
## 風格
- 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 應該增添真正的個性與風格,而非重複顯而易見的默認設定。
建議的結構
你不需要使用標題,但使用它們有助於組織。
一種簡單有效的結構如下:
# 身份
Who Hermes is.
# 風格
How Hermes should sound.
# 避免事項
What Hermes should not do.
# 默認值
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 或開啟新會話。
實用工作流
- 從生成的默認文件開始
- 刪除任何不符合你期望語氣的內容
- 添加 4–8 行,明確界定語氣和默認行為
- 與 Hermes 對話一段時間
- 根據仍感覺不對的地方進行調整
這種迭代式方法比試圖一次性設計出“完美”人格更有效。
故障排查
我修改了 SOUL.md,但 Hermes 仍聽起來一樣
請檢查:
- 你修改的是
~/.hermes/SOUL.md或$HERMES_HOME/SOUL.md - 而非某個項目本地的
SOUL.md - 文件不為空
- 修改後已重啟會話
- 沒有
/personality覆蓋層主導結果
Hermes 忽略了 SOUL.md 中的部分內容
可能原因:
- 更高優先級的指令正在覆蓋它
- 文件中包含相互衝突的指導
- 文件過長,已被截斷
- 部分文本與提示注入內容相似,可能被掃描器攔截或修改
我的 SOUL.md 變得太項目相關了
將項目相關指令移至 AGENTS.md,並保持 SOUL.md 聚焦於身份與風格。