Skip to main content

内存提供者

Hermes Agent 随附 8 个外部内存提供者插件,为代理提供持久的、跨会话的知识,超越内置的 MEMORY.md 和 USER.md。仅允许同时激活一个外部提供者——内置内存始终与之共存。

快速入门

hermes memory setup      # interactive picker + configuration
hermes memory status # check what's active
hermes memory off # disable external provider

你也可以通过 hermes plugins → 提供者插件 → 内存提供者 来选择当前激活的内存提供者。

或在 ~/.hermes/config.yaml 中手动设置:

memory:
provider: openviking # or honcho, mem0, hindsight, holographic, retaindb, byterover, supermemory

工作原理

当启用某个内存提供者时,Hermes 会自动执行以下操作:

  1. 注入提供者上下文到系统提示中(提供者所知内容)
  2. 在每轮对话前预加载相关记忆(后台非阻塞)
  3. 在每次响应后将对话回合同步至提供者
  4. 在会话结束时提取记忆(适用于支持该功能的提供者)
  5. 将内置内存写入操作镜像到外部提供者
  6. 添加提供者特定工具,使代理能够搜索、存储和管理记忆

内置内存(MEMORY.md / USER.md)仍按原有方式工作。外部提供者是叠加式的补充。

可用提供者

Honcho

基于 AI 的跨会话用户建模,支持辩证问答、语义搜索和持久化结论。

最适合具有跨会话上下文的多智能体系统,以及用户-代理对齐
所需条件pip install honcho-ai + API密钥 或自托管实例
数据存储Honcho 云服务 或 自托管
成本Honcho 定价(云服务) / 免费(自托管)

工具: honcho_profile(同伴卡片)、honcho_search(语义搜索)、honcho_context(LLM 合成)、honcho_conclude(存储事实)

设置向导:

hermes honcho setup        # (legacy command) 
# or
hermes memory setup # select "honcho"

配置文件: $HERMES_HOME/honcho.json(用户配置本地)或 ~/.honcho/config.json(全局)。解析顺序:$HERMES_HOME/honcho.json > ~/.hermes/honcho.json > ~/.honcho/config.json。参见 配置参考Honcho 集成指南

关键配置选项
默认值描述
apiKey--来自 app.honcho.dev 的 API 密钥
baseUrl--自托管 Honcho 的基础 URL
peerName--用户同伴身份标识
aiPeer主机密钥AI 同伴身份(每个配置文件一个)
workspace主机密钥共享工作区 ID
recallModehybridhybrid(自动注入 + 工具),context(仅注入),tools(仅工具)
observationall on每个同伴的 observeMe/observeOthers 布尔开关
writeFrequencyasyncasyncturnsession 或整数 N
sessionStrategyper-directoryper-directoryper-repoper-sessionglobal
dialecticReasoningLevellowminimallowmediumhighmax
dialecticDynamictrue根据查询长度自动提升推理深度
messageMaxChars25000单条消息最大字符数(超出则分块处理)
最小 honcho.json(云服务)
{
"apiKey": "your-key-from-app.honcho.dev",
"hosts": {
"hermes": {
"enabled": true,
"aiPeer": "hermes",
"peerName": "your-name",
"workspace": "hermes"
}
}
}
最小 honcho.json(自托管)
{
"baseUrl": "http://localhost:8000",
"hosts": {
"hermes": {
"enabled": true,
"aiPeer": "hermes",
"peerName": "your-name",
"workspace": "hermes"
}
}
}
hermes honcho 迁移

如果你之前使用过 hermes honcho setup,你的配置和所有服务器端数据均保持不变。只需再次通过设置向导重新启用,或手动将 memory.provider: honcho 设置以通过新系统重新激活。

多智能体 / 配置文件:

每个 Hermes 配置文件都会拥有自己的 Honcho AI 同伴,但共享同一工作区——所有配置文件看到相同的用户表示,但每个代理会构建自己独特的身份和观察记录。

hermes profile create coder --clone   # creates honcho peer "coder", inherits config from default

--clone 的作用:在 honcho.json 中创建一个 hermes.coder 主机块,包含 aiPeer: "coder",共享 workspace,继承 peerNamerecallModewriteFrequencyobservation 等。该同伴会在首次消息前被主动创建。

对于在 Honcho 设置前创建的配置文件:

hermes honcho sync   # scans all profiles, creates host blocks for any missing ones

这将从默认的 hermes 主机块继承设置,并为每个配置文件创建新的 AI 同伴。幂等性操作——跳过已存在主机块的配置文件。

完整 honcho.json 示例(多配置文件)
{
"apiKey": "your-key",
"workspace": "hermes",
"peerName": "eri",
"hosts": {
"hermes": {
"enabled": true,
"aiPeer": "hermes",
"workspace": "hermes",
"peerName": "eri",
"recallMode": "hybrid",
"writeFrequency": "async",
"sessionStrategy": "per-directory",
"observation": {
"user": { "observeMe": true, "observeOthers": true },
"ai": { "observeMe": true, "observeOthers": true }
},
"dialecticReasoningLevel": "low",
"dialecticDynamic": true,
"dialecticMaxChars": 600,
"messageMaxChars": 25000,
"saveMessages": true
},
"hermes.coder": {
"enabled": true,
"aiPeer": "coder",
"workspace": "hermes",
"peerName": "eri",
"recallMode": "tools",
"observation": {
"user": { "observeMe": true, "observeOthers": false },
"ai": { "observeMe": true, "observeOthers": true }
}
},
"hermes.writer": {
"enabled": true,
"aiPeer": "writer",
"workspace": "hermes",
"peerName": "eri"
}
},
"sessions": {
"/home/user/myproject": "myproject-main"
}
}

参见 配置参考Honcho 集成指南


OpenViking

火山引擎(字节跳动)提供的上下文数据库,具备文件系统式知识层级结构、分层检索机制,以及自动将记忆提取为 6 个类别的能力。

最适合结构化浏览的自托管知识管理
所需条件pip install openviking + 运行中的服务器
数据存储自托管(本地或云端)
成本免费(开源,AGPL-3.0)

工具: viking_search(语义搜索)、viking_read(分层:摘要/概览/全文)、viking_browse(文件系统导航)、viking_remember(存储事实)、viking_add_resource(导入 URL/文档)

设置:

# Start the OpenViking server first
pip install openviking
openviking-server

# Then configure Hermes
hermes memory setup # select "openviking"
# Or manually:
hermes config set memory.provider openviking
echo "OPENVIKING_ENDPOINT=http://localhost:1933" >> ~/.hermes/.env

核心功能:

  • 分层上下文加载:L0(约 100 token)→ L1(约 2k)→ L2(完整)
  • 会话提交时自动提取记忆(配置文件、偏好、实体、事件、案例、模式)
  • 支持 viking:// URI 方案用于分层知识浏览

Mem0

基于服务器端的 LLM 事实提取,支持语义搜索、重排序和自动去重。

最适合无需手动管理的记忆系统——Mem0 自动完成提取
所需条件pip install mem0ai + API 密钥
数据存储Mem0 云服务
成本Mem0 定价

工具: mem0_profile(所有已存储的记忆)、mem0_search(语义搜索 + 重排序)、mem0_conclude(存储原始事实)

设置:

hermes memory setup    # select "mem0"
# Or manually:
hermes config set memory.provider mem0
echo "MEM0_API_KEY=your-key" >> ~/.hermes/.env

配置文件: $HERMES_HOME/mem0.json

默认值描述
user_idhermes-user用户标识符
agent_idhermes代理标识符

Hindsight

长期记忆系统,具备知识图谱、实体解析和多策略检索能力。hindsight_reflect 工具提供了其他提供者无法实现的跨记忆合成功能。自动保留完整的对话回合(包括工具调用),并支持会话级文档追踪。

最适合基于知识图谱的实体关系召回
所需条件云服务:来自 ui.hindsight.vectorize.io 的 API 密钥;本地部署:LLM API 密钥(OpenAI、Groq、OpenRouter 等)
数据存储Hindsight 云服务 或 本地嵌入式 PostgreSQL
成本Hindsight 定价(云服务)或免费(本地)

工具: hindsight_retain(带实体提取存储)、hindsight_recall(多策略搜索)、hindsight_reflect(跨记忆合成)

设置:

hermes memory setup    # select "hindsight"
# Or manually:
hermes config set memory.provider hindsight
echo "HINDSIGHT_API_KEY=your-key" >> ~/.hermes/.env

设置向导会自动安装依赖项,并仅安装所选模式所需的组件(hindsight-client 用于云服务,hindsight-all 用于本地)。需要 hindsight-client >= 0.4.22(若过时,将在会话开始时自动升级)。

本地模式界面: hindsight-embed -p hermes ui start

配置文件: $HERMES_HOME/hindsight/config.json| 键 | 默认值 | 说明 | |-----|---------|-------------| | mode | cloud | cloudlocal | | bank_id | hermes | 内存库标识符 | | recall_budget | mid | 回忆细致程度:low / mid / high | | memory_mode | hybrid | hybrid(上下文 + 工具),context(仅自动注入),tools(仅工具) | | auto_retain | true | 自动保留对话轮次 | | auto_recall | true | 每轮对话前自动回忆记忆 | | retain_async | true | 在服务器端异步处理保留操作 | | tags | — | 存储记忆时应用的标签 | | recall_tags | — | 回忆时用于过滤的标签 |

有关完整配置参考,请参阅 插件 README


全息记忆(Holographic)

基于本地 SQLite 的事实存储,支持 FTS5 全文搜索、信任评分以及 HRR(全息压缩表示)以实现组合代数查询。

最适合仅限本地的高级检索记忆,无外部依赖
所需条件无需额外依赖(SQLite 原生可用)。NumPy 可选,用于 HRR 代数运算。
数据存储本地 SQLite
成本免费

工具: fact_store(9 个动作:添加、搜索、探测、关联、推理、矛盾、更新、删除、列出),fact_feedback(帮助/无助评分,用于训练信任分数)

设置:

hermes memory setup    # select "holographic"
# Or manually:
hermes config set memory.provider holographic

配置: config.yaml 下的 plugins.hermes-memory-store

默认值说明
db_path$HERMES_HOME/memory_store.dbSQLite 数据库路径
auto_extractfalse会话结束时自动提取事实
default_trust0.5默认信任分(0.0–1.0)

独特功能:

  • probe — 针对特定实体的代数式回忆(关于某人/某物的所有事实)
  • reason — 跨多个实体的组合 AND 查询
  • contradict — 自动检测冲突事实
  • 带有非对称反馈的信任评分(+0.05 帮助 / -0.10 不帮助)

RetainDB

云端记忆 API,采用混合搜索(向量 + BM25 + 重排序),支持 7 种记忆类型和增量压缩。

最适合已在使用 RetainDB 基础设施的团队
所需条件RetainDB 账户 + API 密钥
数据存储RetainDB 云服务
成本20 美元/月

工具: retaindb_profile(用户档案),retaindb_search(语义搜索),retaindb_context(任务相关上下文),retaindb_remember(按类型 + 重要性存储),retaindb_forget(删除记忆)

设置:

hermes memory setup    # select "retaindb"
# Or manually:
hermes config set memory.provider retaindb
echo "RETAINDB_API_KEY=your-key" >> ~/.hermes/.env

ByteRover

通过 brv CLI 实现持久化记忆 —— 分层知识树,支持逐级检索(模糊文本 → LLM 驱动搜索)。以本地优先设计,支持可选云同步。

最适合希望拥有可移植、本地优先记忆系统的开发者
所需条件ByteRover CLI(npm install -g byterover-cli安装脚本
数据存储本地(默认)或 ByteRover 云(可选同步)
成本免费(本地)或 ByteRover 定价(云)

工具: brv_query(搜索知识树),brv_curate(存储事实/决策/模式),brv_status(CLI 版本 + 树状统计)

设置:

# Install the CLI first
curl -fsSL https://byterover.dev/install.sh | sh

# Then configure Hermes
hermes memory setup # select "byterover"
# Or manually:
hermes config set memory.provider byterover

核心特性:

  • 自动预压缩提取(在上下文压缩丢弃前保存洞察)
  • 知识树存储于 $HERMES_HOME/byterover/(按用户配置文件作用域)
  • SOC2 Type II 认证的云同步(可选)

Supermemory

语义型长期记忆系统,支持用户画像召回、语义搜索、显式记忆工具,以及通过 Supermemory 图谱 API 在会话结束时摄入对话内容。

最适合支持用户画像与会话级图谱构建的语义召回
所需条件pip install supermemory + API 密钥
数据存储Supermemory 云服务
成本Supermemory 定价

工具: supermemory_store(保存显式记忆),supermemory_search(语义相似性搜索),supermemory_forget(按 ID 或最佳匹配查询遗忘),supermemory_profile(持久化用户画像 + 最近上下文)

设置:

hermes memory setup    # select "supermemory"
# Or manually:
hermes config set memory.provider supermemory
echo 'SUPERMEMORY_API_KEY=***' >> ~/.hermes/.env

配置: $HERMES_HOME/supermemory.json

默认值说明
container_taghermes用于搜索和写入的容器标签。支持 {identity} 模板以实现按用户配置文件作用域的标签。
auto_recalltrue在每轮对话前注入相关记忆上下文
auto_capturetrue每次响应后存储清理后的用户-助手对话轮次
max_recall_results10格式化为上下文的最大召回条目数
profile_frequency50在首轮及每隔 N 轮注入用户画像事实
capture_modeall默认跳过微小或琐碎的对话轮次
search_modehybrid搜索模式:hybridmemories,或 documents
api_timeout5.0SDK 和摄入请求的超时时间

环境变量: SUPERMEMORY_API_KEY(必需),SUPERMEMORY_CONTAINER_TAG(覆盖配置)。

核心特性:

  • 自动上下文隔离 —— 从捕获的对话轮次中剥离召回的记忆,防止递归记忆污染
  • 会话结束时的对话摄入,用于构建更丰富的图谱级知识
  • 首轮及可配置间隔注入用户画像事实
  • 琐碎消息过滤(跳过“好的”、“谢谢”等)
  • 按用户配置文件作用域的容器 —— 在 container_tag 中使用 {identity}(例如 hermes-{identity}hermes-coder)以实现每个 Hermes 配置文件的独立记忆隔离
  • 多容器模式 —— 启用 enable_custom_container_tags 并提供一个 custom_containers 列表,允许代理跨命名容器读写。自动操作(同步、预取)仍作用于主容器。
多容器示例
{
"container_tag": "hermes",
"enable_custom_container_tags": true,
"custom_containers": ["project-alpha", "shared-knowledge"],
"custom_container_instructions": "Use project-alpha for coding context."
}

支持: Discord · support@supermemory.com


提供商对比

提供商存储方式成本工具数量依赖项独特功能
Honcho云端付费4honcho-ai辩证式用户建模
OpenViking自托管免费5openviking + 服务器文件系统层级 + 分级加载
Mem0云端付费3mem0ai服务端 LLM 提取
Hindsight云端/本地免费/付费3hindsight-client知识图谱 + 反思合成
Holographic本地免费2HRR 代数 + 信任评分
RetainDB云端20 美元/月5requests增量压缩
ByteRover本地/云端免费/付费3brv CLI预压缩提取
Supermemory云端付费4supermemory上下文隔离 + 会话图谱摄入 + 多容器支持

配置文件隔离

各提供商的数据按 配置文件 隔离:

  • 本地存储提供商(Holographic、ByteRover)使用 $HERMES_HOME/ 路径,不同配置文件路径不同
  • 配置文件提供商(Honcho、Mem0、Hindsight、Supermemory)将配置存储于 $HERMES_HOME/,每个配置文件拥有独立凭证
  • 云端提供商(RetainDB)自动推导出按配置文件作用域的项目名称
  • 环境变量提供商(OpenViking)通过每个配置文件的 .env 文件进行配置

构建自定义记忆提供商

请参阅 开发者指南:记忆提供商插件,了解如何创建自己的记忆提供商。