dsh-plugin-companion-memory
Selective companion memory for DeepSeek Harness: learn the user and distill what matters, with layered recall and prefix/summary reuse
一句话定位
Selective companion memory for DeepSeek Harness: learn the user and distill what matters, with layered recall and prefix/summary reuse
安装方式
在 DSH 的 web profile 中执行下面的命令;装完刷新页面即可。
$ dsh plugin --profile web add dsh-plugin-companion-memory@0.3.3
兼容的 DSH 版本
0.2.1-rc.2
作者与热度
123zxs345 · ★ 3 · 更新于 2026-11-05
关于这个插件
DSH 情感陪伴记忆插件
遗忘本身不是问题。重要的是,从经历里提炼出这个人真正会记住的东西。
面向 [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) 的选择性记忆插件,项目名 dsh-plugin-companion-memory。
为什么做这个插件
记忆插件有个两难:忘得太多,会丢掉用户认真说过、希望被记住的细节;可把每次闲聊都带进下一轮对话,上下文迟早装不下。压缩、检索、分层让记忆更容易存下和找回。对情感陪伴,我们还想追问一句:存下来的,真的是这个人在意的吗?
后来我们想,人不也会忘吗?你未必记得上周每顿饭吃了什么,却可能一直记得那晚加班回家,家人给你留了一碗面。值得留下的,可能是被惦记的感受,以及这段经历对你的意义。
所以,我们把问题从“怎样少忘一点”推进到“怎样提炼重要信息”:让模型在相处中主动学习、持续修正用户画像,理解你看重什么、希望怎样被对待、哪些经历会被你自己记住。再结合这份理解,判断记忆的保留、提炼、合并与修正。重要性由模型结合这个人与当时的情境判断,用户当下的表达优先。
这就是 DSH 情感陪伴记忆插件(dsh-plugin-companion-memory)的出发点。原始记忆保留原话与来源,提炼记忆留下意义和适用情境,简短总结用于检索;相关性达标才进入候选,最多24条,由模型按需展开更深的内容。
陪伴也需要负担得起。插件复用刚结束的原生会话前缀、已有总结和阶段结果,减少重复整理的开销,让新的经历继续修正对你的理解。
我们希望让大肥鱼记住你在意的事,让下一次聊天能接着上一次的相处。这里不按内容类型、关键词、情绪分数或固定遗忘天数筛选记忆;取舍由模型结合画像和经历的意义判断。
[观看介绍视频](https://www.bilibili.com/video/BV1G1436xEp4/) · [GitHub 源码与下载](https://github.com/123zxs345/dsh-plugin-companion-memory) · 喜欢这个想法,欢迎点颗 Star。
Companion Memory for DeepSeek Harness: understand the person, distill what matters, and keep the relationship continuous through an evolving user profile, selective layered memory and native conversation-prefix reuse.
设计
| 机制 | 做什么 |
| --- | --- |
| 主动维护用户画像 | 新经历补充或修正对用户的理解;完整画像始终参与后台取舍,不靠本轮检索碰运气。 |
| 原始记忆 → 提炼记忆 → 简短总结 | 保留原话与来源,提炼意义和情境,用短总结作为检索入口。 |
| 相关才入选 | 只比较简短总结的语义相似度,达标才进入候选,最多24条,可以是0条,不硬凑。 |
| 渐进披露 | 模型自己决定看提炼内容,还是进一步核对原始来源。 |
| 缓存与总结复用 | 尽早复用刚完成的原生会话前缀,沿用已有总结,阶段成功结果可恢复,减少重复整理。 |
| 理解可以改变 | 今天想听建议,就按今天的需要回应;画像帮助理解,不把用户定型。 |
缓存是否实际命中由模型提供商决定,插件不承诺固定命中率。相似度只用于本轮相关性,不用来判断长期情感价值。
安装
已验证环境:Node.js 24+、DeepSeek Harness 0.2.1-rc.2、Cordis 4.0.5。先在宿主中配置好模型与凭据,插件复用宿主,不需要再填写模型 API Key。
npm 安装(推荐)
在常用的 web profile 中执行:
dsh plugin --profile web add dsh-plugin-companion-memory
首次 npm 发行版为 0.3.3。安装后重启 dsh web。也可以在支持 npm 插件的市场中搜索 dsh-plugin-companion-memory;各市场的收录由其维护者和同步流程决定。
[npm 包与版本](https://www.npmjs.com/package/dsh-plugin-companion-memory) · [GitHub 源码](https://github.com/123zxs345/dsh-plugin-companion-memory)
GitHub 安装(0.3.2)
原有 GitHub Release 和固定 Git 版本仍可使用:
dsh plugin --profile web add https://github.com/123zxs345/dsh-plugin-companion-memory/releases/download/v0.3.2/dsh-plugin-companion-memory-0.3.2.tgz
也可以从固定版本的 Git 仓库安装:
dsh plugin --profile web add "git+https://github.com/123zxs345/dsh-plugin-companion-memory.git#v0.3.2"
重启 dsh web。组合包会在当前 profile 下加载 companion-memory,数据保存在该 profile 的 companion-memory/ 目录。Git 仓库包含可安装的编译结果,使用者无需先构建源码。
使用 DSH 的「自定义插件索引」时,可以在「发现 → 添加索引源」填入:
https://raw.githubusercontent.com/123zxs345/dsh-plugin-companion-memory/main/market/index.json
语义召回使用宿主已有的 [Hindsight](https://github.com/vectorize-io/hindsight) chunks 服务。在当前 profile 的 cordis.patch.yml 配置它的地址:
- id: companion-memory
config:
dataDir: !!js "ctx.get('profileContext').dir + '/companion-memory'"
companionId: default
idleReviewSeconds: 15
reviewMaxDelaySeconds: 60
candidateBudget: 24
minimumSimilarity: 0.55
contextTokens: 800
hindsightUrl: http://127.0.0.1:8888
将地址替换为你的实际服务。profile 补丁会替换整个 config,请保留数据目录及已有自定义配置。未配置检索服务时,本地SQLite与后台画像维护仍然保留,额外经历候选为空,不用无关内容补位。插件不会自动下载嵌入模型或另起数据库;外部服务由宿主管理。
默认用于一个主人的 profile。多用户部署请使用隔离的作用域、独立 companionId 和数据目录。
同分类对比
同一分类下 Star 最高的 5 个,便于横向比较。
| 插件 | 作者 | Star | 版本 | 更新 |
|---|---|---|---|---|
| EverOS | EverMind-AI | 13.9K | 0.0.0 | 2026-11-10 |
| billion-context | ranxianglei | 5.9K | 0.1.213 | 2026-11-10 |
| dsh-context | bowenliang123 | 4.8K | 0.83.1 | 2026-11-10 |
| memsearch | zilliztech | 2.9K | 0.0.0 | 2026-11-10 |
| dsh-mnemon | omdsh-dev | 957 | 0.5.43 | 2026-11-08 |