PostgreSQL-backed durable memory for DSH agents: MCP memory tools plus a Web panel for reviewing memories and candidates.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:AndyYang12345/dsh-butler-memory
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time. Only install sources you trust, and pin a commit (github:owner/repo#sha).
README
DeepSeek Harness 的长期记忆:agent 能用,你也能看见。 一个组合包同时打通 两条通道:模型获得
mcp__butler__memory_*工具;Web 会话头部出现"记忆"按钮, 面板可查看记忆、敏感度徽章、修订历史与待决候选——写入依然绑定 owner/revision/ audit,绝不静默入库。
DSH 组合包:把 butler-memory-mcp 的记忆能力接进 DeepSeek Harness 的两条通道——
- 给 agent:声明一个
dsh-mcp-client实例,spawnai-butler-memory-mcp, 模型获得mcp__butler__memory_*工具; - 给用户:一个 Web 端"记忆"面板(会话头部按钮 + 对话框),可查看长期
记忆、敏感度/类别徽章、修订时间线、推断候选并接受/拒绝,含服务健康
状态与离线时的分步安装指引——语义移植自
ai-butler-framework 的
web/index.html记忆面板。
DSH agent ──mcp__butler__memory_*──► butler-memory-mcp (stdio, DSH 托管)
DSH web 面板 ──host.call──► host 半部 ──JSON-RPC──► butler-memory-mcp (stdio, 插件托管)
零手动运行:两条通道都由 DSH/插件自动 spawn 子进程(崩溃后自动重启), 不需要你手动启动任何服务。
优雅降级:记忆桥缺失或未配置时(未装 pip 包、env 未配、数据库不可达),
dsh web 照常启动、普通对话不受影响——记忆工具暂时缺席,面板显示离线
状态与安装指引,修复后即恢复。
前置条件
- 已安装 butler-memory-mcp
(
pip install butler-memory-mcp,确保ai-butler-memory-mcp在 PATH 上); - 已按 butler-memory-mcp README 配置
~/.config/butler-memory-mcp/.env(数据库与桥设备凭据)。新机器/无数据库时一条命令完成全部初始化:ai-butler-memory-mcp setup-docker(需 Docker Desktop); - Node 22+;
dshCLI 已安装。
可选环境变量
| 变量 | 默认 | 作用 |
|---|---|---|
AI_BUTLER_MEMORY_MCP_COMMAND |
ai-butler-memory-mcp |
面板桥的启动命令(PATH 上找不到时给绝对路径) |
BUTLER_MEMORY_PANEL_URL |
未设置(stdio 模式) | 设置后回退到旧式 HTTP 面板模式,指向自管的 --transport http 实例 |
安装
从 npm(发布后推荐)
dsh plugin add dsh-butler-memory
插件激活时自动把 butler-memory skill 复制到
$DSH_HOME/skills/butler-memory/(幂等,崩溃不影响),DSH 的文件系统
skill 提供方会在所有 profile 中发现它;也可手动执行
npm run install-skill 重装。
本地开发(源码 checkout)
npm install
npm run build # 构建 client/dist/client.js
dsh plugin add .. # 本地路径安装到当前 profile
发布形态:package.json 同时声明 dsh.bundle(贡献 cordis.patch.yml 层)与
dsh.client(platform: web,浏览器 bundle 经 /plugins/<id>/client.js 注入)。
层顺序与覆盖
cordis.patch.yml 插入两行;用户可在自己的 $DSH_HOME/cordis.patch.yml 或
profile 的 cordis.patch.yml 整行覆盖(如换端口、换命令)。patch 是整行替换,
覆盖时需重述全部配置键。
验证(照搬官方 examples/mcp-memory 流程)
- 会话 A:
记住我的验证饮品是 lapsang-<唯一后缀>。→ 确认调用写入工具成功; - 新会话 B:
我的验证饮品是什么?查一下记忆。→ 确认召回; - 会话 B:
用这个偏好为会议建议一款饮品。→ 确认回答使用了记忆; - 点击会话头部"记忆"按钮:面板显示该条记忆(含类别/敏感度徽章); 面板中接受/拒绝候选后,记忆服务状态即时变化。
与官方示例的差异(本插件卖点)
官方 examples/mcp-memory 只提供模型工具,没有用户可视界面。本组合包把
butler 的"用户可看、可审、可撤销"面板带到 DSH,且写入依然绑定框架的
owner/revision/audit 语义。
兼容性验证记录(dsh 0.1.0-rc.6 实测)
ctx.inject(['connection'])+ctx.connection.rpc.handle静态插件 RPC 契约(对齐官方 dsh-api-gateway 用法);- Slot 注册:
ctx.slots.inject(key, () => ctx.slots.register({name, id, order}, Component)),与官方 dsh-client-ui-jobs 同槽位实测; - 客户端 bundle 采用模块表契约(
__ModuleLoader__+ CJS 工厂,React 由 页面提供); - MCP 协议 2025-11-25 握手、headless agent 工具调用、面板 RPC 通道、 桥崩溃自动重启均已在真实实例验证。
详见 PLAN.md。
License
Apache License 2.0,与上游项目一致。本包仅包含接入配置与面板代码, 不包含任何第三方运行时、模型权重或专有素材。
相关项目
- butler-memory-mcp — 记忆 MCP 服务器(本包的数据源);
ai-butler-framework— 记忆领域服务的实现方(上游);- DSH 官方第三方记忆 MCP 示例 — 本包接入方式的对齐基准。
Links
More in this category
volcengine/OpenViking#examples/dsh-memory-plugin★ 28936
OpenViking memory and context bundle for DeepSeek Harness: pre-step auto-recall and profile injection, session capture, `viking://` URI guarding, and recall/write memory tools backed by an OpenViking server.
vectorize-io/hindsight#coding-agents★ 20118
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
Ikalus1988/MisakaNet★ 404
Failure-recovery memory: search and record failure-recovery lessons from real engineering sessions, with BM25 + semantic RAG retrieval and a lessons knowledge base.
text2future/flowix#dsh-flowix-memory★ 315
Registers the local flowix-cli MCP server so the agent can search, read, create, and edit Flowix memos and mind-map artifacts.
dsh-engramory★ 155
The Engramory curated-memory discipline as an installable plugin ([npm: dsh-engramory](https://www.npmjs.com/package/dsh-engramory)): a deterministic 200-line / 25 KB cap on the `MEMORY.md` index via `ctx.tools.guard()` — growth denied, a shrinking rewrite always passes — plus the protocol registered as a runtime skill. The store is plain markdown, one file per fact, shared with Claude Code, Codex, Kiro, and OpenClaw.
omdsh-dev/dsh-mnemon★ 78
Cross-agent, local-first persistent memory plugin for DeepSeek Harness (DSH), powered by Mnemon. It shares long-term memory across Mnemon-enabled agents and adds runtime memory, searchable project documents, semantic recall, knowledge graph, and a Sidebar UI.