dsh-memory-jev
DSH memory plugin gated by the TypeSafe Jev decision model: mem_* tools whose every read/write is a typed judgement (choice/noul) — write gate, recall gate and a fail-closed injection gate with budget, audit log and restore/merge. 适合需要通过类型化判定严格控制记忆写入、召回和注入预算的高级用户。
설치
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Towzai/dsh-memory-jevConfiguration
| Key | Default | Meaning |
|---|---|---|
storePath | '' (= /data/gate-store.json) | Store file; pin an absolute path in production |
injectEnabled | true | Master switch for the injection gate |
injectInSubagents | false | Inject in child sessions too (cost scales with children) |
injectLimit | 3 | Max memories per injection |
injectMinProbability | 0.6 | Relevance threshold for injection (stricter than manual recall) |
prefilterLimit | 40 | Candidates sent to Jev |
supersedeCandidates | 12 | "Possible duplicate" candidates for the write gate |
dailyBudgetCny | 3.5 | Daily budget (CNY) |
dailyCallLimit | 3000 | Daily 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.
| Key | Default | Effect |
|---|---|---|
injectEnabled | true | master switch for the injection gate |
injectLimit / injectMinProbability | 3 / 0.6 | memories per injection / relevance threshold (pinned entries bypass it) |
recallMinProbability | 0.5 | mem_recall threshold — also overridable per call via min_probability |
prefilterLimit / supersedeCandidates | 40 / 12 | candidates sent to Jev / duplicate candidates for the write gate |
worthReviewThreshold | 0.35 | below this the write gate only annotates "review suggested" — it never blocks a write |
dailyBudgetCny / dailyCallLimit | 3.5 / 3000 | daily budget (CNY) and call cap |
injectTimeoutMs / toolTimeoutMs | 1500 / 15000 | latency budget for the injection path / for tools |
egressGuard | false | outbound-only pattern guard (opt-in) |
injectInSubagents | false | inject 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.