Qinling-Melon-Farmers/dsh-memoir ↗★ 0
dsh-memoir
Project persistent memory and session-lessons distillation for DeepSeek Harness (DSH): an agent records a session's work summary, lessons learned, and next-action guide (memoir_record) into a per-project PROJECT_MEMORY.md plus a cross-project index (~/.dsh/dsh-memoir.json), reads it back on demand (memoir_read), auto-distills each worked turn at turn end, and has the project memory auto-injected into the system prompt of future sessions. Ships a web-GUI 'Memory' panel (project/global tabs, search, manual record/delete) over /api/dsh-memoir routes. TypeScript, mounted via the dsh.bundle.patch manifest, no dsh source changes.
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Qinling-Melon-Farmers/dsh-memoir说明文档
阅读完整 README ↗dsh-memoir
把「一个会话做了什么 / 踩了什么坑 / 下一步怎么走」沉淀为项目持久化记忆,并作为未来 AGENTS 的行动指南自动注入后续会话;插件开启后每轮有实际工作的回合结束时自动提醒 agent 归纳沉淀,另有 Web GUI 可视化面板浏览、检索与维护记忆。
- 自动收尾(auto-distill):监听
agent/turn-stopping,一轮有工具调用、且尚未记录过记忆的回合结束时,自动 steer 一句归纳提示,让 agent 用memoir_record把该轮工作沉淀为项目记忆(无实质工作的回合不打扰、子代理会话不打扰、每回合最多一次)。 - 归纳总结:
memoir_record归纳工作记录、经验教训与行动指南。 - 持久记忆:项目级写入
/PROJECT_MEMORY.md(随 git 提交);结构化源数据存全局索引~/.dsh/dsh-memoir.json(跨项目检索)。 - 自动行动指南:新会话开始时,插件把本项目的
PROJECT_MEMORY.md自动注入 system prompt,未来 AGENTS 无需手翻文档即可继承既往经验。 - 可视化面板:侧边栏「记忆」入口,中心面板提供项目 / 全局两个视图、全文检索、手动记录与删除。
设计背景
DSH 的 agent 会话本身是「失忆」的:新会话不记得上一个会话踩过的坑。现实中的典型代价是反复排查同类问题——控制台中文乱码要查一次、某个终端的转义错误要查一次、某个工具的环境配置又要查一次;AGENTS.md 这类人工维护的说明文件要么没人更新、要么被塞得臃肿。社区已有的记忆类插件各有侧重:dsh-memory 侧重无损引用式检索、dsh-mnemon 依赖外部 Mnemon 服务、distill 自动蒸馏但落成 skill 文件、缺少可视化面板。
dsh-memoir 想补的是一个开箱即用、纯本地、零外部依赖的记忆层,把「记录 → 存储 → 自动注入 → 可视化维护」串成闭环:
- 记录:agent 在任务收尾调用
memoir_record(或插件每轮工作结束自动提醒); - 存储:结构化 JSON 全局索引为源,
PROJECT_MEMORY.md为可读渲染(随 git 提交、人也能看); - 注入:新会话开始时按项目自动注入记忆,未来 AGENTS 无需手翻文档即继承经验;
- 维护:Web 面板可检索、补录、删除,与 agent 写的是同一份数据。
能力
| 工具 | 作用 |
|---|---|
memoir_record(section, title?, content) | 记录一条记忆,section 取值 work / lessons / actions / note |
memoir_read(scope?, section?, query?) | 读取记忆,scope 取值 project(默认)/ global / all |
面板(/api/dsh-memoir/*):