dsh-memory-shelf
chelungung/dsh-memory-shelf
Categorized personal memory for DSH with three-level categories, groups and entries; pick selected memories as conversation background; agent memory tools, optional automatic summaries, and attachments for images, documents, sheets and slides. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
dsh plugin --profile web add github:chelungung/dsh-memory-shelfREADME
记忆库 · dsh-memory-shelf
给 DeepSeek Harness(DSH)一个可以长期整理的个人记忆库:自我介绍、偏好习惯、工作背景、比赛与项目经历都能分门别类地存下来;新对话时按需勾选一部分作为系统提示里的背景;任务进行中也可以让 AI 把值得长期保留的信息沉淀进来。
- 本地优先:所有内容保存在
$DSH_HOME/memory-shelf/store.json,不依赖外部 API。 - 完全可控:AI 只能新增/更新记忆,不能删除;删除永远由你在界面里确认。
- 结构清晰:分类 → 分组 → 条目三级,例如「比赛」分类下每场比赛一个分组。
功能
| 能力 | 说明 |
|---|---|
| 三级记忆结构 | 分类 → 分组 → 条目。条目有标题、正文(纯文本换行)、可选标签、可选绑定工作区。 |
| 左侧栏记忆库页面 | 在左侧栏面板图标行打开:分类列表、分组/条目浏览、搜索、新建/编辑/删除,删除分类或分组会级联并二次确认。 |
| 新对话铺垫 | 输入框工具行的「记忆 · N」按钮打开三级勾选树:整类、某个分组(如某一场比赛)、或单条都能勾选。选中的内容从下一条消息起注入系统提示,输入框下方显示「已带入 N 条记忆」清单提示。 |
| AI 记忆工具 | memory_save(写入/更新)、memory_search(检索)、memory_get(读取全文),可随时在设置里关闭。 |
| 自动总结 | 可开关,三档时机:每轮结束检查 / 会话闲置后 / 仅在点按钮时。由当前默认模型提炼对话中值得长期记住的信息。 |
| 拖拽排序 | 分类之间、分组之间(可拖到别的分类)、条目之间(可拖进别的分组/分类)都能整行按住拖动排序,带动画;置顶项固定最前。 |
| 置顶 | 分组可在分类内置顶,条目可在所在容器内置顶;置顶项之间也能拖拽排序。 |
| 折叠浏览 | 默认只显示分组名和条目标题;点分组行展开整组、点标题展开正文,设置里可改默认展开。 |
| 可选标题 | 标题可以不填;编辑器提供「AI 起名」和「用当前时间」两个按钮,留空保存时自动用 2026-11-28-16:58:47 这种时间标题。 |
| 删除撤销 | 删除分类/分组/条目后,底部提示条可以「撤销」,只撤回最近一次删除。 |
| 可选范围总结 | 输入框「记忆」面板里的「总结本次对话」会先让你勾选对话轮次,并选择「纯总结」或「总结目的(目标/截止/产物)」两种风格,再生成一条记忆:分类用当前工作区名、标题用当前会话名;同名标题可选择替换、追加、自动编号(如「…1」)或自拟标题。 |
| 附件 | 条目正文可附图片、文档、表格、PPT 等文件(单个 ≤20MB、最多 8 个);图片在正文内预览,其他文件以可点击附件显示。 |
| 设置 | 允许带入铺垫、AI 记忆工具、自动总结三档时机、默认展开、显示密度、铺垫长度上限、AI 起名模型;在 DSH 设置「记忆库」页和记忆库页面齿轮两处都能改。 |
安装
插件是 DSH profile bundle,安装到具体 profile:
# Before the npm release is out, install straight from GitHub:
dsh plugin --profile <profile> add github:chelungung/dsh-memory-shelf
# After publishing to npm:
dsh plugin --profile <profile> add dsh-memory-shelf
在 Desktop 应用中请使用应用自己的插件页安装:Desktop 的 profile 由应用管理,命令行不会改动它。
安装后在左侧栏面板图标行出现「记忆库」;如果没出现,刷新 Web 页面或重启一次 DSH。
使用
- 打开「记忆库」,先用「新建条目」写下几条记忆:
- 分类「个人介绍」:我是谁、技术栈;
- 分类「偏好习惯」:回答风格、协作习惯;
- 分类「工作背景」:当前项目、团队约定;
- 需要时新建「比赛」分类,再给每场比赛建一个分组。
- 在任意会话(包括新会话首屏)点输入框工具行的「记忆」按钮,勾选这次要带入的内容,完成后输入框下方会出现已带入清单。
- 想让 AI 自己沉淀记忆时,在记忆库右上齿轮里打开「AI 记忆工具」;想让它在对话结束后自动提炼,再打开「自动总结」并选择时机。
- 选择面板里的「总结本次对话」可以随时手动整理当前对话。
数据与限制
- 数据位置:
$DSH_HOME/memory-shelf/store.json(默认~/.dsh/memory-shelf/store.json)。删除该文件等于清空记忆库。 - 记忆注入走系统提示,聊天记录里只显示清单提示,不额外插入聊天消息。
- 条目正文按纯文本换行显示,不渲染 Markdown。
- 自动总结需要当前配置了可用的默认模型;「每轮结束」档会每轮额外调用一次模型,请按需开启。
- 记忆仅保存在本机,不提供云同步、导入导出或多端同步。
- 删除分类会级联删除其下分组与条目,界面会二次确认。
开发
无需构建:index.js 是 Host 半侧,client.js 是浏览器半侧,均直接加载。
node --check index.js
node --check client.js
主机侧接口都挂在 /dsh-memory-shelf 前缀下(/state、/selection、/mutation 等),浏览器半侧只通过它们读写。
English
dsh-memory-shelf keeps a categorized personal memory inside DeepSeek Harness. Categories contain groups (for example, one group per competition), groups contain entries. Open the Memory panel from the left sidebar to browse, search, create, edit and delete memories. In any conversation, the Memory control in the composer tool row lets you check whole categories, whole groups or single entries; the chosen memories are injected into that conversation's system prompt from the next message on, and a hint under the composer lists what is currently brought in. The agent can save and search memories through memory_save / memory_search / memory_get, and optional automatic summarization can distill finished conversations into new entries. Everything is stored locally in $DSH_HOME/memory-shelf/store.json; deletion is always confirmed in the UI and the agent cannot delete memories.
MIT licensed.