跳到正文

Jelee0145/dsh-mem

30最近提交 2026年8月14日

dsh-mem DSH 插件

dsh-mem 是 DeepSeek Harness 的一个 bundle 插件,实现了能力缝(capability seam)以提供长期记忆。它将事实、偏好和决策持久化到一个 JSON 文件中,所有会话共享,使代理能够跨对话记住和回忆信息。

如何安装 dsh-mem DSH 插件

dsh plugin --profile <name> add dsh-mem

来源命令需要人工核对。复制不会执行命令。

dsh-mem DSH 插件数据来源

dsh-mem DSH 插件快照日期:2026年8月16日

discovered

dsh-mem DSH 插件能做什么

  • memory_save:保存一条事实,可附带标签和项目字段
  • memory_recall:通过内容子串匹配和精确标签匹配搜索记忆
  • memory_forget:按 ID 删除指定的记忆条目
  • memory_list:列出所有记忆条目,支持项目过滤和结果上限
  • 原子文件写入:使用临时文件+重命名确保持久化
  • 零依赖其他配置文件:在无头配置和 Web 配置中均可正常工作,不会冲突

dsh-mem DSH 插件适合哪些场景

  • 让代理跨多个会话记住用户偏好
  • 存储项目特定的约定(例如“项目X使用pnpm工作区”)以保持代理行为一致
  • 在长时间运行的对话中通过保存和回忆关键事实来维持上下文
  • 通过 memory_list 调试或审计代理随时间学习到的内容

dsh-mem DSH 插件适合谁

  • 使用 DeepSeek Harness 构建多会话代理的开发者
  • 希望代理拥有持久记忆而不依赖外部数据库的用户

dsh-mem DSH 插件的限制

  • 单进程写入:不支持多个 dsh 进程共享同一个 root 目录
  • 无编辑 API:要更新一条事实,必须先 forget 再 save
  • 无结构化 schema:所有记忆为自由文本;对于有字段的事实,需要与模型约定固定的文本格式

dsh-mem DSH 插件的仓库 README 摘录

以下文字摘自 dsh-mem DSH 插件的上游仓库 Jelee0145/dsh-mem 的 README,版权归原作者,仅作引用。

English | [中文](README.zh.md) An out-of-tree **bundle** plugin for [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) (dsh) that implements a complete **capability seam** — Service Definition + Service Provider + Consumer. It gives agents durable long-term memory shared across every session: the `memory_save` / `memory_recall` / `memory_forget` / `memory_list` tools persist facts, preferences, and decisions to `$DSH_HOME/memory/memory.json`. ## Install Install from the **npm registry** (published as `dsh-mem`): ```sh dsh plugin --profile <name> add dsh-mem ``` > `dsh plugin add` is the dsh way to install a plugin: it resolves the package from npm (via pnpm) into the profile and registers its bundle layer. Do **not** use `npm install dsh-mem` — that installs the package as a plain dependency without activating any profile layer. From git instead (runs the package's self-contained `prepare` build; the first install asks you to allow the build in the profile's `pnpm-workspace.yaml`): ```sh dsh plugin --profile demo add github:Jelee0145/dsh-mem ``` Or from a local checkout: ```sh dsh plugin --profile demo add ./dsh-memory ``` Verify the composed layer without

阅读完整 README仓库未声明许可,使用前请先与作者确认。

dsh-mem DSH 插件常见问题

如何安装 dsh-mem?

使用 dsh plugin 命令:`dsh plugin --profile <名称> add dsh-mem`。这将从 npm 安装包并激活其 bundle 层。不要使用 `npm install dsh-mem`,因为它不会正确注册插件。

记忆数据存储在哪里?

记忆数据存储在 `$DSH_HOME/memory/memory.json`,默认路径为 `~/.dsh/memory/memory.json`。你可以备份该文件,或手动删除它以清除所有记忆。卸载插件不会影响数据。

如何在不卸载的情况下禁用插件?

是的,你可以通过修改配置文件的 `cordis.patch.yml` 来禁用插件。将 `id: memory` 和 `id: tool-memory` 行的 `disabled` 设置为 `true`。这是热重载的,无需重启 dsh。

dsh-mem 是否支持多个 dsh 进程同时运行?

不支持。dsh-mem 目前不支持多个 dsh 进程共享同一个 root 目录。所有记忆操作都在单个进程队列中序列化,没有跨进程锁。多个进程使用相同 root 可能导致数据损坏。

如何扩展 dsh-mem 或替换其存储后端?

你可以继承 `MemoryService` 类,并在 `cordis.patch.yml` 中将 `memory` 行指向你的自定义类。工具和契约保持不变。你还可以通过 `ctx.commands` 添加人类命令,或使用监听器在代理轮次中注入记忆。