mindscale-noah/MindMemOS--plugins-deepseek-harness-plugin ↗★ 938
@mindmemos/deepseek-harness-plugin
DeepSeek Harness (dsh) plugin that recalls and writes MindMemOS memories through the mindmemos CLI.
AI 분석
核心用途是赋予 Agent 跨会话的长期记忆能力。适合需要构建个性化知识库、让 Agent 记住历史交互细节的用户;需先安装 CLI。
설치
검증된 bundle이 없거나 호환성 검사에 실패했습니다. 먼저 저장소 설명을 읽어 주세요. 전체 README 읽기 ↗
@mindmemos/deepseek-harness-plugin
A DeepSeek Harness (dsh) plugin that wires MindMemOS long-term memory into the harness. It:
- recalls memories before each turn by running
mindmemos memory searchand injecting the hits as model context, and - stores each completed turn by running
mindmemos memory add.
It is a thin shell-out layer over the mindmemos CLI — the same integration the
OpenClaw plugin provides for a different host.
Prerequisite: the mindmemos CLI must be installed and authenticated
first. Installing this plugin alone does nothing — it spawns the CLI for every
operation.
Install the CLI
# whichever installer you use for the MindMemOS CLI; e.g.
pip install mindmemos-sdk
mindmemos auth
Confirm it works from the shell dsh will run under:
mindmemos config show
Install the plugin
Install the published package in the project where dsh runs:
npm install @mindmemos/deepseek-harness-plugin
For local development before publishing, build from this repo instead (see
Build) and register the built entry by file:// URL.
Build
cd plugins/deepseek-harness-plugin
npm install
npm run build # emits dist/index.js + dist/index.d.ts
npm run typecheck runs the same compiler pass without emitting — use it to
validate against the dsh types before wiring the plugin up.
Register
dsh composes plugins through layered cordis.patch.yml files. Add an insert
entry to your profile patch ($DSH_HOME/cordis.patch.yml or the profile's
cordis.patch.yml):
- insert:
- id: mindmemos-memory
name: '@mindmemos/deepseek-harness-plugin' # once published
config:
userId: alice
appId: deepseek-harness
For local testing before publishing, point name at the built entry (see
cordis.patch.example.yml for the exact form):
- insert:
- id: mindmemos-memory
name: 'file:///C:/…/plugins/deepseek-harness-plugin/dist/index.js'
config:
userId: alice
id is stable and unique; the plugin's cordis name is mindmemos-memory.
To disable the plugin, set disabled: true on the entry rather than removing
the row.
Configure
| Option | Default | Meaning |
|---|---|---|
cli | mindmemos | Executable used to invoke the CLI — a name on dsh's PATH or an absolute path. It is not a shell command, so a wrapper like uv run mindmemos will not work; point it at the real executable instead. |
topK | 5 | Number of memories injected per turn. |
addMode | async | sync blocks until extraction finishes; async enqueues and returns. In async mode only CLI-level failures are visible to the plugin. |
userId | (none) | Scopes both search and add to one user. Omit for project-wide search; add then inherits the CLI's default user. |
appId | deepseek-harness | Application scope attached to every search and add. |
sessionId | (none) | Override the harness session id used as the CLI session scope. |
minQueryLength | 2 | Skip recall for prompts shorter than this many characters. |
maxConversationMessages | 80 | Cap on how many trailing messages are persisted per turn. |
How it works
- Recall hooks
agent/pre-step(step 1 only) as a prepended waterfall listener. It extracts the real human prompt, runsmindmemos memory search, and appends onecreateUserMessagecarrying the hits under a `` banner. The injected message is stampedsource.kind === "plugin"so the store step can tell it apart from real input. - Store hooks the
session/eventfirehose and reacts toturn/endwithreason.kind === "completed". It walks that turn's log back to itsturn/start, collecting the surfaceuser/assistant/toolmessages, and runsmindmemos memory add --messages-json-file -. Plugin-injected context (source.kind !== "user") is excluded so recalled memories are not re-stored.
Verify
-
Types build cleanly
npm run typecheck -
Recall fires
First store a fact out of band, then ask about it in dsh:
mindmemos memory add --messages-json-file - --json --user-id alice --app-id deepseek-harness <<'JSON' [{"role":"user","content":"My favorite color is teal.","timestamp":0}] JSONIn dsh, ask "what is my favorite color?". The plugin log should show:
[mindmemos-memory] recall hit 1 memories, injected N charsand the model should answer with the stored fact.
-
Store writes
Complete any turn in dsh, then confirm the log shows:
[mindmemos-memory] stored N message(s) from turn 1 (session_id=…)and that the memory is searchable afterwards:
mindmemos memory search "…" --json --user-id alice
Troubleshooting
ENOENT/command not found— dsh'sPATHmay not include the CLI (common for GUI-launched dsh). Setclito the executable's absolute path (which mindmemos, oruv run which mindmemosinside a uv project).cliis a single executable path, not a shell command, so a wrapper likeuv run mindmemoswill fail withENOENT.- Recall never fires — check
minQueryLengthand thatcliresolves (mindmemos config showfrom dsh's environment). - Recall works but nothing is stored — the store only runs when a turn
completes (
reason.kind === "completed"); aborted or errored turns are skipped by design. Check the log after a turn that ends cleanly. - CLI errors surface as
[mindmemos-memory] memory search failed: …/[mindmemos-memory] memory add failed: …warnings, including the CLI's stderr and exit code.