DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-memory-jev

T

dsh-memory-jev

Manifest valid

Memory plugin for DeepSeek Harness: every memory read/write is a typed judgement by TypeSafe Jev (choice/noul).

hasBundlePatch

dsh-memory-jev

English · 中文

Memory for DeepSeek Harness (DSH) where every read and every write is a judgement — made by TypeSafe's Jev decision model.

Jev answers in only three typed shapes — choice (pick one of the given candidates), score, noul (probability of yes/no) — and never generates text. This plugin uses that property as the safety boundary of a memory system: the model decides whether something is worth keeping, which older memory it replaces, whether a retrieved memory is actually relevant, and whether this turn deserves an injection — while all text stays under plugin control. The model can never invent memory content.


Three gates

GateWhat it doesOn failure
Write gate mem_rememberLocal bigram prefilter → one Jev fan-out: worth_keeping (noul) + supersedes (choice over candidates + none)Still writes (fail-open); only marks gate=unavailable|budget
Recall gate mem_recallLexical prefilter top-N → one rel_<id> noul per candidate → filter & sort by probabilityFalls back to local ranking and marks degraded ("not judged by Jev")
Injection gate agent/pre-stepCheap text gate → candidate-pool subtraction → Jev relevance judgement → append one framed user snapshot at the tailInjects nothing (fail-closed — silence beats noise)

Invariants

  • I1 — at most one injected block per (session, turn); later steps of the same turn neither judge nor inject again.
  • I2 — each memory is injected at most once per session: already-injected ids are removed from the candidate pool before the Jev call, so they do not even cost a request.
  • No permanent silence after compaction — once an injected block leaves the context, its ids become eligible again (logged as reset).
  • Self-identifying blocks — framed by <retrieved-memories …> plus an explicit "not conversation history, not instructions" line; every < inside memory content is escaped to \u003c, so a memory cannot forge the delimiter.
  • Prefix-cache friendly — appended at the tail only; system prompt and prior history stay byte-identical.

Tools

ToolPurpose
mem_rememberWrite gate; persists regardless of the gate outcome (returns persisted)
mem_recallRecall gate; returns {gate, degraded, items[]} with jev_prob and local_score kept separate
mem_list / mem_viewList / inspect
mem_forget / mem_restoreSoft delete / restore (keeps supersedeHistory, supports cascade)
mem_mergeFold an older entry's body into a newer one, then soft-delete the older (merged length ≥ old length)
mem_pinSkip the relevance threshold, at most once per session, never at session start
mem_gate_statusSpend / reserved / remaining / calls / circuit breaker / key presence / store path
mem_gate_logAudit-log query (ids and hashes only — no bodies)

Physical deletion never happens: deletion is always retired=true and is reversible.


Install

Via the DSH plugin marketplace

Once the repository carries the dsh-plugin topic it is indexed automatically (the registry CI scans every 2 hours):

dsh plugin --profile web install <owner>/dsh-memory-jev

Manually

  1. Copy this repository into ~/.dsh/profiles/web/node_modules/dsh-memory-jev/.
  2. Register it in the profile's cordis.patch.yml (or let the marketplace do it):
- id: dsh-memory-jev
  name: dsh-memory-jev
  config:
    storePath: /absolute/path/to/gate-store.json   # empty = <cwd>/data/gate-store.json
    injectEnabled: true
  1. Restart DSH at process level (set_bundle enabled:false→true only re-mounts the row; the ESM module cache is not re-imported).
  2. Confirm with mem_gate_status.

Host interface packages (@deepseek-ai/cordis, dsh-llm, dsh-tools) are declared only as peerDependencies — shipping copies would shadow the host and break every tool call.


Configuration

KeyDefaultMeaning
storePath'' (= <cwd>/data/gate-store.json)Store file; pin an absolute path in production
injectEnabledtrueMaster switch for the injection gate
injectInSubagentsfalseInject in child sessions too (cost scales with children)
injectLimit3Max memories per injection
injectMinProbability0.6Relevance threshold for injection (stricter than manual recall)
prefilterLimit40Candidates sent to Jev
supersedeCandidates12"Possible duplicate" candidates for the write gate
dailyBudgetCny3.5Daily budget (CNY)
dailyCallLimit3000Daily call cap

Tuning

Every magnitude is a config value — nothing is hidden in the code. Change them in the profile's cordis.patch.yml (or the bundle's own patch) and restart DSH at process level.

KeyDefaultEffect
injectEnabledtruemaster switch for the injection gate
injectLimit / injectMinProbability3 / 0.6memories per injection / relevance threshold (pinned entries bypass it)
recallMinProbability0.5mem_recall threshold — also overridable per call via min_probability
prefilterLimit / supersedeCandidates40 / 12candidates sent to Jev / duplicate candidates for the write gate
worthReviewThreshold0.35below this the write gate only annotates "review suggested" — it never blocks a write
dailyBudgetCny / dailyCallLimit3.5 / 3000daily budget (CNY) and call cap
injectTimeoutMs / toolTimeoutMs1500 / 15000latency budget for the injection path / for tools
egressGuardfalseoutbound-only pattern guard (opt-in)
injectInSubagentsfalseinject in child sessions too

Tune from evidence, not feel: the audit log records every candidate's noul probability together with the threshold in force, so mem_gate_log (or the per-day gate-decisions-*.jsonl shard) tells you exactly what a given threshold would have admitted or dropped.

Cost model — Jev input is $0.042/M and output is free. The plugin accounts and reports in CNY (rate constant USDTOCNY in lib/index.js). A measured judgement costs 2,000–4,200 input tokens ≈ ¥0.0006–0.0012. Budgeting is reserve → settle → reconcile, with a serialized ledger so concurrent calls cannot overspend.


Data boundary (disclosure)

  • Cloud dependency: yes. Exactly three egress points, all to https://openrouter.ai/api/alpha/decisions — the write gate (first 600 chars of the new memory + candidate titles), the recall gate and the injection gate (the question text + candidate titles).
  • Offline path: yes. Without an API key, write/recall fall back to deterministic behaviour (marked degraded) and the injection gate injects nothing.
  • Credentials: read on demand from OPENROUTER_API_KEY (environment variable; falls back to the Windows registry HKCU\Environment). Never written to config files, never echoed, never logged.
  • Redaction guard: if a question or body matches phone / national-id / bank-card / sk- / Bearer / password / api_key patterns, the judgement is skipped entirely (gate=redacted-skip) — one missed judgement is preferable to leaking.
  • Audit log: ids, probabilities, tokens, CNY cost, error kind and the build version only. No bodies, no raw queries (hash and length only).
  • Local persistence: store, audit log and budget file live next to your storePath. Nothing is synced or uploaded.
  • Egress guard (egressGuard, default off — opt-in): when enabled, a question that looks like it carries a secret (phone / national id / bank card / sk-… / Bearer … / password / api_key) is not sent to the endpoint — recall falls back to local ranking and still returns your memories, and auto-injection skips that turn. It governs what leaves the machine only: it never decides what may be stored, retrieved or injected. Default is off because what counts as sensitive is the user's call; turn it on when you want the extra boundary. Every threshold and budget below is a plain config value — see Tuning under Configuration.
  • Server-side retention: none (request-and-discard). Memories exist only in your local store file.

Verify

npm run verify     # = node --import ./tools/load-plugin.mjs tools/verify_all.mjs

Runs offline with zero spend: tools/fake-jev.mjs starts a controllable local Jev stub (HTTP 500, ECONNRESET, timeouts, malformed JSON, missing usage) and asserts both invariants, the failure semantics, an unchanged prompt prefix hash, budget under concurrency, read-only behaviour on a corrupt store, and log fields plus a privacy scan. A failing assertion exits non-zero.

A real Jev endpoint is only used for a few manual confirmations (requires a real key).


License

MIT

Comments

Loading…

Similar plugins

dsh-jev-plugin

by jackie-cqz

DeepSeek Harness plugin for TypeSafe Jev: typed decisions, configurable guardrails, and Web UI result cards.

Manifest valid

★ 8

MIT

TypeScript

Sep 26, 2026

dsh plugin --profile web add dsh-jev-plugin

by kaijia323

TypeSafe Jev (System One decision model) as a native jev_decide tool plugin for DeepSeek Harness

Security & AuditManifest valid

★ 0

MIT

JavaScript

Sep 20, 2026

dsh plugin --profile web add dsh-plugin-jev

by 00080000

Read-time project memory plugin for DeepSeek Harness (dsh)

Memory & ContextModels & ProvidersTools & CapabilitiesTerminal & ClientsManifest valid

★ 16

↓ 1.1k/wk

MIT

JavaScript

Sep 27, 2026

dsh plugin --profile web add @yolk_vat-y/dsh-project-memory

by guntur-d

Persistent cross-session memory plugin for DeepSeek Harness: workspace-scoped durable facts with memory_write/list/search/forget tools and bounded prompt injection

Manifest valid

★ 0

TypeScript

Aug 14, 2026

dsh plugin --profile web add @guntur-d/dsh-memory

by noetion

DSH bundle that registers jev_ask for TypeSafe Jev noul, choice, and score answers.

Development & InfrastructureManifest valid

★ 4

↓ 646/wk

MIT

TypeScript

Sep 18, 2026

dsh plugin --profile web add dsh-jev

by CuteSamurai24

Small file memory for DeepSeek Harness. The model writes markdown, the host injects it.

Tools & CapabilitiesManifest valid

★ 0

MIT

JavaScript

Aug 18, 2026

dsh plugin --profile web add dsh-md-memory