/remember 命令将事实写入 dsh 已加载的 AGENTS.md 指令层级,并配有 Memory 标签页,显示加载器在字节预算内实际保留了哪些指令。
安装
# npm 包(预构建)
dsh plugin --profile web add @dennisrongo/dsh-memory
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:dennisrongo/dsh-plugins#path:/plugins/dsh-memory
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。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 只有英文版本。
A /remember command that writes a fact into the instruction hierarchy dsh already reads, and a Memory tab that shows which of those files the loader actually kept.
Why this is small
dsh already has the read half of a memory system, and it is more capable than it looks. @deepseek-ai/dsh-agent-instructions — its own manifest calls it a "Workspace context loader for AGENTS.md/CLAUDE.md instruction files" — loads the user-global $DSH_HOME/AGENTS.md, then every AGENTS.md and CLAUDE.md from the project root down to the session's directory, plus AGENTS.local.md / CLAUDE.local.md overlays, deduplicated per directory, budgeted by bytes, and it pulls in nested files as the agent touches them. Sessions are already bound to workspaces by canonical path through workspaceRegistry.
Two things were missing:
Nothing writes. There is no #-style capture and no /remember, so a fact learned mid-session is a fact you retype into a file by hand, later, if you remember to.
Nothing shows what loaded. The byte budget silently omits files. A file that exists, is discovered, and is dropped for budget looks exactly like a file the agent is ignoring for no reason — and the shipped code preset's budget is 64 KiB, which a real monorepo reaches.
So this plugin is those two things and deliberately nothing else. There is no parallel fact database: a second store beside the instruction files would mean two things to keep in sync, two precedence orders, and a place for facts to hide from a loader that already works.
Capture
/remember the build needs pnpm 11 — package.json pnpm blocks are ignored
/remember --local the staging token lives in ~/.config/acme
/remember --user I prefer conventional commits with no Claude co-author trailer
| Flag | File | Reach |
|---|---|---|
(default) --project |
<projectRoot>/AGENTS.md |
travels with the repository |
--local |
<projectRoot>/AGENTS.local.md |
this checkout only, usually gitignored |
--user |
$DSH_HOME/AGENTS.md |
every project on this machine |
The reply always names the exact path it wrote. "Saved" would leave you guessing which of four candidate files in the hierarchy it landed in.
Facts are filed under a ## Memories heading rather than appended to the end of the file, and a second fact joins the existing list instead of starting a new one. Nothing a human wrote is ever moved: a file with no memories section gets one appended (with the blank line guarded, so the heading cannot end up glued to the last line of prose), and a file with one gets the new item at the end of that section, not after whatever heading happens to be last.
The Memory tab has the same capture box, with a scope chooser; Enter saves, Shift+Enter is a newline.
Inspection
The tab lists every instruction file discovered for the workspace, in model precedence order, with its size and whether the budget kept it:
AGENTS.md 5.1 KB not loaded
packages/app/AGENTS.md cut to 96 B 5.1 KB
Click a row to read the file. not loaded and cut to … are the two facts you cannot get anywhere else, and they are the reason the tab exists.
Both come from the loader's own exports — discoverBaselineInstructionFiles for the candidate list and loadBaselineInstructions for the omitted / truncated accounting. Nothing here reimplements the walk. An inspector that reimplemented it would eventually disagree with the loader, and an inspector you cannot trust when it disagrees is worse than none: the entire point is to answer "is the agent reading this file?" authoritatively.
read serves a path only when the loader discovered it for that workspace. Without that check the endpoint reads any file on the host.
Configuration
- id: dsh-memory
config:
maxBytes: 65536
maxBytes must match the agent-instructions row's own maxBytes, or the inspector reports omissions against the wrong budget. The shipped code preset uses 65536, which is this plugin's default; a plugin cannot read another plugin's entry config, so if you change one, change both.
Endpoints
| Method | Takes | Returns |
|---|---|---|
dshMemory/inspect |
{ workspaceId } |
{ report } — every discovered file, sized, with included / truncatedTo |
dshMemory/remember |
{ workspaceId, fact, scope } |
{ ok, path, line } or { ok: false, reason } |
dshMemory/read |
{ workspaceId, absolutePath } |
{ text? } — discovered files only |
All take a single parameter named request.
Install
dsh plugin add @dennisrongo/dsh-memory
Restart the profile afterwards — the Typert loader caches its per-package verdict for the process lifetime, so a newly added service is not picked up by a browser refresh.
Requires
ctx.workspaceRegistry and @deepseek-ai/dsh-agent-instructions, both composed by the shipped presets. ctx.commands is picked up through a child fiber rather than injected, so a deployment that composes no command registry still gets the tab and the endpoints — it just has no /remember.
About the author
Plugins and walkthroughs on YouTube @codingmenace — I build AI coding tools in public, including DeepSeek Harness itself. More at dennisrongo.com.
链接
同类插件
vectorize-io/hindsight#coding-agents★ 51291
Hindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
volcengine/OpenViking#examples/dsh-memory-plugin★ 40273
面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`viking://` URI 防护,以及对接 OpenViking 服务端的 recall/write 记忆工具。
agentscope-ai/ReMe#dsh★ 3646
将 DeepSeek Harness 接入 ReMe 本地优先、自进化的个人知识库:自动把已完成的主 Agent 对话沉淀为用户掌控的 Markdown 记忆,通过 reme_search 结合 BM25、可选向量检索和 wikilink 展开搜索对话与资料,并按日整理长期记忆。
zilliztech/memsearch#MemSearch★ 2759
供 DSH 与其他编程 Agent 共享的 Markdown 记忆,支持自动捕获、步骤前上下文注入、搜索召回,以及通过审阅面板实现 memory-to-skill 自进化。
vshulcz/deja-vu#extensions/dsh★ 1244
读取本机上其他三十三个编程智能体已经写下的会话文件——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★ 655
DeepSeek Harness 的可追溯、可检索跨会话记忆:把对话知识沉淀为带类型的图节点(任务/技能/事件)与关系边。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。