rea
morluto
Reverse engineer anything with agents, from app behavior down to native binaries.
PROJECT TOPICS
PROJECT README
MMPL (Memory Palace) memory plugin for DeepSeek Harness — connects the Rust DuckDB vector-memory MCP server via Streamable HTTP.
总览 Dashboard — 与 MMPL 后台同步的全局视图:常驻热记忆、L0 原始记录、技能库、检索账本、演化管道、遗忘曲线、向量模型与服务信息。

DSH plugins and MCP servers are two integration surfaces that end at the same place: the model's tool list (ctx.tools).
apply(ctx)) packaged as a bundle (dsh.bundle.patch in package.json). It registers tools, commands, and web panels directly.@deepseek-ai/dsh-mcp-client — itself a native plugin — bridges it: it lists the server's tools and re-registers them as mcp__<serverName>__<tool>.This package mounts the official MCP client against your MMPL server with sane defaults, then adds the lifecycle glue in-process. Memory logic (forgetting curve, retrieval, compression) stays server-side in Rust — one MMPL server can be shared by dsh, Claude Code, Codex, and anything else that speaks MCP, each seeing the same memories.
Three layers:
Tools (bundle patch) — mounts the shared @deepseek-ai/dsh-mcp-client against a running MMPL server, exposing its 9 memory tools as mcp__mmpl__*:
memory_write / memory_search / memory_listmemory_manage / memory_stats / memory_evolvememory_compress / memory_palace / memory_symbolNative lifecycle glue (index.js) — the official MCP client only bridges tools (it ignores MCP instructions), so this plugin adds what Hermes gets from its MemoryProvider hooks:
ctx.systemPrompt.section() + variable() 注册 mmpl:hot-memory 段(order 60),内容来自 GET /admin/api/context,默认 300 token,后台每 5 分钟刷新。session/event 的 turn/start / user/message / assistant/message / turn/end,turn 结束时把 U: …\nA: … POST 到 /admin/api/capture(≤4000 字符,sha1 去重)。连接与守护(v3.5.0) — 插件设置页(Settings)新增三个可编辑字段,均持久化到 profile patch:
http://127.0.0.1:7680/mcp,可填远端服务器。memory-mmpl 条目的 headers.authorization。@cup319/mmpl 服务端(隐藏后台进程,60s 冷却重试);远端 URL 永远不会启动本地进程。<base>/admin)。管理面板镜像(v3.11.0,多标签 + 增删改) — 双入口 + 七个标签,样式走 DSH 主题变量(浅色/深色自动跟随):
main 槽(key=mmpl)+ sidebar.panellist 槽(同 id、order=1、自带 SVG 图标),与「Plugins / Automation tasks」并列的独立入口,web 与桌面端一致(对齐内置 plugin-manager 的注册配方)。plugins.bundle.config 槽)。settings.section 槽,桌面端设置窗)。usage_events。/admin/api/models/download:已就绪仅记录选择,未就绪后台下载 3s 轮询进度,重启 mmpl 生效)。npm i -g @cup319/mmpl@latest,经插件宿主执行,远端 URL 永远不出安装钮)。autoStart 拉起服务端时 DATA_DIR 取 dataDir 配置 → 环境变量 → 默认 ~/.mmpl/data(不再依赖进程 cwd,杜绝看门狗重启落到空库)。/config/reveal 回读,默认仍掩码);「打开后台」链接自动拼 ?token=(rust 端 admin.html 认 query token 并转 Bearer,本地/远端一致),无 token 时回落普通链接。paths 字段,canonicalize 绝对化;服务端离线时诚实占位)。models/ 自动查找,代码既有能力);base/m3/qwen3 档仍按需从「模型」页下载。GET /admin/api/models/progress,Content-Length 百分比 + 已下载 MB);网页版后台与插件面板同步生效;首启自动下载同样带进度。~/.mmpl/pkg → 平台二进制准备(含默认模型)→ 自动拉起服务端,全程 GET /install-status 可轮询;已安装未运行时提供「启动服务端」按钮。archive.duckdb(DuckDB ATTACH 第二文件,与主库同目录、不参与任何检索)。自动遗忘(强度衰减)/ 手动删除 / 后台删除都先移入遗忘区:面板可查看(内容/原因/时间)、恢复回主库(保留原状态与强度)、彻底删除或一键清空;overview 计数新增 forgotten。主库体积与备份不再携带被遗忘数据。skill_files 表存于主库,同名覆盖、单文件 ≤8MB;网页版「内容」弹层与插件面板「技能库 → 内容」均可查看正文、上传/下载/删除附件(v3.17.3 起插件端按钮由「附件」更名「内容」,与网页版一致);MCP memory_skill action=get 响应带 files 清单,action=get_file name=… file=… 取 base64 正文。body_chars 不回正文(列表性能考量),插件编辑弹层改为打开时按需拉取单条(GET /admin/skill/{id})取回正文——修复「编辑时正文为空」。/updates)联动,升级完成即刷新。install.js 装完自动清理平台下载包(安装目录从 ~177MB 降至 ~95MB)。GET /api/dsh-mmpl/admin/* 只读查询 + POST/PUT/DELETE 写透传(自动带 Bearer token、无 CORS、路径白名单、body 上限 2MB)。每个请求在解析 body、进入路由之前先过 ctx.connection.requestRejection(req)——与 DSH 自家 /api 同一道 Host/Origin + 浏览器会话闸(401/403 即拒;宿主无 connection 服务则 503 拒发),不存在不受检的 HTTP 路由。"." 主导出(宿主按包名 import 原生模块,缺它整包不激活);client.js 插件 API 双写兜底(module.exports 与 exports 都挂);宿主 volatile 配置字段可能以对象形态传入,bridge 读写全程消毒,杜绝 [object Object] 毒 URL 自续。Everything is best-effort: if a service/hook is missing or MMPL is down, the plugin stays inert and the MCP tools keep working.
MMPL's Ebbinghaus forgetting curve, "memory palace" (archived-memory palace with confirm-before-purge), BM25 + ONNX semantic vector retrieval, and RRF fusion all live server-side — this bundle only wires the connection.
设置页「本地服务端」卡提供 启动 / 停止 / 重启 / 升级 四个按钮:
| 按钮 | 插件 API | CLI 等价 |
|---|---|---|
| 启动 | POST /api/dsh-mmpl/start-server |
mmpl_start |
| 停止 | POST /api/dsh-mmpl/stop-server |
mmpl_stop |
| 重启 | POST /api/dsh-mmpl/restart-server |
mmpl_restart |
| 升级 | POST /api/dsh-mmpl/upgrade-server |
mmpl_upgrade |
仅本机 URL 可用(远端模式不显示)。停止走进程信号(Linux SIGTERM / Windows taskkill /F),与服务端 DATA_DIR/mmpl.pid 约定一致。
官方 @deepseek-ai/dsh-mcp-client 只桥接工具、不读 MCP instructions;本插件在 index.js 补了两层原生逻辑:
| 能力 | 实现 | 行为 |
|---|---|---|
| 常驻热记忆 | ctx.systemPrompt.section() + variable() |
把 GET /admin/api/context 的热块注入系统提示(默认 300 token,后台每 5 分钟刷新) |
| 每轮捕获 L0 | ctx.on('session/event') |
turn/end 时把 U: …\nA: … POST 到 /admin/api/capture,进入 L0 后管道自动跑 L1→L3 |
服务或事件不可用时插件静默降级,MCP 工具照常可用。临时关闭:
MMPL_CONTEXT_TOKENS=0 dsh ... # 不注入热块
MMPL_CAPTURE_TURNS=false dsh ... # 不自动捕获
老版本 DSH 若没有 ctx.systemPrompt,用规则文件兜底(写进 workspace AGENTS.md):
## MMPL 记忆
- 每轮开始前调用 `mcp__mmpl__memory_search`,参数 {"mode":"context","token_budget":300},把返回的 text 当作已知背景。
- 每轮结束调用 `mcp__mmpl__memory_write`,参数 {"action":"capture","content":"U: <用户原文>\nA: <助手回复>","record_type":"conversation"},把真实对话落到 L0。
- 重要事实/偏好用 {"action":"encode","input":"...","type":"preference"} 沉淀为长期记忆。
通用做法(包括没有 hook 的 IDE)见 ../generic/README.md。
A running MMPL server at http://127.0.0.1:7680/mcp. With autoStart on (default) and a loopback URL, the plugin launches it for you when it finds a local @cup319/mmpl install (env MMPL_HOME, require.resolve, or the global npm root — install once with npm and forget). It never downloads or builds anything.
Install the server separately:
# npm (Rust single-binary edition)
npm install -g @cup319/mmpl
mmpl # → http://127.0.0.1:7680/mcp
dsh plugin --profile <name> add @cup319/dsh-mmpl
dsh --profile <name>
Primary configuration is the plugin's Settings page (volatile schema fields, persisted into the profile patch); the env vars remain as bootstrap/fallback overrides.
| Setting 字段 | 默认 | 说明 |
|---|---|---|
url |
http://127.0.0.1:7680/mcp |
MCP 端点;改后插件自动把 memory-mmpl 条目同步为新端点 |
authToken |
— | Bearer token(密文);自动写入 memory-mmpl 条目的 headers.authorization,清空则移除 |
autoStart |
true |
本机 URL 且端口未监听时自动拉起 @cup319/mmpl;远端 URL 忽略 |
| Env | Default | Purpose |
|---|---|---|
MMPL_URL |
http://127.0.0.1:7680/mcp |
Override the MCP endpoint (remote host / proxy); native layer derives /admin/api/* from it |
MMPL_AUTH_TOKEN |
— | Bearer token for native /admin/api/* calls |
MMPL_AUTOSTART |
true |
Supervisor fallback when the Settings field is untouched |
MMPL_CONTEXT_TOKENS |
300 |
Hot-memory budget in tokens (0 disables prompt injection) |
MMPL_CONTEXT_REFRESH_MS |
300000 |
Hot-memory refresh interval (min 30000) |
MMPL_CAPTURE_TURNS |
true |
Capture finished turns to L0 (false disables) |
Setting 优先于环境变量。MCP 工具调用的鉴权头由插件按 authToken 自动同步到 memory-mmpl 条目(经 host config-editor 写回 profile patch),无需再手改 cordis.patch.yml。
MMPL v3.3.6 起默认鉴权(监听
0.0.0.0时自动生成DATA_DIR/auth-token)。把该 token 填进插件设置页的authToken字段即可——插件会同时用于本地/admin/api/*调用和memory-mmpl条目的headers.authorization。用HOST=127.0.0.1启动 MMPL 则不需要。
mcp__mmpl__memory_write 写入)/admin → 「L0 原始记录」应出现本轮 U: … / A: …(原生捕获生效)memory_search 兜底若第 2 步没有记录:确认 MMPL_CAPTURE_TURNS 未被设为 false、MMPL 在 MMPL_URL 可达;若第 3 步仍需显式检索:确认 DSH 有 ctx.systemPrompt 服务(rc.5 的 base/headless/web profile 均内置),否则用 AGENTS.md 规则兜底。
To be listed in the awesome-dsh-plugin catalog (dsh-plugin-catalog on npm), submit a PR to awesome-dsh-plugin/awesome-dsh-plugin adding one file data/plugins/<owner>__<repo>.yml:
url: https://github.com/<owner>/MMPL # GitHub repo hosting this package
name: <owner>/MMPL#dsh-mmpl # monorepo subpackage form
category: memory
description:
en: Connects DeepSeek Harness to the external MMPL Rust DuckDB vector-memory
MCP server via the official MCP client bridge, exposing 9 memory tools.
zh: 通过官方 MCP 客户端桥接,将 DeepSeek Harness 连接到外置的 MMPL Rust DuckDB
向量记忆服务器,提供 9 个记忆工具。
Requirements checked by their CI: dsh.bundle declared in package.json (✅), repo ≥1 day old, dsh-plugin topic on the repo, description factual and verifiable against source.
This is an independent community integration, not an official DeepSeek or MMPL endorsement. See examples/mcp-memory in the deepseek-harness repo for the reference integration pattern.
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、deepseek-harness。