面向 JavaScript 与 TypeScript 项目的本地代码记忆:自动带上源码上下文,支持符号查找、向量检索与依赖图。
安装
# Release 预构建包
dsh plugin --profile web add -w "https://github.com/kobubu/Rag-Coding/releases/latest/download/dsh-plugin-code-memory.tgz"
# GitHub 源码(首次需按提示配置 allowBuilds 构建授权后重试)
dsh plugin --profile web add github:kobubu/Rag-Coding
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络,工具审批管不到它。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 只有英文版本。
Give your coding agent the relevant source before its first step. Code Memory (CM) is a local code index and context plugin for JavaScript and TypeScript projects. It combines symbol lookup, dependency graphs, and semantic search to reduce repeated source discovery.
Unofficial community project. Independently developed; not affiliated with or endorsed by DeepSeek.
English · Русский · Download v0.9.3 · Windows installation
What it does
- Supplies compact source context before the first model call in DeepSeek Harness.
- Looks up named files and symbols directly; uses local MiniLM embeddings and LanceDB when discovery is needed.
- Expands relevant dependencies using the TypeScript compiler's symbol and call graph.
- Checks source versions and avoids repeating unchanged whole files already supplied to Harness.
- Exposes an MCP server for Codex and Claude Code and an optional
UserPromptSubmithook for automatic context. - Includes CM Atlas, a local map of modules, symbols, and their relationships.
The index, embeddings, and graph stay on your computer. Selected code is still sent to your model provider when you use a cloud model. CM does not include model credits or a model-provider subscription.

Actual CM Atlas screenshot of this repository's public src directory: 39 modules, 2,409 symbols, and 8,321 relationships. The current Atlas interface is in Russian; the installation guide below is in English.
Measured results, with limits
The published Harness pilot used GPT-6 Luna on six task types in one repository, Geo Dash. Three evaluation series each ran 36 sessions: no CM, the earlier CM, and the newer CM, with two repeats per task and arm.
| Newer CM versus no CM | Published result |
|---|---|
| Total model tokens | 45–66% fewer across the three series |
| Estimated model price | 30–47% lower |
| Total Harness session time | 18–37% lower |
| Independently checked solutions, pooled across series | 36/36 with newer CM; 35/36 without CM |
These are small, single-project pilot results, not guaranteed savings. The ranges are observed series results, not confidence intervals. Costs are estimates; session time does not include first-time installation or indexing. All attempts, including failures, are retained. Earlier approaches and native-client experiments have different outcomes; do not transfer these percentages to every client or workload.
Codex and Claude Code
In Codex and Claude Code, CM adds its context through a UserPromptSubmit hook served by a warm local daemon; the installer configures it. Fourteen tasks in the same repository — the six above plus eight new ones that CM was not tuned on — three repeats per task and arm, 84 sessions per client:
| CM versus no CM | Codex, GPT-6 Luna | Claude Code, Sonnet 5.5 |
|---|---|---|
| Independently checked solutions | 41/42 vs 40/42 | 42/42 vs 42/42 |
| Total model tokens | 58.0% fewer | 40.4% fewer |
| Estimated / reported price | 29.0% lower | 18.0% lower |
| Total session time | 35.9% lower | 35.1% lower |
| Median session | 7.3 s vs 12.2 s | 12.4 s vs 18.7 s |
In both clients the paired 95% bootstrap intervals for tokens and time exclude zero. Three larger tasks — a feature across three modules, a rename across imports, a new parameter in several places — also gain: Codex 60.1% fewer tokens and 39.2% less time, Claude Code 35.0% and 16.4%. One weak spot is documented: on a rewrite of a counting function, agents with CM more often lose a key-coercion detail and need a second edit. Two unrelated public libraries that CM was not tuned on, six tasks each, confirm the effect: node-semver — Codex 59.1% fewer tokens and 49.0% less time, Claude Code 38.2% and 18.0%; superstruct (TypeScript) — Codex 39.2% and 27.4%, Claude Code 28.6% and 12.0%, with an 8.3% lower price. Three projects are still not a guarantee for other workloads. The MCP server alone, without the hook, showed no savings.
Method, raw results, and reproduction · Codex and Claude Code experiments · What did not work
Install into an existing Harness
Requires DeepSeek Harness 0.2.0-rc.2 and Node.js 24 or 22.19+ within 22.x:
dsh plugin --profile web add github:kobubu/Rag-Coding#v0.9.3
The tag contains the compiled plugin, CLI entry points, and Atlas. CM needs no installation build or Vite/React runtime modules. Then prepare the project index and local model. A ready release tarball is also available:
dsh plugin --profile web add https://github.com/kobubu/Rag-Coding/releases/download/v0.9.3/dsh-plugin-code-memory-0.9.3.tgz
Git tags before 0.9.1 require their release tarball or an explicit source build. The new runtime works with scripts disabled; native dependencies follow the host package manager's policy.
If CM was installed with the Windows bootstrap, update it using the new ZIP and the same -InstallRoot. Harness 0.2.0-rc.2 can prefer a CM copy beside its own installation over a profile-installed copy; adding another Git dependency to that older installation does not replace its launcher or embedded copy. The bootstrap creates a new release directory and switches managed project launchers.
Install on Windows
Download CM-0.9.3-Windows.zip and SHA256SUMS.txt from the v0.9.3 release, verify the checksum, and extract the ZIP. From the extracted folder, run:
powershell -NoProfile -ExecutionPolicy Bypass -File .\install_cm.ps1 -ProjectRoot 'C:\path\to\your-project' -Clients harness
The installer uses a compatible Node.js or downloads a private runtime, installs CM and Harness 0.2.0-rc.2, downloads the embedding model, and prepares your index. Administrator rights and a source checkout are not required. Internet access is required for the initial dependencies and model downloads. Open the generated start-harness.ps1 path printed by setup, then configure your model provider in Harness.
Use -SourceScope src to index a subdirectory. Use -Clients harness,codex,claude to add project MCP connections for all three clients; Codex and Claude Code must be installed separately. Their automatic-context hook is currently a separate manual setup, not an installer default.
Install, launch, verify, and remove · Native-client hook setup
Build from source
Use Node.js 24 LTS, or Node.js 22.19.0+ within the 22.x line.
git clone https://github.com/kobubu/Rag-Coding.git
cd Rag-Coding
npm ci
npm run verify
npm run cm:index
npm run cm:vectors
npm run cm:search -- --query "how are embeddings reused between snapshots"
npm run plugin:smoke
plugin:smoke checks both legacy and compact tools, automatic context, filesystem observations, and unload through the real Harness runtime without a model call. In PowerShell, use npm.cmd for commands that forward flags. For restricted cloud builds, ONNXRUNTIME_NODE_INSTALL=skip npm ci skips the native runtime download; running local embeddings still requires a working ONNX runtime.
The Windows bootstrap is the packaged installation path. A macOS/Linux installer, automatic release updates, and a subscription service are not included.
For source changes, npm run compile rebuilds the runtime. Commit matching dist/src/ and dist/viewer/; npm run package:check and CI reject missing/stale artifacts. The command is named compile because npm treats a script named build as a reason to rebuild Git dependencies.
Documentation
The following engineering documents are currently in Russian; the README and Windows release guide are in English.
| Document | Contents |
|---|---|
| How CM works | Routing, graph expansion, context budgets, and source freshness |
| Harness integration | Bundle installation, configuration, and tools |
| MCP setup | Shared local retrieval for coding clients |
| CM Atlas | Local project visualization |
| Release notes | What is included in the public package |
| Release procedure | Rebuilding the installer and checking artifacts |
CM is written in TypeScript/Node.js. Project code is indexed without being executed. Supported inputs are JavaScript/TypeScript source files; current corpus limits are 500 files and 8 MiB of source. See contribution rules.
Try it on another repository
Show Your Plugins discussion · Community catalog submission
Independent A/B results are welcome: use the same task, model, reasoning settings, checks, and starting commit with CM on and off. Include indexing/setup time separately, all failed attempts, total tokens, elapsed time, and whether the patch actually passes independent checks. Report regressions as well as wins in Issues.
链接
同类插件
vectorize-io/hindsight#coding-agents★ 64571
Hindsight:会学习的 Agent 长期记忆系统,自动召回/保存、知识页、深度反思与按仓库隔离的记忆银行。
volcengine/OpenViking#examples/dsh-memory-plugin★ 43161
面向 DeepSeek Harness 的 OpenViking 记忆与上下文插件:pre-step 自动召回与画像注入、会话捕获、`viking://` URI 防护,以及对接 OpenViking 服务端的 recall/write 记忆工具。
MemTensor/MemOS#memos-local-plugin★ 12564
DeepSeek Harness 本地记忆插件:分层 L1/L2/L3 记忆,自动沉淀与手动 memos_* 检索工具并存,内置记忆浏览器。
agentscope-ai/ReMe#dsh★ 3886
将 DeepSeek Harness 接入 ReMe 本地优先、自进化的个人知识库:自动把已完成的主 Agent 对话沉淀为用户掌控的 Markdown 记忆,通过 reme_search 结合 BM25、可选向量检索和 wikilink 展开搜索对话与资料,并按日整理长期记忆。
zilliztech/memsearch#MemSearch★ 2983
供 DSH 与其他编程 Agent 共享的 Markdown 记忆,支持自动捕获、步骤前上下文注入、搜索召回,以及通过审阅面板实现 memory-to-skill 自进化。
vshulcz/deja-vu#extensions/dsh★ 1725
跨会话长期记忆与上下文恢复:读取本机上其他四十五个(45+)编程智能体已经写下的会话文件,支持安装前历史找回与中断恢复(Claude Code、Codex、Cursor、Windsurf、Trae、Antigravity、VS Code Copilot Chat、opencode、OpenClaw、Hermes、Kimi、Qoder、Cline、Zed、Magpie 等):提供 deja_recall、deja_session、deja_blame、deja_fix、deja_how、deja_remember 六个工具与 /deja 命令,并可选地把召回结果加入运行时上下文。共享本地 BM25 CLI/MCP 索引,不用大模型,不用向量嵌入,不联网(dsh plugin --profile web add dsh-deja)。
社区评论
评论公开保存在 GitHub Discussions。加载评论会连接 GitHub 和 Giscus;发表内容需要 GitHub 账号。