环境
Win11,WSL2,Ubuntu24.04
一、相关文档
持久化记忆
记忆提供程序
Honcho 记忆
二、查看现有状态
一般内置记忆是开启的。
2.1 hermes memory --help
admin@UD26:~$ hermes memory --help
usage: hermes memory [-h] {setup,status,off,reset} ...
Set up and manage external memory provider plugins. Available providers: honcho, openviking, mem0, hindsight, holographic, retaindb, byterover. Only one external provider can be active at a time. Built-in
memory (MEMORY.md/USER.md) is always active.
positional arguments:
{setup,status,off,reset}
setup Interactive provider selection and configuration
status Show current memory provider config
off Disable external provider (built-in only)
reset Erase all built-in memory (MEMORY.md and USER.md)
options:
-h, --help show this help message and exit
2.2 hermes memory status
admin@UD26:~$ hermes memory status
Memory status
────────────────────────────────────────
Built-in: always active
Provider: (none — built-in only)
Installed plugins:
• byterover (API key / local)
• hindsight (API key / local)
• holographic (local)
• honcho (API key / local)
• mem0 (API key / local)
• openviking (API key / local)
• retaindb (API key / local)
• supermemory (requires API key)
2.3 配置文件config.yaml
显示配置文件路径
admin@UD26:~$ hermes config path
/home/admin/.hermes/config.yaml
查看配置文件
vi ~/.hermes/config.yaml
memory: memory_enabled: true # 长期记忆总开关 user_profile_enabled: true # 用户画像记忆开关,偏好/习惯类内容单独分类存储 memory_char_limit: 2200 # 通用记忆文件最大字符数,超限自动精简压缩 user_char_limit: 1375 # 用户画像记忆文件最大字符数,超限自动精简压缩 nudge_interval: 10 # 记忆主动提醒间隔,每N轮对话触发一次留存提示 flush_min_turns: 6 # 记忆落盘最小轮次,积累N轮对话后批量写入磁盘编辑配置文件
hermes config edit
校验配置文件语法是否合法
hermes config check
2.4 记忆文件
~/.hermes/memories 默认这个目录是空的
~/.hermes/memories/MEMORY.md
~/.hermes/memories/USER.md
MEMORY.md Agent的个人笔记 — 环境事实、约定、学到的知识 2,200 字符(约 800 token)
USER.md 用户档案 — 你的偏好、沟通风格、期望 1,375 字符(约 500 token)
三、测试记忆
3.1 测试USER.md
hermes 输入
记住:我之前开发的主力语言是Java。
输入:我常用的开发语言是什么?
回答:你常用的开发语言是 Java。
cat ~/.hermes/memories/USER.md
主力开发语言是Java。
3.2 测试MEMORY.md
手动添加记忆,用于测试
nano ~/.hermes/memories/MEMORY.md
- 固定规则:所有输出的代码片段必须附带中文注释
hermes 开启新聊天:
你输出代码的时候有什么固定规则吗?
回答:
有,我的固定规则是:所有输出的代码片段必须附带中文注释。
这已经作为记忆保存在了我这里,之后的每次对话都会遵守这条规则。
cat ~/.hermes/memories/MEMORY.md
固定规则:所有输出的代码片段必须附带中文注释
四、删除内置记忆
3种方式
4.1 重置记忆hermes memory reset
admin@UD26:~$ hermes memory reset
This will permanently erase the following memory files:
◆ MEMORY.md (agent notes) — 69 bytes
◆ USER.md (user profile) — 28 bytes
Type 'yes' to confirm: yes
✓ Deleted MEMORY.md (agent notes)
✓ Deleted USER.md (user profile)
Memory reset complete. New sessions will start with a blank slate.
Files were in: ~/.hermes/memories/
4.2 清空文件记忆内容
> ~/.hermes/memories/MEMORY.md
> ~/.hermes/memories/USER.md
4.3 删除记忆文件
rm -rf ~/.hermes/memories/MEMORY.md
rm -rf ~/.hermes/memories/USER.md
五、外部记忆提供程序
为了获得比 MEMORY.md 和 USER.md 更深层次的持久化记忆,Hermes 附带了 8 个外部记忆提供程序插件 — 包括 Honcho、OpenViking、Mem0、Hindsight、Holographic、RetainDB、ByteRover 和 Supermemory。
外部提供程序与内置记忆并行运行(从不替代它),并增加了诸如知识图谱、语义搜索、自动事实提取和跨会话用户建模等功能。
hermes memory setup # pick a provider and configure it hermes memory status # check what's active请参阅 记忆提供程序 指南,获取有关每个提供程序的详细信息、设置说明和对比。