Honcho 记忆
Honcho 是一个 AI 原生记忆后端,它在 Hermes 内置记忆系统之上增加了 dialectic reasoning 与深度用户建模能力。它不是简单的 key-value 存储,而是会在对话发生之后对会话进行推理,持续维护“用户是谁”的模型,包括偏好、沟通风格、目标与行为模式。
Honcho 通过 Memory Providers 体系集成到 Hermes 中。下文全部能力都通过统一的记忆 大模型提供商(provider) 接口对外提供。
Honcho 增加了什么
| Capability | Built-in Memory | Honcho |
|---|---|---|
| Cross-session persistence | ✔ 基于文件的 MEMORY.md/USER.md | ✔ 服务端 API 持久化 |
| User profile | ✔ 智能体手工整理 | ✔ 自动 dialectic 推理 |
| Session summary | — | ✔ 会话级上下文注入 |
| Multi-agent isolation | — | ✔ 按 peer 隔离 profile |
| Observation modes | — | ✔ unified 或 directional |
| Conclusions | — | ✔ 服务端模式推理 |
| Search across history | ✔ FTS5 session search | ✔ conclusions 语义搜索 |
Dialectic reasoning:每次对话轮次后(由 dialecticCadence 控制),Honcho 会分析这段交流,并提炼关于用户偏好、习惯与目标的洞察。它支持 1 到 3 轮多阶段推理,并会在冷启动与热会话提示之间自动切换。
Session-scoped context:基础上下文中会包含 session summary、用户表示与 peer card,让智能体知道本次会话里已经讨论过什么。
Multi-agent profiles:当多个 Hermes 实例面对同一个用户时,Honcho 会为每个 AI peer 维护独立画像,避免不同 profile 之间的上下文串扰。
设置
hermes memory setup # select "honcho" from the 大模型提供商(provider) list
或者手动配置:
memory:
provider: honcho
echo "HONCHO_API_KEY=***" >> ~/.hermes/.env
架构
双层上下文注入
在 hybrid 或 context 模式下,每轮都会组装两层上下文:
- Base context — session summary、user representation、user peer card、AI self-representation 与 AI identity card,由
contextCadence控制刷新 - Dialectic supplement — 由 LLM 综合出的当前用户状态与需求判断,由
dialecticCadence控制刷新
这两层内容会拼接后按 contextTokens 预算截断。
冷 / 热提示切换
- Cold start:还没有 base context 时,优先询问“这个用户是谁、偏好和工作风格是什么”
- Warm session:已有 base context 时,优先询问“结合当前会话,哪些上下文最相关”
三个正交配置旋钮
| Knob | Controls | Default |
|---|---|---|
contextCadence | 触发 context() API 刷新的间隔轮数 | 1 |
dialecticCadence | 触发 peer.chat() 推理调用的间隔轮数 | 2 |
dialecticDepth | 每次 dialectic 进行几轮 .chat() 推理 | 1 |
Dialectic depth
当 dialecticDepth > 1 时,Honcho 会做多轮推理:
- Pass 0:冷启动或热会话主提示
- Pass 1:self-audit,自查并补足缺失证据
- Pass 2:reconciliation,解决矛盾并给出最终综合
配置项
Honcho 的配置保存在 ~/.honcho/config.json(全局)或 $HERMES_HOME/honcho.json(profile 层级)。
常见键包括:
contextTokenscontextCadencedialecticCadencedialecticDepthdialecticReasoningLeveldialecticDynamicdialecticMaxCharsrecallModewriteFrequencysaveMessagesobservationModemessageMaxCharsdialecticMaxInputCharssessionStrategy
Observation(Directional vs Unified)
Honcho 把会话建模为多个 peer 互相交换消息。每个 peer 都有两个观察开关:
| Toggle | Effect |
|---|---|
observeMe | 根据该 peer 自己发出的消息建立表示 |
observeOthers | 该 peer 观察其他 peer 的消息 |
observationMode 提供两个常见预设:
directional(默认)— 双向完整观察unified— 单观察池语义,AI 主要观察用户而不强调自观察
工具
当 Honcho 作为当前记忆 大模型提供商(provider) 时,会提供五个工具:
| Tool | Purpose |
|---|---|
honcho_profile | 读取或更新 peer card |
honcho_search | 对上下文做语义搜索 |
honcho_context | 获取完整会话上下文 |
honcho_reasoning | 让 Honcho 的 LLM 做综合推理 |
honcho_conclude | 创建或删除 conclusions |
CLI 命令
hermes honcho status
hermes honcho setup
hermes honcho strategy
hermes honcho peer
hermes honcho mode
hermes honcho tokens
hermes honcho identity
hermes honcho sync
hermes honcho enable
hermes honcho disable
从旧版 hermes honcho 迁移
如果你之前使用的是旧版 hermes honcho setup:
- 现有配置(
honcho.json或~/.honcho/config.json)会被保留 - 服务端数据(memories、conclusions、user profiles)不会丢失
- 只需在
config.yaml中重新设置memory.provider: honcho
无需重新登录或重新 setup。执行 hermes memory setup 并选择 honcho 即可,向导会自动识别已有配置。
完整文档
完整参考请参阅 Memory Providers — Honcho。