🧬 给 LLM 装上会自我进化的记忆
dsh-mneme 是 DeepSeek Harness (DSH) 的跨会话记忆插件。它不只「存得下」,更「管得好」:后台自动去重合并、矛盾先冻结等你裁决、全程可回放审计、记忆只落在本机,还支持导出成人可读的 Markdown。
Mneme(Μνήμη)源自希腊记忆女神 Mnemosyne。她掌管记忆与梦境——正如
autoDream在后台默默巩固你的记忆库。
Power your agent
คำสั่งของผู้เผยแพร่เอง ไม่ใช่เอนด์พอยต์ของ PlugMCP
Host a copy with our keys and logs.
npx -y [email protected]Claude Code ไม่มีลิงก์ติดตั้งสำหรับคำสั่งแบบโลคัล ให้คัดลอกคำสั่งด้านล่างแล้วรันในเทอร์มินัล
claude mcp add io.github.modusensus-mneme-memory -- npx -y mneme-memory@0.1.1รันในเทอร์มินัล
{ "mcpServers": { "io.github.modusensus-mneme-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
URL แบบรีโมตหรือคำสั่งบนเครื่องของคุณ? การติดตั้งสองแบบต่างกันอย่างไร
รันบน PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
เปิดจากผู้เผยแพร่
dsh-mneme 是 DeepSeek Harness (DSH) 的跨会话记忆插件。它不只「存得下」,更「管得好」:后台自动去重合并、矛盾先冻结等你裁决、全程可回放审计、记忆只落在本机,还支持导出成人可读的 Markdown。
Mneme(Μνήμη)源自希腊记忆女神 Mnemosyne。她掌管记忆与梦境——正如
autoDream在后台默默巩固你的记忆库。
Cross-session memory for AI coding agents via six tools; local-first SQLite store.
只记大改动,逐条细节见 CHANGELOG。
每次新开对话,AI 都像第一次认识你?
dsh-mneme 给 DeepSeek Harness 装上跨会话记忆。 你聊过的项目、提过的偏好、做过的决定,AI 都记得——即使关掉了窗口,下次打开还在。
但 dsh-mneme 的可信之处,恰恰在你看不见的后台。下面这些,才是它和「一个会存东西的插件」的本质区别。
scopeEnabled 开启后,每条记忆标注由哪个 agent、在哪个工作区写入;检索时本会话作用域优先(命中加权,他 scope 降权仍可见);strictScope 再进一步——显式声明收窄到他者作用域的记忆在检索/注入里完全不可见(载体自动标注只降权,不硬挡)。多 Agent、多项目互不串台。embedProvider 设为 local 后检索走本地 Embedding 与精排,不需要 API Key;没配嵌入时关键词 / BM25 检索照样能用。.md 文件,随时打开编辑;人工改动会被优先尊重,不会被机器覆盖。它和 Zep / Mem0 / Letta / Hindsight 比呢? 有一张逐项对照表——存储底座、检索、写入时抽取、离线巩固、冲突处理、遗忘、作用域、可审计性、多宿主、离线、许可证共 11 行,「—」不等于「差」:能力对比。
# 安装插件(最省事的一条:npm 包名)
dsh plugin --profile web add @modusensus/dsh-mneme
dsh web
DSH 的 设置 → 插件 → Add plugin 与 dsh plugin add 认四种写法,填进去的是什么就装什么。本仓库是个单仓多包:仓库根那份 package.json 只是仓库壳(private、不带 dsh 字段),真正可安装的插件本体在 dsh-mneme/。所以走 Git 或 tarball 时必须指到子目录,否则装到的是壳本身。
为什么仓库根要放一份装不了的壳?因为有些单仓多包探测器(比如 dshfind 的插件探测)只认仓库根的清单——没有它就会把本仓库判成「不可安装的插件包」,而这句判词与实际上能不能装无关。根清单
private+0.0.0+ 不带dsh字段,就是为了让这类工具能找到子包、同时绝不被当成插件本体安装或发布。
# 从源码装(本地目录,改完代码重启即生效)
git clone https://github.com/slow-stack/mneme.git
dsh plugin --profile web add "$(pwd)/mneme/dsh-mneme"
# 或者直接从 Git 装(不落源码,适合只要个能跑的版本)
dsh plugin --profile web add 'git+https://github.com/slow-stack/mneme.git#path:/dsh-mneme'
面板里那行「Install guide and examples」只演示了包名一种写法;上面四种都是实测通过的。Git 与 tarball 来源在安装时宿主会做一次仓库可达性检查(超时默认 5 秒)。
装完即可用。想在 5 分钟内看到它的价值:
以上均在 DSH 设置面板 → 记忆库设置 中修改。完整配置见 配置章节。
记忆库默认在 ~/.dsh/memory,天然在宿主 profile 作用域之外;但真实落点由 memoryDir 配置决定。若把它指进 profile 作用域(形如 …/profiles/<名字>/…),宿主清理或迁移 profile 时记忆库会被连带带走(#218 末楼记录的实际事故)。插件启动时检测到这种落点会打一条告警——只提示、不搬库。安全做法:memoryDir 保持在 profile 之外(默认值即可);要迁移库 = 停止写入 → 复制整个目录 → 改配置指向新位置 → 重启。
写入 ──► 质量过滤(无用信息先拦下)
│
▼
SQLite + 本地 Markdown 镜像
│(空闲时)
├─ autoDream :去重 / 合并 / 归档 / 修正 / 冲突冻结
└─ Sleep Mode :分层压缩 + 模式发现 + 关系补全(可关)
│
▼
召回(混合检索 + 精排)──► 注入会话上下文
记忆库记得住为什么这么做,但记不住这件事到底怎么跑。工作流住在哪,决定了它能不能被改:住在记忆库里是一行没有 diff 的文字,住在会话里是一次性的提示词,住在人脑里改不动也不留痕。
所以 v0.9 把它们搬进项目仓库——一条工作流一个文件:
<项目>/.mneme/pipelines/<id>.json ← 项目层(能提交、能 diff、能 PR、能被 CI 读)
<插件包>/pipelines/<id>.json ← 全局层(兜底,今天包里没有这个目录,这是有意的)
分工是一句话:记忆是「为什么」,仓库是「怎么跑」,图是「看起来怎么样」。
<memoryDir>/candidates/<项目键>/,只在本地。一天长十条死九条的东西进仓库就是垃圾。升格要同时满足「走过两次(至少一次成功)」且「写得出反事实」;够格之后系统只提议,提交与推送始终是人握着的那道门。refuted / trusted / stale / candidate)全部从运行记录推,不由作者写死;今天还没有运行记录落点,所以全体恒为 candidate——这就是那个 beta 标签必须摆在脸上的原因。默认关(actionPipelineEnabled)。设计取舍与踩过的坑见 docs/WORKFLOWS.md。
面板内置中英双语,跟随你的 DSH 界面语言显示。以下为中文截图,英文版请切至文末 English 段落。
autoDream / autoSummarize 默认开)dreamProvider / dreamModel 与 summarizeProvider / summarizeModel —— 配了这两组就绕过宿主直连,换宿主不会生效),或直接关掉 autoDream / autoSummarize插件自带零依赖 stdio MCP server(独立 npm 包 mneme-memory,bin 名 mneme-mcp),任何 MCP 客户端都能挂载记忆六件套(memory_save / memory_search / memory_list / memory_get / memory_update / memory_delete)。
前置条件(一次性):
127.0.0.1:8790)各客户端挂载(<你的token> 替换为上一步生成的值):
旧挂载兼容:已部署的
dsh-mneme-mcp+DSH_MNEME_TOKEN写法继续有效(bin 与 env 变量均保留,无需迁移)。未全局安装 npm 包时,把command换成npx并追加参数-p mneme-memory mneme-mcp(Claude Code/OpenCode 写进 args 数组,Codex 写args = ["-p", "mneme-memory", "mneme-mcp"])。配置细节与安全注意事项见完整文档。
dsh-mneme-serve 把记忆库跑成常驻数据面——DSH 关着,第三方集成(网页端桥接、脚本、自有面板)照样读写同一份记忆:token 与 DSH 面板/CLI 共用,路由与「外部访问 API」同源,端口被占直接报错(与 DSH 外部访问二选一)。第一期无 LLM(巩固/蒸馏仍属 DSH 宿主);检索默认 local 嵌入(首次启动自动取件模型,--embed off 可关)。
npm i -g @modusensus/dsh-mneme
dsh-mneme-serve # 默认 ~/.dsh/memory + 127.0.0.1:8790
社区项目把 mneme 接入更多平台——它们不是本仓库的一部分,兼容性由各自维护者跟进:
想被收录?在 Discussions 开帖介绍你的项目,或直接提 PR 补充本表。
🧬 记忆基因 → 🛡️ 审计加固 → 💤 睡眠维护 → 🕸️ 召回融合与图谱 → ✨ 面板增强 → 🌡️ 自进化记忆 → 🔐 作用域隔离 → 🌐 生态(MCP / daemon)→ 🧭 M.O.(项目级工作流)
完整逐小版本说明见 CHANGELOG。
cd dsh-mneme && npm install
npm test # 2302 个测试
npm run stress # 三轴线压测
npm run sync # src → lib 同步
autoDream 的理念溯源(理念借鉴、实现原创):
在上述工作之上,dsh-mneme 做了自己的工程发展:K-Means++ 聚类预分组、类型化决策清单(keep / merge / archive / conflict / update,及 sleep 侧 supersede / differentiate)与可回放的 sha256 摘要审计链(dream_runs / receipt_chain)。如有遗漏的灵感来源,欢迎提 issue 指出。
dsh-mneme 的机制设计与下列公开研究相互印证(以下引用均逐一核对过 arXiv 收录页;机制对应关系为我们自己的映射,非原论文观点):
dsh-mneme is a cross-session memory plugin for DeepSeek Harness (DSH). It does not just store your memories — it manages them: background deduplication and merging, conflicts frozen for your review, a fully replayable audit trail, memory kept on your machine, and export to human-readable Markdown.
Mneme (Μνήμη) comes from Mnemosyne, the Greek goddess of memory and dreams — just as
autoDreamquietly consolidates your memory store in the background.
Headlines only; see the CHANGELOG for the full list.
Every time you start a new chat, the AI acts like it's never met you?
dsh-mneme gives DeepSeek Harness cross-session memory. Projects you've discussed, preferences you've mentioned, decisions you've made — the AI remembers them even after you close the window.
But what makes dsh-mneme trustworthy lives in the background you never see. These are the traits that set it apart from "a plugin that just saves things."
scopeEnabled, every memory is stamped with which agent wrote it and in which workspace; retrieval favors the current scope (weighted hits, out-of-scope demoted but visible); strictScope goes further — memories explicitly scoped to other agents/workspaces become invisible to search and injection (auto carrier labels are demoted only, never hard-blocked). Multiple agents and projects, zero cross-talk.embedProvider to local and retrieval uses local embedding + reranking, no API key needed; without an embedder, keyword / BM25 retrieval still works..md files you can open and edit; human edits are respected, never clobbered by the machine.How does it compare with Zep / Mem0 / Letta / Hindsight? There is a row-by-row table — storage, retrieval, write-time extraction, offline consolidation, conflicts, forgetting, scoping, auditability, multi-host, offline, license: 11 rows, and "—" does not mean "worse": capability comparison (Chinese).
# Install the plugin (the easy path: npm package name)
dsh plugin --profile web add @modusensus/dsh-mneme
dsh web
Settings → Plugins → Add plugin and dsh plugin add accept four kinds of spec — whatever you paste is what gets installed. This repository is a multi-package repo: the package.json at the root is only a repo shell (private, no dsh field), while the installable plugin lives in dsh-mneme/. So Git and tarball specs must point at that subdirectory; otherwise you install the shell itself.
Why ship an uninstallable shell at the repo root? Because some multi-package detectors (dshfind's plugin probe, for one) only look at the root manifest — without it this repository is judged "not an installable plugin package," which says nothing about whether it actually installs. The root manifest is
private+0.0.0+ carries nodshfield precisely so such tools can find the real subpackage while it can never be installed or published as the plugin itself.
# From source (local directory; edit code, restart, done)
git clone https://github.com/slow-stack/mneme.git
dsh plugin --profile web add "$(pwd)/mneme/dsh-mneme"
# Or straight from Git (no checkout; good for just running a version)
dsh plugin --profile web add 'git+https://github.com/slow-stack/mneme.git#path:/dsh-mneme'
The "Install guide and examples" panel only demonstrates the npm form; all four above are verified. Git and tarball sources get one repository-reachability check at install time (5-second timeout by default).
It works out of the box. To feel its value in five minutes:
All of these live in DSH Settings → Memory Settings. Full config docs in the Configuration section (Chinese, bilingual file).
The library defaults to ~/.dsh/memory, which is naturally outside any host profile scope; the actual location follows your memoryDir config. If it points inside a profile scope (a path like …/profiles/<name>/…), the library is taken away along with the profile when the host cleans or migrates it (an actual incident recorded in #218). The plugin logs a warning at startup when it detects such a location — advisory only, it never moves your data. Safe practice: keep memoryDir outside profiles (the default already is); to migrate, stop writing → copy the whole directory → point the config at the new location → restart.
write ──► quality filter (drop noise first)
│
▼
SQLite + local Markdown mirror
│ (when idle)
├─ autoDream : dedupe / merge / archive / fix / freeze-conflict
└─ Sleep Mode : tiered compression + pattern discovery + relation completion (opt-in)
│
▼
recall (hybrid search + rerank) ──► inject into the conversation
The memory store remembers why a thing was done that way, but not how the thing actually runs. Where a workflow lives decides whether it can be changed at all: as a line in the memory store it has no diff; as a session prompt it exists once; in someone's head it can't be edited and leaves no trace.
So v0.9 moves workflows into the project repository — one file per workflow:
<project>/.mneme/pipelines/<id>.json ← project layer (commit, diff, PR, readable by CI)
<plugin>/pipelines/<id>.json ← global layer (fallback; the package ships none today, on purpose)
One sentence of division of labour: memory is the "why", the repo is the "how", the graph is the "what it looks like".
<memoryDir>/candidates/<project-key>/, local only. Ten a day, nine dead: in the repo that's just garbage. Promotion requires both "walked twice (at least once successfully)" and "can state the counterfactual"; even then the system only proposes — commit and push stay a human gate.refuted / trusted / stale / candidate) are derived from run records, never authored; there is no run-record sink yet, so every node is candidate — which is exactly why that beta label has to be on the surface.Off by default (actionPipelineEnabled). Design trade-offs and pitfalls: docs/WORKFLOWS.md (Chinese).
The panel is bilingual and follows your DSH interface language. English shots below; see the Chinese section for the localized UI.
autoDream / autoSummarize are on by default)dreamProvider / dreamModel plus summarizeProvider / summarizeModel (setting those routes talks straight to that provider, so switching the host alone will not help) — or just turn off autoDream / autoSummarizeThe plugin ships a zero-dependency stdio MCP server (standalone npm package mneme-memory, bin mneme-mcp). Any MCP client can mount the six memory tools (memory_save / memory_search / memory_list / memory_get / memory_update / memory_delete).
One-time prerequisites:
127.0.0.1:8790)Per-client setup (replace <your-token> with the value from the previous step):
Legacy mounts keep working:
dsh-mneme-mcp+DSH_MNEME_TOKENremain supported (both the bin and env vars are preserved; no migration needed). If the npm package is not installed globally, usenpxas the command with args-p mneme-memory mneme-mcp(an args array in Claude Code/OpenCode;args = ["-p", "mneme-memory", "mneme-mcp"]in Codex). Full config details and security notes: full docs (Chinese).
dsh-mneme-serve runs the memory store as a long-lived data plane — with DSH closed, third-party integrations (web-bridge tools, scripts, your own panels) still read and write the same memories: the Bearer token is shared with the DSH panel/CLI, routes mirror the external API, and a busy port is a hard error (pick either the daemon or DSH's external API, not both). Phase 1 is LLM-free (consolidation/distillation stay with the DSH host); retrieval defaults to local embeddings (runtime + model auto-provisioned on first boot, --embed off to disable).
npm i -g @modusensus/dsh-mneme
dsh-mneme-serve # defaults: ~/.dsh/memory + 127.0.0.1:8790
Community projects that wire mneme into more platforms — not part of this repository; compatibility is tracked by their maintainers:
Want your project listed? Open a Discussion or send a PR adding a row to this table.
🧬 Gene → 🛡️ Audit hardening → 💤 Sleep maintenance → 🕸️ Recall fusion & graph → ✨ Panel enhancement → 🌡️ Self-evolving memory → 🔐 Scope isolation → 🌐 Ecosystem (MCP / daemon) → 🧭 M.O. (project-level workflows)
Full per-minor-version changelog in CHANGELOG.
cd dsh-mneme && npm install
npm test # 2302 tests
npm run stress # three-axis stress test
npm run sync # src → lib sync
Provenance of the autoDream concept (ideas credited, implementation original):
On top of these, dsh-mneme adds its own engineering: K-Means++ cluster pre-grouping, a typed decision list (keep / merge / archive / conflict / update, plus supersede / differentiate on the sleep side), and a replayable sha256-digest audit chain (dream_runs / receipt_chain). If any source of inspiration is missing, please open an issue.
dsh-mneme's design echoes the following public research (every citation below has been verified against its arXiv page; the mechanism mappings are our own, not the papers' claims):
MIT
Cross-session memory for AI coding agents via six tools; local-first SQLite store.
{ "mcpServers": { "io.github.modusensus-mneme-memory": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}เครื่องมือ
ยังไม่มีรายการเครื่องมือ เซิร์ฟเวอร์แบบรีโมตจะได้รายการหลังการตรวจสอบสถานะครั้งแรก
FAQ
คัดลอกคอนฟิก stdio สำหรับ Cursor, Claude Desktop, Claude Code หรือ VS Code ได้ในหน้านี้ คอนฟิกนี้ใช้การติดตั้งของผู้เผยแพร่ ไม่ใช่พร็อกซีของ PlugMCP
ระเบียนนี้ไม่ได้ระบุตัวแปรสภาพแวดล้อมที่จำเป็น
Mneme Memory ทำงานแบบโลคัลผ่าน stdio
ตรวจสอบล่าสุดเมื่อ 2026-11-13 Cross-session memory for AI coding agents via six tools; local-first SQLite store.