INTEGRATION
causal-memory with DeepSeek Harness
A native plugin rather than an MCP bridge: 17 tools with clean names, plus a system-prompt section that makes the agent check memory before it acts.
Updated · English
Before you start
DSH Desktop 0.2.0-rc.2 or newer, a causal-memory binary on PATH (pip install causal-memory is enough), and the plugin package available locally or from the registry.
Three steps
Each step is idempotent; re-running it updates the registration instead of duplicating it.
- 01
Install the memory binary
The plugin resolves the server binary in a fixed order: an explicit config.command, then CAUSAL_MEMORY_BIN, then the repository's target/release build, then the bare causal-memory name on PATH. pip is the shortest path.
pip install causal-memory - 02
Add the plugin to the profile
Install the plugin into a DSH profile. Installed as a link, edits to the plugin take effect without reinstalling; the bundle manifest is merged automatically.
dsh plugin --profile web add "$PWD/dsh-plugin" - 03
Restart and verify
Restart DSH so the plugin loads. You should see the 17 tools without an mcp__ prefix, and the injected system-prompt section should make the agent recall before a non-trivial task.
Settings → Causal Memory → Test connection
Configuration
Copy the block, replace nothing if the binary is on PATH, and restart the client once.
{
"command": "causal-memory",
"dbPath": "~/.local/share/causal-memory/causal.db",
"toolCallTimeoutMs": 60000,
"failOnStartupError": true
}The five tools to learn first
Seventeen tools are mounted. These five cover the loop: recall, record, warn, attribute, compare.
search_causalRecall past decisions for the current task. With the plugin, this name has no mcp__ prefix.
record_decisionWrite decision, context and outcome as one edge. The plugin's system prompt asks for this after an outcome is observed.
intervention_queryForward-check an action before it happens; a prevented outcome returns a DANGER chain.
trace_causeAttribute a bad outcome to the decision behind it.
counterfactual_queryCompare what a decision produced with the alternative that was rejected.
Gotchas worth knowing
- The plugin injects a system-prompt section at order 300 — that is the mechanism that makes recall proactive rather than accidental.
- failOnStartupError defaults to true: if the binary cannot be found, activation fails loudly with an install hint instead of silently mounting nothing.
- The exclude option removes individual tools if a profile needs a narrower surface.
- grok-build, Hermes and plain MCP clients are supported through the same store; the DSH plugin is the tightest integration, not the only one.
DeepSeek Harness setup questions
- Is this an MCP bridge or a native plugin?
- Native. The plugin mounts the engine's tools directly onto the harness tool surface with clean names, and injects a system-prompt section. The underlying store and semantics are the same as the MCP server.
- What happens if the binary is missing?
- With failOnStartupError at its default (true), plugin activation fails with an install hint. Set it to false only if you want the profile to start without memory and accept that no tools will be available.
- Can I use the hosted memory instead of a local binary?
- Yes. The cloud memory plugin (dsh-causal-memory, installed from the same plugin page) points at the hosted endpoint with an API key. The local plugin is the offline-first option and keeps the database on your machine.
- Where is the database?
- By default ~/.local/share/causal-memory/causal.db, or whatever dbPath is configured. The path is the same one the CLI and MCP server use, so all three share one graph.
- Does the plugin change other DSH behaviour?
- No. It adds tools and one system-prompt section. If the section is not what you want, exclude the tools you do not need, or use the plain MCP server in a profile that does not load the plugin.
Related
Use case
- Causal memory for an on-call agentAn incident timeline records what happened. Causal memory records which mitigation actually prevented the worse outcome — and which one only looked like it did.
- Causal memory for a trading research agentA P&L number tells you what happened. A causal decision journal tells you which part of your reasoning was wrong — and what you would have gotten if you had done the other thing.
Integration
- causal-memory with Claude CodeClaude Code already reads your repository. Give it the one thing a repository cannot store: why a decision was made, and what it prevented.
- causal-memory with CursorThe same repository, the same compaction problem. Cursor gets a causal record that survives the context window.
Wire it into DeepSeek Harness in about three minutes
No account, no API key and no service to operate for local use — one binary and one SQLite file.