将 Memory Lake 作为 dsh 的持久记忆层:基于 memorylake CLI 的 memory_search、memory_remember、memory_forget 三个工具,会话状态行,以及引导安装/诊断 skills,与 Claude Code、Codex 插件共享同一 ~/.memorylake 身份与记忆。
安装
# npm 包(预构建)
dsh plugin --profile web add @memorylake/dsh-plugin
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:memorylake-ai/memorylake-harness#path:/dsh-plugin
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。GitHub 来源的插件还会在安装时执行构建脚本——pnpm 默认拦截,所以安装可能停在 ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED 或 ERR_PNPM_IGNORED_BUILDS;dsh 会打印出需要添加的确切键名,把它加进该 profile 的 pnpm-workspace.yaml 的 allowBuilds 下,重跑一次即可装上。放行构建本身就是一次信任判断:请只安装可信来源,并尽量锁定 commit(github:owner/repo#sha)。
README
该插件的 README 只有英文版本。
MemoryLake for DeepSeek Harness (dsh): persistent, cross-session, cross-project, cross-device memory.
dsh ships no native memory capability, so this plugin is not a bridge to one — it IS the harness's memory layer. It contributes:
- Three tools —
memory_search,memory_remember,memory_forget— backed by thememorylakeCLI (never by direct HTTP, never through a shell). - A prompt section owning the policy: when to remember, how to phrase recall queries, how to read results, and that a failed search is never an empty one.
- A one-line status context reporting connectivity — most importantly when the backend is UNREACHABLE, because a silently unavailable memory backend is indistinguishable from "you never told me that".
- Two user-invocable skills — type
/memorylake-initfor the guided setup wizard (CLI download with mandatory checksum verification, login, shared config) and/memorylake-statusfor the end-to-end health check. The model cannot trigger either.
Install
dsh plugin --profile web add @memorylake/dsh-plugin
dsh --profile web --dump-config # shows the "@memorylake/dsh-plugin" layer
dsh web
web is dsh's built-in Web UI profile (auto-initialized on first use); any
other profile name works the same way — the plugin composes with whatever
surface the profile mounts.
The package publishes with built lib/, so no build allowance is needed. A
github: install also works — a self-contained prepare script builds from
source — but pnpm ≥10 will ask you to allowlist the build; prefer the
registry install.
Zero-config on a machine that already has MemoryLake
Identity and switches live in the shared ~/.memorylake/ tree, not in
this plugin:
~/.memorylake/credentials.toml— the CLI's login state~/.memorylake/harness/config.md— workspace, actor, and feature flags<repo>/.claude/memorylake.local.md— optional per-project override, merged key by key over the global file (a one-linesync_on_write: falseoverride keeps the global workspace working)
If the Claude Code or Codex integration already wrote these, a dsh session
picks them up with zero additional steps: status line, tools, recall — all
live. Config files are re-read on every call, so /memorylake-init finishing
mid-session takes effect on the very next message, no restart.
When nothing is configured, the plugin is completely silent: no network
requests, no prompt injection. Only an explicitly invoked memory tool answers,
and only to point at /memorylake-init.
Shared config keys (config.md / memorylake.local.md frontmatter)
| Key | Default | Meaning |
|---|---|---|
workspace |
— | MemoryLake workspace id. The only required key; absent means the plugin stays silent |
actor |
— | Actor id facts are attributed to; required for writes |
enabled |
true |
false switches the plugin off entirely |
sync_on_write |
true |
false makes memory read-only (the canonical per-project override) |
status_line |
true |
false suppresses the session status line |
Keys consumed by the other harnesses (remind_on_read, sync_deny,
projects, project_custom_id) are parsed and preserved but not consumed by
this plugin's v1.
Deployment knobs (cordis config)
Only operational tuning lives in the bundle's rows; override by id in your
profile's cordis.patch.yml (a patch replaces the row's whole config).
Row memorylake (@memorylake/dsh-plugin/service):
| Key | Default | Meaning |
|---|---|---|
binaryPath |
— | Absolute path of the memorylake binary, overriding resolution (PATH, then ~/.memorylake/bin/memorylake) |
timeoutMs |
30000 |
Hard deadline per CLI invocation |
killGraceMs |
2000 |
SIGTERM→SIGKILL grace on timeout/cancel |
maxOutputBytes |
1000000 |
In-memory cap per collected CLI stream |
Row memorylake-tools (@memorylake/dsh-plugin/tools):
| Key | Default | Meaning |
|---|---|---|
topKMax |
10 |
Upper bound for the model's top_k |
statusTtlSeconds |
600 |
Status-line refresh interval and cache TTL |
Behavior notes
- Authentication is CLI login state. The dsh subprocess seam scrubs
credential-shaped environment names from children, so an ambient
MEMORYLAKE_API_KEYis never forwarded — by design, and matching the CLI's own "env vars alone are not a session" rule. Log in once withmemorylake auth login(the init skill walks through it). - Payload before exit code. The CLI prints its full JSON payload and then
encodes the business outcome in the exit code (
fact deleteexits non-zero when ids were not found). The plugin parses first and classifies second. - Failure is not emptiness. Unavailable backends produce an explicit
noticein the tool value and a loud status line, instructing the model to attribute empty results to the connection rather than to missing memory. - Scores are ordering-only. Relevance scores sort results and are then discarded; they never reach the model (they are weakly calibrated, and a model shown a number treats it as authority).
- No auto-recall, no session memory digest. Both were evaluated and rejected in the Claude Code integration: fixed token cost on sessions that never touch memory, no behavioral gain. The status line reports connectivity only.
v2 roadmap (deliberately not in v1)
- Session→conversation cook: append dsh session transcripts as MemoryLake conversations and let the backend distill them into memories — dsh's "model-visible ⟺ logged" invariant makes the transcript complete, which no other harness guarantees. Privacy defaults off.
- Document search: Library upload + project import, and passing
--projectson search (without it the server returns zero document hits — facts are unaffected, which is why v1 is facts-only). - Project identity: the explicit-custom-id → normalized-git-remote → physical-path rule shared with the other harnesses.
- Session-start facts digest: a small, config-gated summary — dsh has no local MEMORY.md, so unlike the other harnesses this may carry real value, but it must first justify its token cost.
- Upstreaming as an in-tree
packages/memorylake/capability seam.
Development
pnpm install
pnpm test # vitest: unit + integration + real-Loader composition
pnpm build # tsc → lib/
Tests run against a mock memorylake binary and an isolated data tree; no
network, no API key, and no touching your real ~/.memorylake.
链接
同类插件
vectorize-io/hindsight#coding-agents★ 43968
Hindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
volcengine/OpenViking#examples/dsh-memory-plugin★ 39063
面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`viking://` URI 防护,以及对接 OpenViking 服务端的 recall/write 记忆工具。
agentscope-ai/ReMe#dsh★ 3541
将 DeepSeek Harness 接入 ReMe 本地优先、自进化的个人知识库:自动把已完成的主 Agent 对话沉淀为用户掌控的 Markdown 记忆,通过 reme_search 结合 BM25、可选向量检索和 wikilink 展开搜索对话与资料,并按日整理长期记忆。
zilliztech/memsearch#MemSearch★ 2687
供 DSH 与其他编程 Agent 共享的 Markdown 记忆,支持自动捕获、步骤前上下文注入、搜索召回,以及通过审阅面板实现 memory-to-skill 自进化。
vshulcz/deja-vu#extensions/dsh★ 1107
读取本机上其他三十三个编程智能体已经写下的会话文件——Claude Code、Codex、Cursor、VS Code Copilot Chat、opencode、OpenClaw、Hermes、Kimi、Cline、Zed 等,包括安装之前的历史:提供 deja_recall、deja_session、deja_blame、deja_fix、deja_how、deja_remember 六个工具与 /deja 命令,并可选地把召回结果加入运行时上下文。本地 BM25 索引,不用大模型,不用向量嵌入,不联网(dsh plugin --profile web add dsh-deja)。
adoresever/graph-memory★ 633
DeepSeek Harness 的可追溯、可检索跨会话记忆:把对话知识沉淀为带类型的图节点(任务/技能/事件)与关系边。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。