安装
在 DeepSeek Harness 里通过 dsh-market 安装
dsh plugin --profile web add dshmarket
或使用命令行
dsh plugin --profile web add github:JingxuanC/causal-memory#path:/dsh-plugin
装任何插件都等于在你的机器上跑第三方代码,权限和你本人一样大——能读你的文件、用你的凭据、访问网络。请先审阅源码,并尽量锁定 commit(github:owner/repo#sha)。
README
DeepSeek Harness 原生记忆插件:把 causal-memory 的 17 个工具以干净命名
(无 mcp__ 前缀)挂到 DSH 的 ctx.tools,并注入一条系统提示词段落
(order 300),告诉模型何时查阅因果记忆库。
前置:causal-memory 二进制
插件按 DSH 惯例解析服务端二进制(不写死路径),四选一:
- pip 安装(推荐,无需 Rust 工具链):
会把pip install causal-memorycausal-memory命令装到 PATH 上,插件自动解析到它。 - 下载预编译二进制:从 GitHub Releases
下载对应平台(Windows / macOS / Linux × x64 / arm64)的压缩包,解压后把
causal-memory放到 PATH 上(如~/bin或/usr/local/bin)。 - 本仓库开发构建(克隆到任意位置即可):
插件会自动找到cargo build --release --bin causal-memory<仓库>/target/release/causal-memory。 - 显式指定:
config.command配置项或CAUSAL_MEMORY_BIN环境变量。
安装
cd <causal-memory 仓库路径>
dsh plugin --profile web add "$PWD/dsh-plugin"
以 link: 方式安装(pnpm link)——修改本目录代码即时生效,无需重装。
启用
本包声明了 dsh.bundle manifest(cordis.patch.yml),通过
dsh plugin add 安装时 insert 会自动合并,无需手工配置。
仅当以 link: 方式做开发安装时需要手工确认
~/.dsh/profiles/web/cordis.patch.yml 的 insert 列表包含:
- id: causal-memory-plugin
name: causal-memory-dsh-plugin
重启 dsh web 后生效。
配置(可选,均省略时有合理默认)
| 字段 | 默认 | 说明 |
|---|---|---|
command |
自动解析 | 二进制路径:config.command → CAUSAL_MEMORY_BIN → 仓库 target/release → PATH 裸名 |
dbPath |
~/.local/share/causal-memory/causal.db |
SQLite 路径(或 CAUSAL_MEMORY_DB) |
toolCallTimeoutMs |
60000 |
单次工具调用超时 |
exclude |
[] |
不挂载的工具名数组 |
failOnStartupError |
true |
启动连接失败时是否让插件激活失败(默认失败并附安装提示;显式设 false 则降级为仅记日志) |
工具清单(17 个)
record_decision · record_fact · remember · search_causal ·
search_facts · search_memory · search_patterns · causal_directory ·
trace_cause · trace_cause_chain · intervention_query ·
counterfactual_query · prediction_report · invalidate_decision ·
invalidate_pattern · resolve_updates · reconstruct_lesson
(工具列表运行时从服务端动态发现,服务端升级后无需改插件。)
卸载
dsh plugin --profile web remove causal-memory-dsh-plugin
# 并从 ~/.dsh/profiles/web/cordis.patch.yml 删除对应 insert 行
设计说明
- 零运行时依赖:只用 Node 内置模块;JSON-RPC over stdio 直接与 causal-memory 二进制通信(rmcp 的新行分隔 JSON 线协议)。
apply为 async:与 DSH 官方@deepseek-ai/dsh-mcp-client同款时序 (cordis 4.x 会等待 async apply 的 promise,工具在激活前完成握手与发现)。- 所有注册均为 effect 作用域:卸载时注销工具并终止子进程。
- 与 MCP 桥(
@deepseek-ai/dsh-mcp-client,工具名mcp__causal-memory__*) 二选一启用,避免双份工具。
评论
评论存放在 GitHub Discussions。用 GitHub 账号登录后可发表评论或点表情。