DSH memory plugin backed by Elasticsearch: per-user indices with index-level ACL, a shared team knowledge base, Chinese BM25 plus vector retrieval, and a built-in review and audit panel. Its HTTP routes have no DSH access check, so a web page open in your browser could call them.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-memory-es
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:xqh0405/dsh-memory-es
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 — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
当前版本:0.6.65 · DSH 版本:≥ 0.1.0(engines.dsh;当前在 0.2.2-rc.1 上运行)
DSH(DeepSeek Harness)的记忆插件:用 Elasticsearch 做存储与检索,给 AI 助手一套跨会话、可检索、可治理的双层记忆——个人记忆库负责「我记得你」,团队知识库负责「我们踩过的坑」,两者可以互相晋升、彼此隔离。
功能
记忆的读写
memory_save:写入一条事实(内容归一化去重、身份由配置注入、embedding 不可用时降级为纯关键词)- 自动召回(可选,默认关):消息到达即检索,命中就注入系统提示(最多 3 条 / 600 字符,top1 向量分 ≥ 0.76 才注入,500ms 硬超时);每回合落 JSONL,面板「注入」页可看四态与耗时
memory_search:混合检索——BM25 + kNN 两路,库内 RRF 融合、跨库加权去重,按置信度分层判定;低置信只标注、不丢结果doc_search:长文(方案、复盘、开发文档)检索,按文档聚合,带命中的小节路径memory_update_status:失效 / 归档 / 被取代 / 恢复 / 私有,只改可见性、不物理删除memory_promote:把个人记忆标为团队候选
整理与治理
memory_distill后台蒸馏;memory_review是候选的采纳闸门(approve / reject / 锚点)memory_history沿supersedes链回溯与回滚- 整理任务(默认 dry-run):去重、改写、冲突检测、团队候选
检索质量
- 排序乘子:importance、命中次数、时间新鲜度、按类型的半衰期、访问强化
- 标识符精确匹配(
content_exact):修 IK 把lot.bd_write_sync这类标识符切碎导致的召回丢失 - 失效与过期过滤;
identity/persona/journal默认不进普通检索
人格与日常
- 人格两层:
persona.seed(人写,进系统提示)与表层学习(memory_persona,人工审核后生效) - 每日回顾
memory_journal(默认 23:30,面板「日记」栏) - 每日自动提炼(默认 02:30,产出待审候选)
- 表情包提示段(定义与图片放在包外目录)
面板
侧栏「记忆库」,主区整页(不是设置里的小窗):概览 / 记忆浏览 / 检索 / 注入 / 星图 / 自述 / 人格 / 审核台 / 维护 / 配置。
「检索」是按问题聚合的埋点视图,「注入」是每回合自动召回的回合栏(四态:已注入 / 超时 / 低分·低置信 / 无匹配,含被字符预算挤掉的条目)。
删除、维护、改配置、编辑人格都过权限探测:权限由 _has_privileges 现问,不认配置声明。
星图
一条记忆一颗星。纯 Canvas 2D 手写 3D 投影,零依赖、不引 WebGL。
- 星等按度数开方、亮度按新鲜度与 id 哈希抖动——少数亮星 + 大量小点,不是撒豆子
- 个人库与团队库各画一张盘并标人数;两库之间不建边(同一知识在两库各有一份,连成一条反而藏住"这是两份独立记录")
- 点一颗星进入它的两跳局部图;全局只画短边、悬停才亮出全部边,没有选中时不画线
- 氛围:旋臂薄雾、星尘底噪、远处景深(远星是糊开的光斑)、中心呼吸、四周暗角;首次进图有开场——黑场 → 星点逐个点亮 → 镜头推近 → 最新一条"叮"
- 工具栏可导出
.canvas(JSON Canvas 1.0,Obsidian 等可直接打开)
隔离与身份
一人一索引 personal_memory_<uid> + 索引级 ACL(ES 免费版没有 DLS,实测 403);
单账号模式 mem-user-<uid>,个人库读写由本人账号承担、团队库按角色授权;
工具参数里没有 user_id,索引名由 identity.userId 派生。
安装
从 Releases 下载 dsh-memory-es-<版本>.tar.gz,解包后一条命令安装——不需要克隆仓库,也不需要构建。插件与面板在同一个包里,只装一次;从旧版(面板是独立包)升级时脚本会自动移除旧面板:
tar xzf dsh-memory-es-<版本>.tar.gz
cd dsh-memory-es-<版本>
./install.sh # 本机:DSH_HOME=~/.dsh,profile=web
./install.sh --dsh-home /data/dsh # dsh 跑在容器里时(root 执行再加 --owner node)
前置条件:Linux + Docker(docker compose v2)、内存 ≥ 4 GB、Node.js ≥ 22 + dsh ≥ 0.1.0(engines.dsh,当前实测版本 0.2.2-rc.1);向量检索还需要 Ollama 与 bge-m3(没有它只剩关键词检索)。首次起 ES 要出网拉镜像与中文分词插件。
没有 ES 的机器(第一次装)再跑一条,把库和账号一起备好:
./es/setup.sh # 起 ES → 建索引 → 建角色/账号 → 生成配置片段
它会在 $DSH_HOME/memory-es/es 落地数据与证书,并生成 plugin-config.yml——把里面那段并进
profile 的 cordis.patch.yml(es.caCertPath 可以留空,会自动找到证书),再重启 dsh web。
⚠️ 别漏了
distill.provider/distill.model:自述(traits)与日记(journal)默认开启, 两者共用这条模型路由,与distill.enabled无关(蒸馏关着也必须填)。留空不会报错—— 提炼每次静默返回 0 条、日记永不写,只在启动时打一行红字。填你 dsh 里已有的 provider/model, 例如provider: deepseek-official+model: deepseek-flash。
装完自检(install.sh 会自动跑一遍,也可以随时手动):
./selfcheck.sh # 七项 PASS/FAIL:ES/CA、账号、索引、ACL、embedding、加载清单、配置
装完重启 dsh web,再核对版本:插件日志 ready: v<版本>、面板自检 自检通过 v<版本>、面板页脚「版本 <版本>」。
包里还带 manifest.json(版本、commit、构建时间)与 SHA256SUMS(sha256sum -c SHA256SUMS)。
自动更新(默认开)
装好后插件自己每天 06:00 检查 GitHub Release,有新版就安装,装完延迟 60 秒退出、 由 systemd / 容器策略拉起。关闭:面板「记忆库 → 配置 → 自动更新」取消勾选。
- 管理员实例:
update.migrate: true(建议at: '05:30'),升级时先给索引补字段再换代码; 需要该账号有manage权限:scripts/init-user.sh <uid> --team-write --with-migrate。 - 成员实例:只换代码;升级前做只读体检,缺字段就跳过、等下一轮(ES 是共享的,不需要各自迁移)。
- 排障:
~/.dsh/memory-es/update/update.log;只读核对版本:node scripts/update-check.mjs。
版本
当前 0.6.65。版本号是 X.Y.Z 纯数字,唯一来源是 package.json:
scripts/version.sh # 看当前版本
scripts/version.sh bump patch # 日常改动:末位 +1,第三位允许两位数(0.6.9 → 0.6.10)
scripts/version.sh bump minor # 重大变动才动第二位(0.6.0 → 0.7.0)
运行态三处可核对:插件日志 ready: vX.Y.Z、面板自检 自检通过 vX.Y.Z、面板页脚「版本 X.Y.Z」。
Links
More in this category
vectorize-io/hindsight#coding-agents★ 61388
Hindsight, agent memory that learns: long-term project memory with auto recall and retain, knowledge pages, deep reflection, and per-repo memory banks.
volcengine/OpenViking#examples/dsh-memory-plugin★ 42311
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.
MemTensor/MemOS#memos-local-plugin★ 12417
Local-first memory plugin for DeepSeek Harness: layered L1/L2/L3 memory with automatic capture, manual memos_* retrieval tools, and a built-in memory viewer.
agentscope-ai/ReMe#dsh★ 3812
Connects DeepSeek Harness to ReMe's local-first, self-evolving personal knowledge base: automatically captures completed main-agent conversations as user-owned Markdown memory, searches conversations and source material through reme_search with BM25, optional embeddings, and wikilink expansion, and schedules daily memory consolidation.
zilliztech/memsearch#MemSearch★ 2889
Shared Markdown memory for DSH and other coding agents, with automatic capture, pre-step context injection, searchable recall, and memory-to-skill self-evolution through a review panel.
vshulcz/deja-vu#extensions/dsh★ 1578
Cross-session memory and context recovery across forty-five other coding agents (45+) on this machine, reading session files they already wrote before install (Claude Code, Codex, Cursor, Windsurf, Trae, Antigravity, VS Code Copilot Chat, opencode, OpenClaw, Hermes, Kimi, Qoder, Cline, Zed, Magpie and more): six tools (deja_recall, deja_session, deja_blame, deja_fix, deja_how, deja_remember), a /deja command, and optional automatic recall injected into runtime context. Local BM25 CLI/MCP index, no LLM, no embeddings, no network (dsh plugin --profile web add dsh-deja).
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.