Dsh Plugin Memory
Description
DeepSeek Harness (DSH) 跨会话记忆插件:对话模型边干边记的 Markdown 项目记忆,支持专题文件渐进式披露、可选后台静默蒸馏、按项目隔离与热更新设置面板。机制对齐 Claude Code auto memory。 | Agent-maintained cross-session Markdown memory: progressive-disclosure topic files, opt-in silent distillation, per-project isolation. Claude Code-aligned.
Installation
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open the source below and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
README
dsh-plugin-memory
中文 | [English](README.en.md)
[DeepSeek Harness (DSH)](https://github.com/deepseek-ai/deepseek-harness) 的跨会话记忆插件: 对话模型在工作中**边干边记**,把值得长期记住的信息(事实 / 决策 / 教训 / 偏好)持久化为 纯 Markdown 文件,并在同一项目的新会话中自动注入。机制对齐 Claude Code 官方 auto memory, 并在索引同步与结构护栏上更进一步。
特性
- 🧠 两层记忆:主记忆文件(自动注入,预算内截断)+ 专题文件(渐进式披露:只注入一行索引,正文按需加载)
- ✍️ 模型边干边记:所有写入都是可见的工具调用,三档积极度可调(保守 / 平衡 / 积极)
- 🤫 可选后台蒸馏(默认关):每轮对话完成后静默提取记忆,零工具卡片、零对话痕迹,适合无人值守长任务
- 📁 按项目隔离:以会话工作目录为粒度,目录名为可读的全路径编码 + 防碰撞哈希
- 📝 纯 Markdown 存储:人可读、可手编、可 git 管理;无法解析的行在任何改写中原样保留
- ⚙️ 设置面板:浏览器卡片 +
settings.yaml双入口,全部配置热生效 - 🔒 护栏完备:内容哈希去重、每类条目上限、修剪顺序(手动条目最后淘汰)、注入预算、KV cache 友好的 digest 防重
安装
前置:已安装 [DSH](https://github.com/deepseek-ai/deepseek-harness) 且 `pnpm` 在 PATH 上。
# 从 GitHub 安装(本插件零构建步骤,无需 allowBuilds 配置)
dsh plugin --profile web add github:justhalfbit/dsh-plugin-memory
# 重启 dsh web 生效
`web` 是 `dsh web`(浏览器界面)对应的 profile 名;用其他 profile(如 `tui`)时把 `web` 换成对应名字即可。 `dsh plugin add` 会自动把包写入 profile 依赖并追加到 `dsh.profile.bundles`,无需手工编辑。
卸载:`dsh plugin --profile web remove dsh-plugin-memory`,重启生效;记忆数据保留在 `~/.dsh/memory`,可手动删除。
本地开发安装:克隆本仓库后 `pnpm install`,再 `dsh plugin --profile web add link:/绝对路径/dsh-plugin-memory`。
兼容性:针对 DSH `0.1.1-rc.x` 开发;rc 阶段上游 API 可能变动。
界面支持
| 运行形态 | 记忆核心(注入 / 蒸馏 / 工具 / 存储) | 设置卡片 |
|---|---|---|
dsh web(浏览器 GUI) |
✅ | ✅ |
tui / headless |
✅ 全部可用 | ❌ 改用 settings.yaml(同样热生效) |
host 半与界面无关;client 半(设置卡片)声明 `platform: "web"`,仅在浏览器界面加载。
工作方式
存储
~/.dsh/memory/projects/<全路径编码--路径哈希>/
├── memories.md # 主记忆文件:四个小节(Facts/Decisions/Lessons/Preferences)
└── topics/*.md # 专题文件:自由格式深度笔记(调试手册、API 约定……)
`memories.md` 长这样——id 由内容哈希派生(天然去重),尾注记录日期与来源 (`auto` 蒸馏 / `manual` 手动,修剪时 auto 先淘汰):
# Project Memory
## Facts
- [f-32e32a1b] host 进程日志直接输出到启动 dsh web 的终端,无 --log-file 选项
## Decisions
- [d-8c4c11ee] 记忆存储选纯 Markdown 而非 SQLite,为了可 git 管理