DeepSeek Harness Plugin

zhang66633/dsh-memvault

Stars ★ 1 Downloads (30d) 1,908 Category Memory Added 2026-10-13 npm dsh-memvault

Bridges DSH to a local MemVault store: core memory blocks injected into the system prompt, finished turns extracted through MemVault's own pipeline, and a panel to browse, trace, review and replay what was stored.

Install

# from npm (prebuilt)

dsh plugin --profile web add dsh-memvault

# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)

dsh plugin --profile web add github:zhang66633/dsh-memvault

Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).

README

dsh-memvault


MCP is pull-only, so "memory is already loaded" can never come from a server. This plugin does it inside DSH — and since 0.9.x it owns the store too: no Python, no second process.

Half What How
Inject core blocks in the system prompt, every step ctx.systemPrompt.context()
Extract finished turns → one window → one LLM pass session/event → window → add/supersede/none
Recall memory_search / memory_add FTS5 trigram + vectors, RRF, answerability guard
Show overview / memories / structure, block editing, replay host routes + conversation tab / settings page

✨ Features

🗄️ One store prompt, extraction, tools and panel read ~/.dsh/memvault/memvault.db
🧠 No tool call needed blocks ride the runtime context, TTL-cached
⏱️ Off the critical path queued windows, one call per N turns / idle / cap
🔎 Hybrid recall substring truth (trigram) + paraphrase (vectors), fused
🛠️ Two tools scoped by user_id / agent_id / run_id
🎛️ A real panel diagnostics, vector backfill, provenance, relation graph
🃏 Native tool cards memory_search / memory_add render their own conversation cards
🪶 Zero deps node:sqlite + hand-written client bundle

🚀 Install

dsh plugin --profile desktop add dsh-memvault

Self-owned install links a checkout in the profile's package.json (dsh-memvault: link:…) plus a junction under node_modules — see docs/DEVLOG.md. A new bundle needs a DSH restart; after editing the client run npm run build.

Requires DSH 0.2.1+, verified against 0.2.2-rc.5 (engines.dsh names the 0.2.2 line explicitly, because a bare >=0.2.1-0 <0.3.0-0 does not admit 0.2.2-rc.5 for strict semver readers; the >=0.2.2-0 arm covers the whole 0.2.2 pre-release line, rc.1 through rc.5). Node 24.9+ is required: that is the runtime floor of DSH 0.2.2, and this plugin uses Node 24's DatabaseSync busy-timeout option. The tool cards, the non-interpolated injection and the session-close extraction are 0.2.2 features; on 0.2.1 they degrade to the previous behaviour.

⚙️ Configuration

Field Default
scopes [{user,lenovo},{agent,claude-code-memory}]
labels / maxChars / refreshMs [] / 4000 / 30000
extract.everyNTurns / idleMs / windowTurns 3 / 20000 / 8
extract.timeoutMs 60000 (wired as MEMVAULT_EXTRACT_TIMEOUT_MS)
extract.minTranscriptChars / maxInputChars 40 / 6000
extract.projectDir / env discovered .env directory / {}
panel.writes true

The store path is not configurable through this plugin (~/.dsh/memvault/memvault.db, or DSH_MEMVAULT_CORE_DB). projectDir is only where .env is read — nothing is spawned, so a machine without a Python checkout still works, and the panel lists the directories it checked. The pipeline reads the usual .env keys (OPENAI_*, MEMVAULT_EXTRACTOR=rule|llm, MEMVAULT_EMBEDDER=local|openai, MEMVAULT_ADJUDICATOR=off).

The old dbPath, extract.pythonPath and extract.user/agent/run keys are gone: a stale patch that still sets one is reported as an ignored key in the panel instead of silently doing nothing. The write scope is derived from scopes (first user → user_id, first agent → agent_id).

🗄️ Store & migration

~/.dsh/memvault/memvault.db (override DSH_MEMVAULT_CORE_DB). From the Python store, once:

memvault export --from data/memvault.db --out export.json
node scripts/import-core.mjs export.json ~/.dsh/memvault/memvault.db --apply
node scripts/backfill-core.mjs ~/.dsh/memvault/memvault.db --project-dir <checkout> --apply

🏗️ How it works

flowchart LR
  T[turn/end] --> W[window] --> X[extractor] --> D[decide] --> S[(store)]
  S --> P[system prompt]
  S --> M[tools]
  S --> U[panel]

🧪 Verification

npm test (6 smokes + 56 unit). Live: /memvault/api/status shows the last five outcomes ([rule]|[llm] ok added=N); replay via POST /memvault/api/replay; recall via memory_search.

🧠 Decisions

  • One store, not two — no "tool saw it, panel didn't".
  • Supersede, never delete — history keeps the audit.
  • Only user text is extracted — short windows are skipped (docs/DEVLOG.md §35).

⚠️ Limits

  • Single machine, single store: no sync, no encryption.
  • Extraction quality depends on the extractor (rule is deterministic but narrow; LLM depends on the endpoint).

📄 License

MIT

Content from the project README on GitHub ↗

Links

More in this category

View the whole category →

Community comments

Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.