知识引擎/Hermes 知识引擎/Memory Providers(记忆 Provider)

原文链接:Memory Providers sidebar position: 4 title: "Memory Providers" description: "External memory provider plugins — Honcho, OpenViking, Mem0, Hindsight, Hologr

> 原文链接:Memory Providers


sidebar_position: 4 title: "Memory Providers" description: "External memory provider plugins — Honcho, OpenViking, Mem0, Hindsight, Holographic, RetainDB, ByteRover, Supermemory"

Memory Providers(记忆 Provider)

Hermes Agent 内置 8 个外部记忆 Provider 插件,为 Agent 提供超越内置 MEMORY.md 和 USER.md 的持久跨会话知识。同一时间只能激活一个外部 Provider——内置记忆始终与其并行工作。

快速开始

hermes memory setup      # 交互式选择器 + 配置
hermes memory status     # 检查当前激活的 Provider
hermes memory off        # 禁用外部 Provider

你也可以通过 hermes plugins → Provider Plugins → Memory Provider 选择活跃的记忆 Provider。

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

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

工作原理

当记忆 Provider 激活时,Hermes 会自动:

  1. 注入 Provider 上下文到系统提示词(Provider 所知的内容)
  2. 预取相关记忆在每轮之前(后台、非阻塞)
  3. 同步对话轮次到 Provider(每次响应后)
  4. 在会话结束时提取记忆(对于支持的 Provider)
  5. 将内置记忆写入镜像到外部 Provider
  6. 添加 Provider 特定工具,让 Agent 可以搜索、存储和管理记忆

内置记忆(MEMORY.md / USER.md)继续像以前一样工作。外部 Provider 是增量的。

可用 Provider

Honcho

AI 原生的跨会话用户建模,具有辩证推理、会话级上下文注入、语义搜索和持久结论。基础上下文现在包含会话摘要,以及用户表示和对等卡片,让 Agent 了解已讨论过的内容。

最适合具有跨会话上下文的多 Agent 系统、用户-Agent 对齐
需要pip install honcho-ai + API 密钥 或自托管实例
数据存储Honcho Cloud 或自托管
费用Honcho 定价(云)/ 免费(自托管)

工具 (5 个): honcho_profile(读/更新对等卡片)、honcho_search(语义搜索)、honcho_context(会话上下文——摘要、表示、卡片、消息)、honcho_reasoning(LLM 合成)、honcho_conclude(创建/删除结论)

架构: 两层上下文注入——基础层(会话摘要 + 表示 + 对等卡片,按 contextCadence 刷新)加上辩证补充层(LLM 推理,按 dialecticCadence 刷新)。辩证层根据是否存在基础上下文自动选择冷启动提示(一般用户事实)或热启动提示(会话级上下文)。

三个正交配置旋钮独立控制成本和深度:

  • contextCadence — 基础层刷新频率(API 调用频率)
  • dialecticCadence — 辩证 LLM 触发频率(LLM 调用频率)
  • dialecticDepth — 每次辩证调用执行多少次 .chat()(1-3,推理深度)

设置向导:

hermes honcho setup        # (旧命令)
# 或
hermes memory setup        # 选择 "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
contextTokensnull(无上限)每轮自动注入上下文的 Token 预算。在词边界处截断
contextCadence1context() API 调用之间的最小轮次(基础层刷新)
dialecticCadence3peer.chat() LLM 调用之间的最小轮次。仅适用于 hybrid/context 模式
dialecticDepth1每次辩证调用的 .chat() 次数。限制在 1-3。第 0 次:冷/热提示,第 1 次:自审计,第 2 次:协调
dialecticDepthLevelsnull可选数组,每次通过的推理级别,如 ["minimal", "low", "medium"]。覆盖按比例的默认值
dialecticReasoningLevel'low'基础推理级别:minimallowmediumhighmax
dialecticDynamictruetrue 时,模型可通过工具参数覆盖每次调用的推理级别
dialecticMaxChars600注入到系统提示词的辩证结果最大字符数
recallMode'hybrid'hybrid(自动注入 + 工具)、context(仅注入)、tools(仅工具)
writeFrequency'async'何时刷新消息:async(后台线程)、turn(同步)、session(结束时批量)或整数 N
saveMessagestrue是否将消息持久化到 Honcho API
observationMode'directional'directional(全部开启)或 unified(共享池)。用 observation 对象覆盖
messageMaxChars25000每条消息的最大字符数(超出时分块)
dialecticMaxInputChars10000peer.chat() 辩证查询输入的最大字符数
sessionStrategy'per-directory'per-directoryper-repoper-sessionglobal
最小 honcho.json(云)
{
  "apiKey": "your-k....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"
    }
  }
}

:::tip 从 hermes honcho 迁移 如果你之前使用过 hermes honcho setup,你的配置和所有服务端数据都完好无损。只需通过设置向导重新启用,或手动设置 memory.provider: honcho 即可通过新系统重新激活。 :::

多 Agent / 配置文件:

每个 Hermes 配置文件都有自己的 Honcho AI 对等身份,同时共享同一个工作区——所有配置文件看到相同的用户表示,但每个 Agent 构建自己的身份和观察。

hermes profile create coder --clone   # 创建 honcho 对等 "coder",从默认继承配置

--clone 的作用:在 honcho.json 中创建一个 hermes.coder 主机块,设置 aiPeer: "coder",共享 workspace,继承 peerNamerecallModewriteFrequencyobservation 等。对等身份在 Honcho 中被急切创建,因此在第一条消息之前就已存在。

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

hermes honcho sync   # 扫描所有配置文件,为缺失的创建主机块

这从默认的 hermes 主机块继承设置,并为每个配置文件创建新的 AI 对等身份。幂等操作——跳过已有主机块的配置文件。

完整 honcho.json 示例(多配置文件)
{
  "apiKey": "***",
  "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,
      "dialecticCadence": 3,
      "dialecticDepth": 1,
      "dialecticMaxChars": 600,
      "contextCadence": 1,
      "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/文档)

设置:

# 先启动 OpenViking 服务器
pip install openviking
openviking-server

# 然后配置 Hermes
hermes memory setup    # 选择 "openviking"
# 或手动:
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 Cloud
费用Mem0 定价

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

设置:

hermes memory setup    # 选择 "mem0"
# 或手动:
hermes config set memory.provider mem0
echo "MEM0_API_KEY=*** >> ~/.hermes/.env

配置: $HERMES_HOME/mem0.json

默认值描述
user_idhermes-user用户标识符
agent_idhermesAgent 标识符

Hindsight

具有知识图谱、实体解析和多策略检索的长期记忆。hindsight_reflect 工具提供其他 Provider 没有的跨记忆综合。自动保留完整对话轮次(包括工具调用),具有会话级文档追踪。

最适合基于知识图谱的回忆,具有实体关系
需要云:来自 ui.hindsight.vectorize.io 的 API 密钥。本地:LLM API 密钥(OpenAI、Groq、OpenRouter 等)
数据存储Hindsight Cloud 或本地嵌入式 PostgreSQL
费用Hindsight 定价(云)或免费(本地)

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

设置:

hermes memory setup    # 选择 "hindsight"
# 或手动:
hermes config set memory.provider hindsight
echo "HINDSIGHT_API_KEY=*** >> ~/.hermes/.env

设置向导会自动安装依赖,并且只安装所选模式所需的(hindsight-client 用于云,hindsight-all 用于本地)。需要 hindsight-client >= 0.4.22(如果版本过旧会在会话开始时自动升级)。

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

配置: $HERMES_HOME/hindsight/config.json

默认值描述
modecloudcloudlocal
bank_idhermes记忆库标识符
recall_budgetmid回忆详尽程度:low / mid / high
memory_modehybridhybrid(上下文 + 工具)、context(仅自动注入)、tools(仅工具)
auto_retaintrue自动保留对话轮次
auto_recalltrue每轮前自动回忆记忆
retain_asynctrue在服务器上异步处理保留
tags存储记忆时应用的标签
recall_tags回忆时过滤的标签

完整配置参考请参见插件 README


Holographic

本地 SQLite 事实存储,具有 FTS5 全文搜索、信任评分和 HRR(Holographic Reduced Representations,全息降维表示)用于组合代数查询。

最适合具有高级检索的本地记忆,无需外部依赖
需要无(SQLite 始终可用)。NumPy 可选用于 HRR 代数。
数据存储本地 SQLite
费用免费

工具: fact_store(9 种操作:add、search、probe、related、reason、contradict、update、remove、list)、fact_feedback(有帮助/无帮助评分,训练信任分数)

设置:

hermes memory setup    # 选择 "holographic"
# 或手动:
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

具有混合搜索(向量 + BM25 + 重排序)、7 种记忆类型和增量压缩的云记忆 API。

最适合已在使用 RetainDB 基础设施的团队
需要RetainDB 账户 + API 密钥
数据存储RetainDB Cloud
费用$20/月

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

设置:

hermes memory setup    # 选择 "retaindb"
# 或手动:
hermes config set memory.provider retaindb
echo "RETAINDB_API_KEY=*** >> ~/.hermes/.env

ByteRover

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

最适合想要可移植、本地优先记忆并有 CLI 的开发者
需要ByteRover CLI(npm install -g byterover-cli安装脚本
数据存储本地(默认)或 ByteRover Cloud(可选同步)
费用免费(本地)或 ByteRover 定价(云)

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

设置:

# 先安装 CLI
curl -fsSL https://byterover.dev/install.sh | sh

# 然后配置 Hermes
hermes memory setup    # 选择 "byterover"
# 或手动:
hermes config set memory.provider byterover

关键特性:

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

Supermemory

具有配置文件回忆、语义搜索、显式记忆工具和会话结束对话摄入(通过 Supermemory 图谱 API)的语义长期记忆。

最适合具有用户画像和会话级图谱构建的语义回忆
需要pip install supermemory + API 密钥
数据存储Supermemory Cloud
费用Supermemory 定价

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

设置:

hermes memory setup    # 选择 "supermemory"
# 或手动:
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搜索模式:hybridmemoriesdocuments
api_timeout5.0SDK 和摄入请求的超时时间

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

关键特性:

  • 自动上下文隔离——从捕获的轮次中剥离回忆的记忆,防止递归记忆污染
  • 会话结束对话摄入,用于更丰富的图谱级知识构建
  • 配置文件事实在首轮和可配置间隔注入
  • 琐碎消息过滤(跳过 "ok"、"thanks" 等)
  • 按配置文件隔离的容器 — 在 container_tag 中使用 {identity}(如 hermes-{identity}hermes-coder)来隔离每个 Hermes 配置文件的记忆
  • 多容器模式 — 启用 enable_custom_container_tags 并配合 custom_containers 列表,让 Agent 可以跨命名容器读写。自动操作(同步、预取)仍使用主容器。
多容器示例
{
  "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


Provider 对比

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

配置文件隔离

每个 Provider 的数据按配置文件隔离:

  • 本地存储 Provider(Holographic、ByteRover)使用 $HERMES_HOME/ 路径,每个配置文件不同
  • 配置文件 Provider(Honcho、Mem0、Hindsight、Supermemory)将配置存储在 $HERMES_HOME/,每个配置文件有自己的凭据
  • 云 Provider(RetainDB)自动派生按配置文件的项目名称
  • 环境变量 Provider(OpenViking)通过每个配置文件的 .env 文件配置

Continue Exploring

继续探索

这不是课程式的上一篇下一篇,而是从当前节点向外继续漫游。

使用指南

多配置文件 (Profiles)

Run multiple independent Hermes agents on the same machine — each with its own config, API keys, memory, sessions, skills, and gateway. A profile is a fully iso

核心功能

工具与工具集 (Tools & Toolsets)

Tools are functions that extend the agent's capabilities. They're organized into logical toolsets that can be enabled or disabled per platform.

核心功能

记忆系统 (Memory System)

Hermes Agent has bounded, curated memory that persists across sessions. This lets it remember your preferences, your projects, your environment, and things it h

核心功能

技能系统 (Skill System)

技能是 Hermes 的可复用知识模块。每个技能都是一个 Markdown 文件,在激活时注入到 Agent 的上下文中——为其提供持久的工作流、领域知识和行为指南,而无需将这些内容塞入系统提示中。 技能是可热插拔的:你可以在会话中途安装、创建、编辑和切换技能。它们在 CLI、消息平台和 Gateway 后台任务中均可

核心功能

MCP 集成 (MCP Integration)

MCP 让 Hermes Agent 连接到外部工具服务器,使 Agent 能够使用 Hermes 本身之外的工具——GitHub、数据库、文件系统、浏览器栈、内部 API 等。 如果你曾想让 Hermes 使用一个已经存在于其他地方的工具,MCP 通常是最简洁的方式。 - 无需先编写原生 Hermes 工具即可访问外

核心功能

ACP 编辑器集成 (ACP Editor Integration)

Hermes Agent 可以作为 ACP 服务器运行,让 ACP 兼容的编辑器通过 stdio 与 Hermes 通信,并渲染: - 聊天消息 - 工具活动 - 文件差异 - 终端命令 - 审批提示 - 流式思考 / 响应片段 当你希望 Hermes 像编辑器原生的编程 Agent 一样工作,而不是独立的 CLI 或

Core Features

核心功能

Hermes 的能力核心:工具、记忆、技能、委派、自动化、语音、插件与浏览器控制。

31 篇文档30 个节点

当前节点

Memory Providers(记忆 Provider)

同主题继续探索

工具与工具集 (Tools & Toolsets)

Tools are functions that extend the agent's capabilities. They're organized into logical toolsets that can be enabled or disabled per platform.

记忆系统 (Memory System)

Hermes Agent has bounded, curated memory that persists across sessions. This lets it remember your preferences, your projects, your environment, and things it h

技能系统 (Skill System)

技能是 Hermes 的可复用知识模块。每个技能都是一个 Markdown 文件,在激活时注入到 Agent 的上下文中——为其提供持久的工作流、领域知识和行为指南,而无需将这些内容塞入系统提示中。 技能是可热插拔的:你可以在会话中途安装、创建、编辑和切换技能。它们在 CLI、消息平台和 Gateway 后台任务中均可

MCP 集成 (MCP Integration)

MCP 让 Hermes Agent 连接到外部工具服务器,使 Agent 能够使用 Hermes 本身之外的工具——GitHub、数据库、文件系统、浏览器栈、内部 API 等。 如果你曾想让 Hermes 使用一个已经存在于其他地方的工具,MCP 通常是最简洁的方式。 - 无需先编写原生 Hermes 工具即可访问外

ACP 编辑器集成 (ACP Editor Integration)

Hermes Agent 可以作为 ACP 服务器运行,让 ACP 兼容的编辑器通过 stdio 与 Hermes 通信,并渲染: - 聊天消息 - 工具活动 - 文件差异 - 终端命令 - 审批提示 - 流式思考 / 响应片段 当你希望 Hermes 像编辑器原生的编程 Agent 一样工作,而不是独立的 CLI 或

API 服务器 (API Server)

The API server exposes hermes-agent as an OpenAI-compatible HTTP endpoint. Any frontend that speaks the OpenAI format — Open WebUI, LobeChat, LibreChat, NextCha

相关节点

多配置文件 (Profiles)

Run multiple independent Hermes agents on the same machine — each with its own config, API keys, memory, sessions, skills, and gateway. A profile is a fully iso

工具与工具集 (Tools & Toolsets)

Tools are functions that extend the agent's capabilities. They're organized into logical toolsets that can be enabled or disabled per platform.

记忆系统 (Memory System)

Hermes Agent has bounded, curated memory that persists across sessions. This lets it remember your preferences, your projects, your environment, and things it h

技能系统 (Skill System)

技能是 Hermes 的可复用知识模块。每个技能都是一个 Markdown 文件,在激活时注入到 Agent 的上下文中——为其提供持久的工作流、领域知识和行为指南,而无需将这些内容塞入系统提示中。 技能是可热插拔的:你可以在会话中途安装、创建、编辑和切换技能。它们在 CLI、消息平台和 Gateway 后台任务中均可

MCP 集成 (MCP Integration)

MCP 让 Hermes Agent 连接到外部工具服务器,使 Agent 能够使用 Hermes 本身之外的工具——GitHub、数据库、文件系统、浏览器栈、内部 API 等。 如果你曾想让 Hermes 使用一个已经存在于其他地方的工具,MCP 通常是最简洁的方式。 - 无需先编写原生 Hermes 工具即可访问外

ACP 编辑器集成 (ACP Editor Integration)

Hermes Agent 可以作为 ACP 服务器运行,让 ACP 兼容的编辑器通过 stdio 与 Hermes 通信,并渲染: - 聊天消息 - 工具活动 - 文件差异 - 终端命令 - 审批提示 - 流式思考 / 响应片段 当你希望 Hermes 像编辑器原生的编程 Agent 一样工作,而不是独立的 CLI 或