causal-memory

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.

  1. 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
  2. 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"
  3. 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.

Optional plugin configurationjson
{
  "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_causal

Recall past decisions for the current task. With the plugin, this name has no mcp__ prefix.

record_decision

Write decision, context and outcome as one edge. The plugin's system prompt asks for this after an outcome is observed.

intervention_query

Forward-check an action before it happens; a prevented outcome returns a DANGER chain.

trace_cause

Attribute a bad outcome to the decision behind it.

counterfactual_query

Compare 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.

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.