dsh-memu-memory 1.4.2 → 1.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +108 -110
- package/CHANGELOG.md +169 -868
- package/LICENSE +21 -21
- package/README.md +368 -374
- package/README.zh.md +354 -360
- package/assets/icon.svg +7 -7
- package/cordis.patch.yml +8 -8
- package/docs/active-memory-ab.md +279 -385
- package/docs/binding-lifecycle.md +99 -99
- package/docs/client-conventions.md +75 -75
- package/docs/contributing.md +217 -217
- package/docs/emotion-model-spec.md +247 -281
- package/docs/env-and-commands.md +149 -152
- package/docs/host-adaptation.md +339 -360
- package/docs/host-api.md +131 -137
- package/docs/host-versions.md +117 -120
- package/docs/mcp-porting.md +146 -146
- package/docs/memory-semantics.md +271 -259
- package/docs/pending-work.md +44 -51
- package/docs/troubleshooting.md +909 -854
- package/lib/active-memory.js +160 -165
- package/lib/activity-log.js +207 -207
- package/lib/auto-link/apply.js +248 -249
- package/lib/auto-link/candidates.js +163 -163
- package/lib/auto-link/decide.js +300 -300
- package/lib/auto-link/normalize.js +99 -99
- package/lib/auto-link/policy.js +42 -42
- package/lib/auto-link/suppression.js +101 -101
- package/lib/auto-link/terminology.js +311 -311
- package/lib/backup.js +1254 -1254
- package/lib/binding-diagnostics.js +634 -634
- package/lib/budget.js +118 -118
- package/lib/client.js +9820 -9751
- package/lib/commitment.js +178 -138
- package/lib/consolidation-ledger.js +434 -438
- package/lib/consolidation-receipt.js +386 -387
- package/lib/consolidation-snapshot.js +420 -405
- package/lib/consolidation-worker.js +240 -241
- package/lib/context.js +33 -33
- package/lib/curator-evidence.js +131 -131
- package/lib/curator-policy.js +198 -202
- package/lib/curator.js +1813 -1811
- package/lib/cycle.js +524 -513
- package/lib/diagnostics.js +524 -524
- package/lib/embedding-catalog.js +1051 -1055
- package/lib/embedding-download.js +637 -607
- package/lib/embedding-runtime.js +946 -946
- package/lib/engine.js +1103 -1103
- package/lib/entity-repair.js +285 -285
- package/lib/environment-check.js +394 -394
- package/lib/fork-model.js +312 -312
- package/lib/freshness.js +128 -121
- package/lib/global-graph.js +389 -389
- package/lib/graph.js +1193 -1193
- package/lib/host-surface.js +30 -30
- package/lib/inbound.js +284 -281
- package/lib/index.js +506 -511
- package/lib/inject.js +2639 -2619
- package/lib/lexicon-scope.js +143 -143
- package/lib/lexicon.js +1183 -1192
- package/lib/lifecycle-audit.js +37 -0
- package/lib/local-embedding-entry.js +145 -145
- package/lib/local-embedding-manager.js +306 -306
- package/lib/local-embedding-protocol.js +210 -210
- package/lib/local-embedding-worker.js +682 -682
- package/lib/local-vector-service.js +506 -453
- package/lib/maintenance-ledger.js +138 -0
- package/lib/maintenance-review.js +103 -0
- package/lib/maintenance-runner.js +267 -0
- package/lib/managed-runtime.js +118 -118
- package/lib/media.js +607 -513
- package/lib/memory.js +5035 -4941
- package/lib/memu-config.js +213 -213
- package/lib/memu.js +565 -565
- package/lib/migrate.js +200 -200
- package/lib/mood.js +300 -300
- package/lib/paths.js +453 -457
- package/lib/port-surface.js +82 -82
- package/lib/preset-mount.js +79 -0
- package/lib/preset-scope.js +126 -126
- package/lib/private-links.js +567 -567
- package/lib/private.js +2198 -2209
- package/lib/prompts/global-curator.md +135 -135
- package/lib/prompts/image-caption.md +1 -1
- package/lib/prompts/private-consolidation.coding.md +39 -39
- package/lib/prompts/private-consolidation.md +32 -32
- package/lib/prompts/private-consolidation.mixed.md +37 -37
- package/lib/prompts/private-consolidation.rp.md +47 -47
- package/lib/prompts/private-policy.coding.md +35 -35
- package/lib/prompts/private-policy.md +36 -36
- package/lib/prompts/private-policy.mixed.md +29 -29
- package/lib/prompts/private-policy.rp.md +43 -43
- package/lib/prompts/system-guide.coding.md +20 -20
- package/lib/prompts/system-guide.md +25 -25
- package/lib/prompts/system-guide.mixed.md +22 -22
- package/lib/prompts/system-guide.rp.md +23 -23
- package/lib/prompts.js +331 -331
- package/lib/recall-cache.js +212 -212
- package/lib/remote-summary.js +123 -123
- package/lib/rpc.js +2531 -2532
- package/lib/salient-wake.js +438 -438
- package/lib/snippet.js +125 -125
- package/lib/state.js +1948 -1928
- package/lib/stats.js +236 -236
- package/lib/temporal.js +345 -348
- package/lib/text-retrieval.js +992 -1001
- package/lib/text-similarity.js +305 -305
- package/lib/tokenizer-v2.js +271 -271
- package/lib/tools.js +1098 -1091
- package/lib/turn-log.js +545 -545
- package/lib/vector-migration.js +928 -930
- package/lib/vector-profile.js +1353 -1359
- package/lib/visibility.js +59 -59
- package/lib/webui/graph-LICENSE.txt +1 -1
- package/lib/webui/graph-view.bundle.js +2 -2
- package/lib/webui/graph-view.js +1171 -1175
- package/lib/webui/mark.svg +7 -7
- package/lib/webui/standalone.css +1178 -1178
- package/lib/webui/standalone.js +238 -238
- package/lib/webui.js +136 -136
- package/lib/worker-pool.js +1015 -979
- package/package.json +153 -153
- package/requirements.lock +34 -34
- package/scripts/acceptance-local.mjs +946 -946
- package/scripts/active-memory-ab-live.mjs +653 -655
- package/scripts/active-memory-ab.mjs +1302 -1302
- package/scripts/audit-memory-lifecycle.mjs +55 -0
- package/scripts/bench-recall.mjs +142 -142
- package/scripts/build-graph.mjs +44 -45
- package/scripts/chain-matrix.mjs +541 -541
- package/scripts/check-all.mjs +68 -74
- package/scripts/check-doc-drift.mjs +547 -547
- package/scripts/check-graph-browser.mjs +261 -261
- package/scripts/check-i18n.mjs +81 -83
- package/scripts/check-idle-compositing.mjs +61 -61
- package/scripts/check-seed-compat.mjs +115 -118
- package/scripts/check-text-format.mjs +55 -0
- package/scripts/curator-pair-calibrate.mjs +259 -259
- package/scripts/diagnose-bindings.mjs +176 -176
- package/scripts/drive-session.mjs +863 -864
- package/scripts/engine-smoke.mjs +69 -69
- package/scripts/entity-dedupe.mjs +110 -110
- package/scripts/lexicon-calibrate.mjs +230 -230
- package/scripts/lexicon-dedupe.mjs +318 -318
- package/scripts/local-runtime-install.mjs +142 -142
- package/scripts/local-runtime-verify.mjs +56 -56
- package/scripts/local-vector-verify.mjs +93 -93
- package/scripts/make-readme-shots.mjs +59 -59
- package/scripts/migrate-visibility.mjs +94 -94
- package/scripts/mock-llm.mjs +938 -903
- package/scripts/preview.mjs +58 -58
- package/scripts/prune-sessions.mjs +31 -34
- package/scripts/prune-turnlogs.mjs +29 -30
- package/scripts/prune-vectors.mjs +24 -24
- package/scripts/rebuild-auto-links.mjs +252 -252
- package/scripts/recall-bench.mjs +820 -820
- package/scripts/repetition-ab-scenarios.mjs +93 -93
- package/scripts/repetition-detector-snapshot.mjs +314 -314
- package/scripts/repetition-eval-live.mjs +360 -360
- package/scripts/repetition-eval.mjs +702 -702
- package/scripts/replay.mjs +705 -575
- package/scripts/setup.mjs +46 -46
- package/scripts/simulate-injection.mjs +299 -301
- package/tests/absorb-review.test.mjs +354 -354
- package/tests/activation.test.mjs +89 -89
- package/tests/active-memory-ab.test.mjs +745 -745
- package/tests/active-memory.test.mjs +129 -129
- package/tests/activity-log.test.mjs +126 -126
- package/tests/activity-wiring.test.mjs +155 -155
- package/tests/appendix-b.test.mjs +217 -217
- package/tests/appendix-b2.test.mjs +166 -166
- package/tests/audit-batch3.test.mjs +247 -247
- package/tests/audit-regression.test.mjs +275 -275
- package/tests/audit-safety.test.mjs +227 -227
- package/tests/auto-link-candidates.test.mjs +245 -245
- package/tests/auto-link-decide.test.mjs +512 -512
- package/tests/auto-link-migration.test.mjs +133 -133
- package/tests/backend-compensation.test.mjs +272 -272
- package/tests/backup.test.mjs +793 -793
- package/tests/binding-diagnostics.test.mjs +720 -720
- package/tests/browser.test.mjs +476 -476
- package/tests/client-export.test.mjs +521 -521
- package/tests/client-render.test.mjs +2008 -1728
- package/tests/coalesce.test.mjs +113 -113
- package/tests/commitment.test.mjs +243 -144
- package/tests/config.test.mjs +159 -159
- package/tests/consolidation-credential.test.mjs +330 -330
- package/tests/consolidation-feed.test.mjs +122 -122
- package/tests/consolidation-fork.test.mjs +1586 -1539
- package/tests/consolidation-ledger.test.mjs +389 -389
- package/tests/consolidation-snapshot.test.mjs +567 -505
- package/tests/consolidation-value.test.mjs +89 -89
- package/tests/context-scope.test.mjs +40 -40
- package/tests/cross-library-recall.test.mjs +269 -269
- package/tests/cue.test.mjs +58 -58
- package/tests/curator-absorb.test.mjs +444 -444
- package/tests/curator-calibrate.test.mjs +173 -173
- package/tests/curator-clusters.test.mjs +306 -306
- package/tests/curator-commit.test.mjs +325 -325
- package/tests/curator-contract.test.mjs +191 -191
- package/tests/curator-evidence.test.mjs +102 -102
- package/tests/curator-link.test.mjs +317 -317
- package/tests/curator-pairing.test.mjs +339 -339
- package/tests/curator-probe.test.mjs +490 -490
- package/tests/curator-review-mode.test.mjs +315 -315
- package/tests/curator.test.mjs +152 -152
- package/tests/cycle.test.mjs +567 -568
- package/tests/diagnostics.test.mjs +278 -278
- package/tests/disclosure.test.mjs +249 -249
- package/tests/doc-drift.test.mjs +342 -342
- package/tests/drive-session.test.mjs +152 -152
- package/tests/dynamic-rrf.test.mjs +182 -182
- package/tests/dynamic-threshold.test.mjs +52 -52
- package/tests/embedding-catalog.test.mjs +374 -374
- package/tests/embedding-download.test.mjs +529 -486
- package/tests/embedding-runtime.test.mjs +449 -449
- package/tests/emotion-chain.test.mjs +84 -84
- package/tests/emotion-contract.test.mjs +445 -445
- package/tests/engine.test.mjs +108 -108
- package/tests/entity-merge.test.mjs +278 -278
- package/tests/environment-check.test.mjs +187 -187
- package/tests/fact-version.test.mjs +146 -146
- package/tests/fixtures/active-memory-ab/README.md +56 -56
- package/tests/fixtures/active-memory-ab/cases/01-clean-dense-turn.json +351 -351
- package/tests/fixtures/active-memory-ab/cases/02-clean-thin-turn.json +122 -122
- package/tests/fixtures/active-memory-ab/cases/03-clean-starved-small.json +125 -125
- package/tests/fixtures/active-memory-ab/cases/04-clean-large-thin.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/05-clean-half-step.json +166 -166
- package/tests/fixtures/active-memory-ab/cases/06-clean-duplicate-reread.json +197 -197
- package/tests/fixtures/active-memory-ab/cases/07-clean-recent-recall.json +125 -125
- package/tests/fixtures/active-memory-ab/cases/08-global-relevant.json +111 -111
- package/tests/fixtures/active-memory-ab/cases/09-global-irrelevant-conflict.json +158 -158
- package/tests/fixtures/active-memory-ab/cases/10-no-human-turn.json +97 -97
- package/tests/fixtures/active-memory-ab/cases/11-clean-scale-100.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/12-clean-scale-1000.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/13-clean-scale-5000.json +137 -137
- package/tests/fixtures/active-memory-ab/cases/14-clean-scale-20000.json +137 -137
- package/tests/fixtures/active-memory-ab/lead-ai-reviewed-reference.json +191 -191
- package/tests/fixtures/active-memory-ab/manifest.json +199 -199
- package/tests/fixtures/curator-pairs/labeled.v1.jsonl +90 -90
- package/tests/fixtures/lexicon-stub-hooks.mjs +15 -15
- package/tests/fixtures/lexicon-stub.mjs +284 -284
- package/tests/fixtures/mock-llm/reply.txt +1 -1
- package/tests/fixtures/recall-bench/01-paraphrase.json +183 -183
- package/tests/fixtures/recall-bench/02-exact.json +152 -152
- package/tests/fixtures/recall-bench/03-negation.json +172 -172
- package/tests/fixtures/recall-bench/04-no-answer.json +161 -161
- package/tests/fixtures/recall-bench/05-conflict.json +193 -193
- package/tests/fixtures/recall-bench/06-boundary.json +272 -272
- package/tests/fixtures/recall-bench/07-secret.json +190 -190
- package/tests/fixtures/recall-bench/08-coding.json +163 -163
- package/tests/fixtures/recall-bench-gold-candidates/01-paraphrase.json +193 -193
- package/tests/fixtures/recall-bench-gold-candidates/02-exact.json +197 -197
- package/tests/fixtures/recall-bench-gold-candidates/03-negation.json +244 -244
- package/tests/fixtures/recall-bench-gold-candidates/04-no-answer.json +189 -189
- package/tests/fixtures/recall-bench-gold-candidates/05-conflict.json +245 -245
- package/tests/fixtures/recall-bench-gold-candidates/06-boundary.json +279 -279
- package/tests/fixtures/recall-bench-gold-candidates/07-secret.json +224 -224
- package/tests/fixtures/recall-bench-gold-candidates/08-coding.json +218 -218
- package/tests/fixtures/repetition-eval/01-zh-rp.json +92 -92
- package/tests/fixtures/repetition-eval/02-en.json +96 -96
- package/tests/fixtures/repetition-eval/03-code.json +90 -90
- package/tests/fixtures/repetition-eval/04-names.json +115 -115
- package/tests/fixtures/repetition-eval/05-user-quote.json +95 -95
- package/tests/fixtures/repetition-eval/06-agreement.json +85 -85
- package/tests/fixtures/tokenizer-cases.mjs +27 -27
- package/tests/fork-model.test.mjs +345 -345
- package/tests/freshness.test.mjs +140 -140
- package/tests/global-graph.test.mjs +106 -106
- package/tests/global-lifecycle.test.mjs +149 -149
- package/tests/graph-cascade.test.mjs +363 -363
- package/tests/graph-view.test.mjs +414 -414
- package/tests/graph.test.mjs +371 -371
- package/tests/help-page.test.mjs +416 -416
- package/tests/hook-order.test.mjs +72 -72
- package/tests/humanlike.test.mjs +232 -232
- package/tests/hybrid-recall.test.mjs +610 -610
- package/tests/inbound.test.mjs +441 -441
- package/tests/inject-conflict.test.mjs +173 -173
- package/tests/inject-guide.test.mjs +513 -513
- package/tests/inject.test.mjs +384 -384
- package/tests/injection-budget-settings.test.mjs +35 -35
- package/tests/injection-budget.test.mjs +165 -165
- package/tests/injection-chain.test.mjs +442 -442
- package/tests/injection-intent-budget.test.mjs +92 -92
- package/tests/injection-rollback.test.mjs +428 -428
- package/tests/issue2-chain.test.mjs +169 -169
- package/tests/lexical-bm25.test.mjs +171 -171
- package/tests/lexicon-calibrate.test.mjs +48 -48
- package/tests/lexicon-dedupe.test.mjs +171 -171
- package/tests/lexicon-frequency.test.mjs +195 -195
- package/tests/lexicon-inject.test.mjs +459 -459
- package/tests/lexicon-perf.test.mjs +464 -464
- package/tests/lexicon-scope.test.mjs +256 -256
- package/tests/lexicon-ui.test.mjs +667 -667
- package/tests/lexicon.test.mjs +922 -922
- package/tests/lifecycle-audit.test.mjs +56 -0
- package/tests/loader-register.mjs +3 -3
- package/tests/loader.mjs +17 -17
- package/tests/local-embedding-entry.test.mjs +95 -95
- package/tests/local-embedding-env.test.mjs +51 -51
- package/tests/local-embedding-manager.test.mjs +494 -494
- package/tests/local-embedding-protocol.test.mjs +121 -121
- package/tests/local-embedding-worker.test.mjs +440 -440
- package/tests/local-vector-service.test.mjs +41 -0
- package/tests/maintenance-status.test.mjs +77 -0
- package/tests/maintenance.test.mjs +438 -0
- package/tests/managed-memory.test.mjs +1234 -1234
- package/tests/managed-runtime.test.mjs +72 -72
- package/tests/media-injection.test.mjs +225 -0
- package/tests/media.test.mjs +135 -135
- package/tests/memory-chain.test.mjs +169 -169
- package/tests/memory-fields.test.mjs +134 -134
- package/tests/memu-resident-route.test.mjs +130 -130
- package/tests/memu-resident.test.mjs +33 -33
- package/tests/migration-payload.test.mjs +40 -42
- package/tests/mock-llm.test.mjs +263 -225
- package/tests/mood.test.mjs +109 -109
- package/tests/multiprocess.test.mjs +29 -29
- package/tests/negation-polarity.test.mjs +135 -135
- package/tests/new-session-gate.test.mjs +617 -617
- package/tests/open-loop-date.test.mjs +416 -416
- package/tests/ops-hardening.test.mjs +209 -209
- package/tests/package-shipping.test.mjs +88 -88
- package/tests/pending-injection.test.mjs +107 -107
- package/tests/port-surface.test.mjs +138 -138
- package/tests/preset-mount.test.mjs +124 -0
- package/tests/preset-scope.test.mjs +212 -212
- package/tests/private-links.test.mjs +493 -493
- package/tests/prompt-semantics.test.mjs +51 -51
- package/tests/prompts.test.mjs +315 -315
- package/tests/query-decompose.test.mjs +62 -62
- package/tests/react-snapshot.test.mjs +24 -24
- package/tests/recall-bench.test.mjs +317 -317
- package/tests/recall-cache.test.mjs +292 -292
- package/tests/recall-corpus-eligibility.test.mjs +51 -51
- package/tests/recall-dedup.test.mjs +446 -446
- package/tests/recall-intent.test.mjs +172 -172
- package/tests/regression-sweep.test.mjs +311 -311
- package/tests/reminder-fairness.test.mjs +55 -0
- package/tests/remote.test.mjs +140 -140
- package/tests/rename.test.mjs +30 -30
- package/tests/repetition-detector-snapshot.test.mjs +231 -231
- package/tests/repetition-eval-live.test.mjs +177 -177
- package/tests/repetition-eval.test.mjs +373 -373
- package/tests/salience-domain.test.mjs +173 -173
- package/tests/salient-date.test.mjs +142 -142
- package/tests/salient-wake.test.mjs +389 -389
- package/tests/settings-beat.test.mjs +222 -222
- package/tests/settings-coverage.test.mjs +97 -97
- package/tests/settings-plumbing.test.mjs +79 -79
- package/tests/short-term.test.mjs +182 -166
- package/tests/sidebar-beat.test.mjs +213 -213
- package/tests/sidebar-refresh.test.mjs +123 -123
- package/tests/sidebar.test.mjs +102 -74
- package/tests/simulate-injection.test.mjs +76 -76
- package/tests/slot-similarity.test.mjs +153 -153
- package/tests/snippet.test.mjs +79 -79
- package/tests/source-kind.test.mjs +52 -52
- package/tests/speaker-provenance.test.mjs +120 -120
- package/tests/stale-maintenance.test.mjs +206 -131
- package/tests/state-gc.test.mjs +34 -34
- package/tests/state.test.mjs +155 -155
- package/tests/stats.test.mjs +112 -112
- package/tests/storage.test.mjs +125 -125
- package/tests/stubs/child-process-spy.mjs +14 -14
- package/tests/stubs/dsh-llm-pi-ai.js +13 -13
- package/tests/stubs/dsh-llm.js +5 -5
- package/tests/stubs/dsh-schedule.js +140 -140
- package/tests/stubs/dsh-session-query.js +26 -26
- package/tests/stubs/dsh-session.js +7 -7
- package/tests/stubs/dsh-tools.js +101 -101
- package/tests/temporal-repair.test.mjs +78 -0
- package/tests/temporal.test.mjs +124 -124
- package/tests/text-format.test.mjs +24 -0
- package/tests/tokenizer-v2.test.mjs +142 -142
- package/tests/tool-schema.test.mjs +126 -126
- package/tests/tools.test.mjs +810 -810
- package/tests/turn-log.test.mjs +487 -487
- package/tests/ui-defaults.test.mjs +57 -57
- package/tests/update-fields.test.mjs +138 -138
- package/tests/vector-gc.test.mjs +37 -37
- package/tests/vector-migration.test.mjs +810 -810
- package/tests/vector-profile.test.mjs +449 -449
- package/tests/visibility-migration.test.mjs +152 -152
- package/tests/webui-auth.test.mjs +963 -963
- package/tests/webui.test.mjs +421 -421
- package/tests/windows-env.test.mjs +89 -89
- package/tests/worker-lifecycle.test.mjs +1521 -1429
package/README.md
CHANGED
|
@@ -1,374 +1,368 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="assets/icon-256.png" width="88" height="88" alt="dsh-memu-memory">
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<h1 align="center">dsh-memu-memory</h1>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
A local-first memory plugin for <b>DeepSeek Harness</b> — shared by folder, bound to a chat,
|
|
9
|
-
written by the agent, curated in the background, and honest about what it does not know.
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
<p align="center">
|
|
13
|
-
<a href="https://www.npmjs.com/package/dsh-memu-memory"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-memu-memory?color=4d6bfe"></a>
|
|
14
|
-
<a href="https://www.npmjs.com/package/dsh-memu-memory"><img alt="npm monthly downloads" src="https://img.shields.io/npm/dm/dsh-memu-memory?color=4d6bfe"></a>
|
|
15
|
-
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/npm/l/dsh-memu-memory?color=4d6bfe"></a>
|
|
16
|
-
<a href="package.json"><img alt="DSH: >=0.2.0-rc.1" src="https://img.shields.io/badge/DSH-%E2%89%A50.2.0--rc.1-4d6bfe"></a>
|
|
17
|
-
<a href="package.json"><img alt="Node: >=20.9" src="https://img.shields.io/badge/Node-%E2%89%A520.9-4d6bfe"></a>
|
|
18
|
-
</p>
|
|
19
|
-
|
|
20
|
-
<p align="center">
|
|
21
|
-
English | <a href="README.zh.md">中文</a>
|
|
22
|
-
</p>
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
`dsh-memu-memory` is built for long-form RP and companion chats. It gives a DSH conversation a memory that behaves like memory instead of a log: three retention layers that fade, a first-turn anchor plus at most one per-turn recall, provenance that cannot be quietly upgraded from "I inferred it" to "they said it", contradictions that either wait for a decision or — when explicitly versioned — stay side by side with a conflict card instead of being silently merged, near-identical facts collapse to one entry and one recall seat, and an optional relationship graph with evidence. Speakers, characters, worlds and story branches form hard boundaries, and what a character is allowed to know stays separate from what actually happened.
|
|
27
|
-
|
|
28
|
-
It is **local-first by default**. The default `agent` backend stores full text in JSON indexes and recalls lexically — no Python, no embedding service, no API key. The `api` backend switches recall to the optional, pinned MemU engine (vector search). MemU is a plugin for people who want it, not a requirement for the plugin to start.
|
|
29
|
-
|
|
30
|
-
> [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
<td align="center"><img src="assets/screenshots/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
<td align="center"><img src="assets/screenshots/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<td align="center"><img src="assets/screenshots/
|
|
51
|
-
</tr>
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
- **
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
- **
|
|
63
|
-
- **
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
67
|
-
- **
|
|
68
|
-
- **
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
**
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
|
103
|
-
|
|
104
|
-
|
|
|
105
|
-
|
|
|
106
|
-
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
###
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
|
230
|
-
|
|
231
|
-
| `
|
|
232
|
-
| `
|
|
233
|
-
| `
|
|
234
|
-
| `
|
|
235
|
-
| `
|
|
236
|
-
| `
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
├─
|
|
253
|
-
├─
|
|
254
|
-
├─
|
|
255
|
-
├─
|
|
256
|
-
├─
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
`
|
|
302
|
-
|
|
303
|
-
the
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
the
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
- **
|
|
326
|
-
- **
|
|
327
|
-
- **
|
|
328
|
-
- **
|
|
329
|
-
- **
|
|
330
|
-
- **
|
|
331
|
-
- **
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
[
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
You may use, modify, distribute and sell this software, provided the copyright notice and permission notice are included. The software is provided **as is**, without warranty of any kind.
|
|
371
|
-
|
|
372
|
-
---
|
|
373
|
-
|
|
374
|
-
If this plugin is useful to you, open an issue with the host version and a minimal reproduction — memory bugs are easiest to fix when the transcript and the storage state are both available.
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="assets/icon-256.png" width="88" height="88" alt="dsh-memu-memory">
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">dsh-memu-memory</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
A local-first memory plugin for <b>DeepSeek Harness</b> — shared by folder, bound to a chat,
|
|
9
|
+
written by the agent, curated in the background, and honest about what it does not know.
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://www.npmjs.com/package/dsh-memu-memory"><img alt="npm version" src="https://img.shields.io/npm/v/dsh-memu-memory?color=4d6bfe"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/dsh-memu-memory"><img alt="npm monthly downloads" src="https://img.shields.io/npm/dm/dsh-memu-memory?color=4d6bfe"></a>
|
|
15
|
+
<a href="LICENSE"><img alt="License: MIT" src="https://img.shields.io/npm/l/dsh-memu-memory?color=4d6bfe"></a>
|
|
16
|
+
<a href="package.json"><img alt="DSH: >=0.2.0-rc.1" src="https://img.shields.io/badge/DSH-%E2%89%A50.2.0--rc.1-4d6bfe"></a>
|
|
17
|
+
<a href="package.json"><img alt="Node: >=20.9" src="https://img.shields.io/badge/Node-%E2%89%A520.9-4d6bfe"></a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p align="center">
|
|
21
|
+
English | <a href="README.zh.md">中文</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
`dsh-memu-memory` is built for long-form RP and companion chats. It gives a DSH conversation a memory that behaves like memory instead of a log: three retention layers that fade, a first-turn anchor plus at most one per-turn recall, provenance that cannot be quietly upgraded from "I inferred it" to "they said it", contradictions that either wait for a decision or — when explicitly versioned — stay side by side with a conflict card instead of being silently merged, near-identical facts collapse to one entry and one recall seat, and an optional relationship graph with evidence. Speakers, characters, worlds and story branches form hard boundaries, and what a character is allowed to know stays separate from what actually happened.
|
|
27
|
+
|
|
28
|
+
It is **local-first by default**. The default `agent` backend stores full text in JSON indexes and recalls lexically — no Python, no embedding service, no API key. The `api` backend switches recall to the optional, pinned MemU engine (vector search). MemU is a plugin for people who want it, not a requirement for the plugin to start.
|
|
29
|
+
|
|
30
|
+
> **Version:** 1.4.3. See [`docs/`](docs/) for the manual and [`AGENTS.md`](AGENTS.md) for the contributor index. Back up `~/.dsh/dsh-memu-memory` before upgrades; see [Compatibility & limits](#compatibility--limits) for storage and integration boundaries.
|
|
31
|
+
|
|
32
|
+
## Screenshots
|
|
33
|
+
|
|
34
|
+
All screenshots are the real WebUI on isolated example data, not anyone's memories.
|
|
35
|
+
|
|
36
|
+
<table>
|
|
37
|
+
<tr>
|
|
38
|
+
<td align="center"><img src="assets/screenshots/webui-memory.jpg" width="470" alt="Memory wall"><br/><em>MemU WebUI · cross-library memory wall</em></td>
|
|
39
|
+
<td align="center"><img src="assets/screenshots/drawer.jpg" width="470" alt="In-place memory drawer"><br/><em>Edit, archive or restore without leaving the wall</em></td>
|
|
40
|
+
</tr>
|
|
41
|
+
<tr>
|
|
42
|
+
<td align="center"><img src="assets/screenshots/relations.jpg" width="470" alt="Relationship graph studio"><br/><em>Full-screen relationship graph · canvas and inspector</em></td>
|
|
43
|
+
<td align="center"><img src="assets/screenshots/settings.jpg" width="470" alt="Settings"><br/><em>Injection, budgets, retention and automation</em></td>
|
|
44
|
+
</tr>
|
|
45
|
+
<tr>
|
|
46
|
+
<td align="center"><img src="assets/screenshots/stats.jpg" width="470" alt="Statistics"><br/><em>Daily activity, hit distribution and archive candidates</em></td>
|
|
47
|
+
<td align="center"><img src="assets/screenshots/webui-dark.jpg" width="470" alt="Dark theme"><br/><em>Dark theme · the same surfaces and motion</em></td>
|
|
48
|
+
</tr>
|
|
49
|
+
<tr>
|
|
50
|
+
<td align="center" colspan="2"><img src="assets/screenshots/mobile.jpg" width="360" alt="Narrow layout"><br/><em>Narrow layout · the rail folds into a horizontal strip</em></td>
|
|
51
|
+
</tr>
|
|
52
|
+
</table>
|
|
53
|
+
|
|
54
|
+
## What it remembers
|
|
55
|
+
|
|
56
|
+
- **Three layers, one timeline.** `short_term` drafts expire after 72 hours by default; `long_term` is the body of ordinary memory; `must_remember` needs a reason and a source, decays over 365 days with a 0.35 strength floor, and can be *marginalized* but never auto-deleted to make room.
|
|
57
|
+
- **Recall is a moment, not a dump.** The first turn after a session starts (or after compaction) gets an anchor block with budgets for pinned, core and global memory. After that, each user turn gets at most one recall. Deduplication and a token budget are enforced in code, not left to the prompt. Anchor and recall entries are **title cards**: title, id and semantic tags only. The body stays in the drawer and behind `memu_private_recall` / `memu_global_recall`, so the same budget exposes far more memories without pasting text the model never asked for.
|
|
58
|
+
- **Invisible memories cannot crowd out visible ones.** Private lexical recall builds its scoring corpus after applying conversation context, speaker and disclosure rules, including the lexical branch of mixed recall. Explicit reads retain their disclosure permissions.
|
|
59
|
+
- **A private lexicon writes itself.** The consolidation worker extracts stable, evidenced slang, memes and project terms with one term per entry. Ordinary entries become active immediately (no human review queue), while sensitive triggers and sensitive edits stay user-only. The lexicon page is a card flow with active/archived tabs, edit, archive/restore and two-step permanent delete. A **global lexicon** sits beside the per-library ones: every conversation reads it, only you write it. With same-domain cross-library recall on, the anchor, this-turn match and `memu_lexicon_search` merge those libraries too — the page still browses one book at a time.
|
|
60
|
+
- **Private links come from assertions, not statistics.** `autoLinkMode` defaults to *candidates only*: a local zero-token pass ranks names into a review queue and writes nothing. Once you confirm an entity, its names and aliases are matched against memory text (`entity-mention`); `conflicts_with` / `supersedes` / the same `fact_key` add field-evidence edges. Lexical similarity, shared tokens and vectors never create an edge. Confirming, renaming, merging or deleting an entity maintains its edges immediately, and a removed auto edge is suppressed so it cannot come back. Links are metadata, shown with an “Auto” badge in the graph; they never rewrite a body, write a vector or delete anything. Existing libraries migrate with `node scripts/rebuild-auto-links.mjs` (dry-run first, `--apply` takes a backup). New names proposed by a model must appear as complete quoted, introduced or delimited names in the source memory; a substring or the link note alone is insufficient. Existing names and aliases remain reusable, and rejected links leave no new entity.
|
|
61
|
+
- **A date is either an anniversary or one day.** `MM-DD` recurs every year (a birthday); `YYYY-MM-DD` fires the day before and the day itself, then is spent. Relative wording (今天 / 明天 / 下周X / 月底) is resolved against the turn's scene time and stored as an absolute date; a memory that says "tomorrow" is stored as the dated form, so an appointment does not come back every year.
|
|
62
|
+
- **Memory fades unevenly.** Recency, access count, peak and end effects, primacy, habituation and flashbulb accuracy feed one strength score. Mood is described by four components (joy / anger / sorrow / fear, summing to 1) plus arousal (intensity) and dominance (sense of control); a compound mood such as jealousy is a named mix of the four, not a new axis. Mood only reorders recall: it never enters the injected text and never rewrites a memory body. Gating is the OR of three independent conditions — the dominant share is >= 0.35, |arousal - 0.35| >= 0.1, or |dominance| >= 0.25; when none holds, both multipliers are exactly 1. Older entries carry no emotion and keep the old valence path; the four axes are never inferred back from valence. A vivid memory can be more confident than it is accurate, and the UI says so.
|
|
63
|
+
- **Provenance is a fact, not a style.** Every entry carries `source` / `source_kind` (`user_said` / `assistant_said` / `told` / `imagined` / `inferred` / `tool`), `speaker_id`, `confidence`, `accuracy`, and disclosure rules. A vague recollection cannot impersonate a quote, and the assistant's own promises or plans cannot be filed as something the user said.
|
|
64
|
+
- **Contradictions do not get silently merged.** An ordinary contradiction still lands as `pending_review`: it is not injected, not recalled, and appears in a review queue until someone accepts or rejects it. When the writer explicitly marks two statements as versions of one fact (`conflicts_with`), both stay active, are recalled together and surface as a conflict card; an explicit `supersedes` retires the old row without deleting its text.
|
|
65
|
+
- **Secrets stay excluded.** `secret` visibility, group-chat channels, characters, worlds, branches and `knownBy` all constrain reads and edits. Automatic recall never injects a `secret` memory, and a `secret` is still readable by an explicit recall from the same folder — it hides a memory from the prompt, it is not a lock. What actually separates two conversations in one folder is the `context` scope (`channelId` / `characterId` / `worldId` / `branchId`); a blank scope on both sides means one shared scope, which is the point of a folder. The old `visibility: 'session'` level is gone — reading turns it into `shared` with its `context` untouched, and `node scripts/migrate-visibility.mjs` rewrites libraries that still store it (`--apply`, backs up first).
|
|
66
|
+
- **People and stories are structured.** Group chat uses stable `speakerId` / `channelId`, not display names. RP uses `characterId` / `worldId` / `branchId`. Relationships are edges with a note and confidence, entities can be renamed without rewriting memory bodies, and the current relationship state (familiarity, trust, warmth, boundaries, promises) is a snapshot that keeps its history and evidence.
|
|
67
|
+
- **Images are pointers and captions, not pretend vision.** Attachments are deduplicated by SHA-256, quota-limited and tiered; an image without a description is remembered as "received an image", never as a scene the model did not see.
|
|
68
|
+
- **Housekeeping happens in the background.** Consolidation runs in a seeded fork sub-session, never as an editable turn in your chat. Failed runs back off instead of reporting success. Unsupported reasoning-effort combinations are remembered across restarts and omitted on the next fork/new worker, including inherited settings; a new provider/model/effort combination may still fail once before it is learned.
|
|
69
|
+
|
|
70
|
+
### Lifecycle maintenance and media delivery
|
|
71
|
+
|
|
72
|
+
An independent maintenance queue can review existing open commitments, unfinished threads and ended validity windows even without a new conversation turn. It obeys private scope and disclosure boundaries, rotates work fairly, records insufficient evidence, and uses a tool-free reviewer followed by revision-checked application. Deadline passage alone never proves an unfulfilled promise. Assistant-only completion claims require confirmation. `memu_status` reports the bound library's queue counts; background model review follows `sleepConsolidation`.
|
|
73
|
+
|
|
74
|
+
`open_loop` no longer invents a commitment or borrows an event date as a deadline. Update patches keep omitted fields; `clear_commitment_due` and `clear_commitment` provide explicit clearing through the host's single-type tool schema. Media bytes remain SHA-deduplicated, while each message occurrence keeps its identity: duplicate display rows merge within a block, new messages can resend the same image, and only displayed occurrences are consumed after host admission.
|
|
75
|
+
|
|
76
|
+
Implementation notes: see [`docs/memory-semantics.md`](docs/memory-semantics.md) §8.19 and [`docs/troubleshooting.md`](docs/troubleshooting.md). Historical audits require an explicit plugin data directory and do not write data: `node scripts/audit-memory-lifecycle.mjs --help`.
|
|
77
|
+
|
|
78
|
+
### Background consolidation
|
|
79
|
+
|
|
80
|
+
Before starting a consolidation fork, the plugin scores new evidence using human turns (`H`), content volume (`C`) and effective tool work (`U`): `score = 0.35*min(H/3,2) + 0.45*min(C/4000,2) + 0.20*min(U/20,2)`, with a default threshold of 0.8. Each successful tool result contributes at most 2,000 characters to `C`.
|
|
81
|
+
|
|
82
|
+
After 15 idle minutes, small sessions may wake below the score threshold. Transcripts with 2,000 or more events still require sufficient evidence. A pending range above 600 events triggers a check independently; recent consolidation or recall suppresses redundant idle work.
|
|
83
|
+
|
|
84
|
+
## One WebUI
|
|
85
|
+
|
|
86
|
+
The sidebar has exactly **one** entry: **MemU WebUI**. The memory wall and all settings live in the same navigation, with deep links such as `#/settings/memories`, `#/settings/folders` and `#/settings/stats`. The interface follows the browser locale (Chinese or English).
|
|
87
|
+
|
|
88
|
+
**Private / global groups with multi-select.** The "Memories" page splits into **Private** and **Global** blocks (private first, default). The private block supports **multi-select**: bulk archive, restore and permanent delete (two-step confirm) — one failed row never eats the rest. Every row on the Global memory page has a "View" action that jumps straight to that entry on the wall.
|
|
89
|
+
|
|
90
|
+
**In-place work.** Clicking a memory card opens a right-side drawer with the full text and the fields that decide how it behaves — title, content, tags, disclosure, confidence, open loop — plus save, archive, restore and "open in the browser" for heavier work. Archived memories can be deleted in the same drawer; the first click only arms it and the second confirms. Global memories keep their curator-written content read-only in the drawer, but archive, restore and two-step permanent delete work there just like private ones, and link to their own page. Filters and scroll position stay where they were. Cards that carry images use the first usable attachment as a cover, and the drawer opens the full gallery; `secret` and `never_say` entries never receive a pixel URL, so they show a label instead.
|
|
91
|
+
|
|
92
|
+
**One page for the graph.** **Relations** is its own full-screen page in the WebUI (`#/settings/graph`): the canvas on the left, the inspector on the right, and a **Manage** tab using the same domain and search filters. **All libraries** combines private libraries with separate identities for same-id nodes and follows 200-node pages through trailing entities; the canvas retains every loaded node. The editable **Domain** filter accepts built-in or custom domains (for example `coding` or `project:travel`), matches the full normalized name, and shows all domains when empty. Missing memory domains count as `general`; a filtered entity appears when linked to a matching memory. Source and rule filters narrow displayed edges. Settings → Relations opens this page; graph browsing retains the existing library and session authorization boundaries.
|
|
93
|
+
|
|
94
|
+
The graph runs on a **self-written continuous force engine** — no third-party runtime is bundled. It stays alive while you work, preserves node positions and the camera across background data refreshes, and stops requesting frames the moment it cools down, so an open graph costs no idle GPU. Dragging pins a node exactly where you drop it (release never yanks it back), and only the cluster you touched keeps simulating: frozen clusters act as obstacles the moving one cannot slide through. Repulsion, link distance and centering are adjustable in the panel, labels avoid collisions, and the minimap repaints only after the canvas does. Zoomed all the way out the nodes necessarily merge on screen — separation lives in world coordinates, so spread clusters with repulsion/link distance instead of the zoom. Settings → Relations is a single button that opens the full-screen graph page in the WebUI, where you can also add, edit and delete nodes, and filter edges by the rule that produced them. The layout only visualizes recorded links: it never infers or writes relationships. The graph page also lists **entity merge candidates** (same kind, contained or near-identical spellings) — suggestions only, confirmed by two clicks, and merging redirects links and folds aliases into the main node without deleting any memory.
|
|
95
|
+
|
|
96
|
+
| Page | What it is for |
|
|
97
|
+
|---|---|
|
|
98
|
+
| Memories | Private/global grouped wall, source/status/library/preview, in-place drawer, multi-select bulk ops, node graph tab |
|
|
99
|
+
| Engine & connection | Optional MemU engine install/switch, embedding endpoint, backups and restore; local runtime download shows MB/s, offers npmjs / npmmirror, and supports pause, stop and resume |
|
|
100
|
+
| Memory settings | Injection mode, token budgets, topK, same-domain cross-library recall, relevance threshold, retention, open-loop cadence, freshness hint, date wake-up, automation |
|
|
101
|
+
| Folders | Folder-level private/global ceiling, expandable conversations and their own switches |
|
|
102
|
+
| Libraries | Create, rename, archive, restore, explicitly delete libraries |
|
|
103
|
+
| Memory browser | Full-text editing, attachments, review queue, graph and bounded canvas, JSON/ZIP import/export |
|
|
104
|
+
| Global memory | Domain-scoped global memories, evidence, review queue and the separate curator; every row can jump to the wall |
|
|
105
|
+
| Prompts | General / RP / Coding / Mixed variants, overrides and per-key reset; unanswered conversations use preset/folder detection; the first-run prompt lets you choose the domain |
|
|
106
|
+
| Stats | Daily activity, hit distribution, health, never-recalled shortlist, 7-day write/read ratio |
|
|
107
|
+
|
|
108
|
+
Settings save as you change them (250 ms debounce), with about 2.5 s cross-window sync and a heartbeat for writes made by tools or another window. The WebUI opens in a new tab; when a popup is blocked it falls back to an in-app overlay without unloading the host SPA. Light, dark, reduced-motion and narrow layouts are supported. Consolidation alerts stack in narrow sidebars; conversation titles remain visible, with timestamps and jump buttons on a separate line.
|
|
109
|
+
|
|
110
|
+
### Injection token budgets
|
|
111
|
+
|
|
112
|
+
`anchorTokens` and `turnTokens` bound anchor and recall content independently (default 800 each). `injectionTotalTokens` caps the whole plugin message (default 2000); it does not replace the recall budget. Title cards spend far fewer tokens per entry than full text, so the same budget exposes more memories; the budget itself was deliberately not increased in 1.2.2.
|
|
113
|
+
|
|
114
|
+
### Time-sensitive memory (1.2.3)
|
|
115
|
+
|
|
116
|
+
- **Stale recall says so.** When recalled entries carry a time signal (a one-off date already in the past, wording like "latest / current / price / version", or an entry older than `freshnessDays`), one conditional line is appended after the recall block telling the model to verify with a search tool *if the conversation has one*. It never claims a tool exists, and it is dropped rather than pushing recall over budget.
|
|
117
|
+
- **Dated promises keep asking.** An `open_loop` memory whose `YYYY-MM-DD` has passed is re-raised every `openLoopRemindDays` (default 7) with its date and how late it is — undated promises keep the old "quiet after one mention" behaviour. Closing a loop requires explicit source evidence; unsupported completion claims remain open for confirmation.
|
|
118
|
+
- **Optional wake-up call.** `salientWake` (default **off**) schedules a one-shot host task per bound conversation so a salient date is spoken about on the day, even if the conversation went cold. The delivered turn carries its own text — recall and anniversary blocks do not run there — and the tasks are visible in the host's schedule UI. Requires the host process to be running; experimental until verified on a real install.
|
|
119
|
+
|
|
120
|
+
### Domain Prompts
|
|
121
|
+
|
|
122
|
+
Resident guidance, writing policies and consolidation prompts follow the current session domain. Local tools and remote JSON consolidation share the domain body, with separate supported output contracts. Before a domain is chosen, new conversations use preset/folder detection: RP-marked names select RP, other folders select Coding, and no folder selects General. The prompt initially selects RP, but only confirmation makes that an explicit choice. Coding, Mixed and custom pages remain available. “Later” postpones the question until you leave and return; transient checks retry with backoff rather than counting as an answer. A session first observed as blank remains eligible even if its first message arrives before the folder information; historical conversations are not prompted retroactively.
|
|
123
|
+
|
|
124
|
+
| Domain | Memory focus |
|
|
125
|
+
|---|---|
|
|
126
|
+
| Coding | Requirements, acceptance criteria, interfaces, call chains, invariants, root causes, tradeoffs, verification and handoff points. Neutral engineering notes, not character psychology. Preserve necessary minimal code and exact semantics without copying whole files or truncating critical conditions. |
|
|
127
|
+
| RP | Evidenced moments, character reactions, names and habits, commitments, boundaries and repair. Let memory shape present choices without repetitive callbacks, invented facts or automatic intimacy. |
|
|
128
|
+
| Mixed | The prompt separates technical, character and OOC material per item; it does not automatically change the session domain. Tags aid retrieval, not access control or character knowledge. |
|
|
129
|
+
| General | Neutral facts, preferences, decisions with reasons, promises and constraints; no default roleplay. |
|
|
130
|
+
|
|
131
|
+
Updated defaults never overwrite custom text. The default-update notice remains until that prompt is saved or reset. Compare, merge or restore individual prompts in **Prompts**; there is no need to clear memories. Regression tests cover routing and output contracts, not a guarantee of naturalness or long-term memory quality, which still requires real-conversation evaluation.
|
|
132
|
+
|
|
133
|
+
## Installation
|
|
134
|
+
|
|
135
|
+
### Requirements
|
|
136
|
+
|
|
137
|
+
| | |
|
|
138
|
+
|---|---|
|
|
139
|
+
| DSH | `>=0.2.0-rc.1` (web profile; verified on `0.2.2-rc.1`, 2026-11-05) |
|
|
140
|
+
| Node.js | `>=20.9` |
|
|
141
|
+
| OS | Windows, macOS or Linux, wherever DSH's web host runs |
|
|
142
|
+
| Optional engine | Python 3.11+ **only** if you choose the vector backend. The default backend needs no Python, no embedding service and no API key. |
|
|
143
|
+
|
|
144
|
+
### Method 1 — npm (recommended)
|
|
145
|
+
|
|
146
|
+
```sh
|
|
147
|
+
dsh plugin --profile web add dsh-memu-memory
|
|
148
|
+
dsh web
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
Restart the host after installing or updating. The plugin appears as **Settings → MemU**, and the right sidebar gets the **MemU WebUI** button.
|
|
152
|
+
|
|
153
|
+
> Replace `web` with your profile name if you use another one. Older DSH CLIs accept the shorter form `dsh plugin add dsh-memu-memory` without the profile flag.
|
|
154
|
+
|
|
155
|
+
### Method 2 — npx (no global install)
|
|
156
|
+
|
|
157
|
+
```sh
|
|
158
|
+
npx @deepseek-ai/dsh plugin --profile web add dsh-memu-memory
|
|
159
|
+
npx @deepseek-ai/dsh web
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### Method 3 — from a local checkout (development)
|
|
163
|
+
|
|
164
|
+
The repository has **no build step**: `lib/` is the runtime. Clone it, link the checkout into your DSH profile, and add the bundle.
|
|
165
|
+
|
|
166
|
+
```sh
|
|
167
|
+
git clone <this repository> dsh-memu-memory
|
|
168
|
+
cd dsh-memu-memory
|
|
169
|
+
npm ci --legacy-peer-deps
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
In the profile's `package.json`:
|
|
173
|
+
|
|
174
|
+
```json
|
|
175
|
+
{
|
|
176
|
+
"dependencies": {
|
|
177
|
+
"dsh-memu-memory": "link:/absolute/path/to/dsh-memu-memory"
|
|
178
|
+
},
|
|
179
|
+
"dsh": {
|
|
180
|
+
"profile": {
|
|
181
|
+
"bundles": ["dsh-memu-memory"]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Then restart DSH. A symlinked checkout is picked up on restart; there is no bundle cache.
|
|
188
|
+
|
|
189
|
+
### Optional — vector engine (MemU)
|
|
190
|
+
|
|
191
|
+
The default `agent` backend is fully usable without this step. Install the engine from **Settings → MemU → Engine & connection**, or from a terminal:
|
|
192
|
+
|
|
193
|
+
```sh
|
|
194
|
+
npx --package dsh-memu-memory dsh-memu-memory-setup
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
What it does:
|
|
198
|
+
|
|
199
|
+
- installs the pinned `memu-cli==0.11.0b3` into `~/.dsh/dsh-memu-memory/engine/<version>/venv`;
|
|
200
|
+
- never installs into the system Python or user site-packages, and leaves no `pip` inside the venv;
|
|
201
|
+
- tries PyPI mirrors in order (user-configured → Tsinghua → Aliyun → pypi.org);
|
|
202
|
+
- if no usable Python/pip exists, uses a **pinned uv** runtime inside the plugin directory and leaves the system `PATH` untouched;
|
|
203
|
+
- downloads roughly 150 MB, runs a real smoke test, and keeps the previous version for rollback.
|
|
204
|
+
|
|
205
|
+
The default `memoryBackend="agent"` uses lexical recall and does not call an embedding service. To enable the vector library, choose `memoryBackend="api"`, then select `vectorSource="local"` for managed local embeddings or `vectorSource="api"` for a configured compatible embedding endpoint (which may itself run on localhost). Both sources feed MemU storage and retrieval; installing the MemU engine alone does not enable vectors.
|
|
206
|
+
|
|
207
|
+
`memoryMode` (`local` / `cloud`) is a MemU storage-compatibility setting, not the embedding switch or source selector; its cloud option is not a claim that managed local inference is offline cloud storage. Summary generation is configured independently of the vector route: ordinary private consolidation uses an Agent fork; an explicit remote-summary action uses its chat endpoint and commits through the same memory write path. Recall uses neither LLM reranking nor an LLM fallback. Exact memory ids still use the direct path; the plugin does not maintain a parallel vector database.
|
|
208
|
+
|
|
209
|
+
Managed model download, progress reporting and profile-switch/migration flows are implemented, but real model/runtime downloads and end-to-end native inference/switching have not been verified in this work. A candidate or `pending` artifact is not available for use; it must not be advertised as downloadable or ready until its artifact and validation gates pass.
|
|
210
|
+
|
|
211
|
+
## First run
|
|
212
|
+
|
|
213
|
+
1. Install, then restart DSH.
|
|
214
|
+
2. Open **MemU WebUI** from the sidebar (or Settings → MemU).
|
|
215
|
+
3. New conversations ask once whether this chat should use memory: private only, global only, both, or none. **Remember my choice** skips the question later. The card you pick **sets both switches at once**, so the sidebar shows the card you chose; the advanced "existing / new library" pick only changes which library the private layer reads, never the two switches.
|
|
216
|
+
4. If you want a folder-wide ceiling, set it under **文件夹** — a folder can forbid private or global memory, and the chat switches will respect that ceiling.
|
|
217
|
+
5. Talk. The agent writes private memories itself. The **MemU 记忆** wall is where you review, edit, archive, link and export them.
|
|
218
|
+
|
|
219
|
+
Folder policy is a **ceiling, not an initial value**: turning a folder switch off immediately clamps every conversation in it, and turning it back on restores each conversation's own choice. A folder with both switches off does not prompt, does not create a library and does not inject anything.
|
|
220
|
+
|
|
221
|
+
## Model tools
|
|
222
|
+
|
|
223
|
+
| Tool | Purpose |
|
|
224
|
+
|---|---|
|
|
225
|
+
| `memu_private_remember` | Write a private memory, with source, layer, disclosure, visibility, tags, open loop and attachment references |
|
|
226
|
+
| `memu_private_recall` | Keyword snippets or exact-id body pages (`view`, `offset`, `limitChars`, `revision`, optional allowed `libraryId`); search `topK` is a hard 1–20 row limit, conflicts use pointers |
|
|
227
|
+
| `memu_private_list` | List the memories usable in the current scope |
|
|
228
|
+
| `memu_private_update` | Edit, without bypassing pin admission, review or visibility rules |
|
|
229
|
+
| `memu_private_archive` | Archive; never delete |
|
|
230
|
+
| `memu_private_unpin` | Marginalize a permanent memory with a first-person reason, quota and cooldown |
|
|
231
|
+
| `memu_private_link` | Link memories/entities with evidence, or update a relationship snapshot; also adjudicates uncertain `memu_private_link_suggest` candidates; cannot delete edges |
|
|
232
|
+
| `memu_private_link_suggest` | Refresh deterministic edges (confirmed-entity mentions and field evidence) for ids written this consolidation and return only uncertain candidate pairs |
|
|
233
|
+
| `memu_lexicon_search` | Search active lexicon terms this conversation can see: bound library + global lexicon (+ same-domain libraries when cross-library recall is on); archived and tombstoned terms stay hidden |
|
|
234
|
+
| `memu_lexicon_propose` | Add or update a lexicon term in the bound library (never the global lexicon); ordinary entries become active immediately, sensitive triggers remain user-only |
|
|
235
|
+
| `memu_global_recall` / `memu_global_list` | Read the global layer by domain; recall supports snippets or versioned exact-id body pages without broadening eligibility |
|
|
236
|
+
| `memu_status` | Storage health, sync heartbeat, recall state and image-turn status |
|
|
237
|
+
|
|
238
|
+
The main agent has **no global write tool**. Global memories are produced only by the separate curator.
|
|
239
|
+
|
|
240
|
+
## Privacy, permissions & data
|
|
241
|
+
|
|
242
|
+
**What is stored.** Everything lives under `~/.dsh/dsh-memu-memory/` (or `$DSH_MEMU_MEMORY_HOME`; the legacy `$DSH_MEMU_HOME` and `~/.dsh/dsh-memu` are still honoured when no new `state.json` exists):
|
|
243
|
+
|
|
244
|
+
```text
|
|
245
|
+
~/.dsh/dsh-memu-memory/
|
|
246
|
+
├─ state.json settings, folder policies, session bindings
|
|
247
|
+
├─ index/<libraryId>.json private memory bodies (source of truth)
|
|
248
|
+
├─ index/global.json global memories
|
|
249
|
+
├─ index/*.stats.json per-day counters (90-day roll)
|
|
250
|
+
├─ index/*.media.json attachment metadata and reference counts
|
|
251
|
+
├─ index/*.entities.json entities and relationship snapshots
|
|
252
|
+
├─ attachments/<libId>/<sha256>.<ext>
|
|
253
|
+
├─ libraries/*.sqlite3 optional vector layer (acceleration, not truth)
|
|
254
|
+
├─ engine/<version>/venv optional MemU engine
|
|
255
|
+
├─ prompts/ user prompt overrides
|
|
256
|
+
├─ backups/ explicit backups and pre-switch snapshots
|
|
257
|
+
└─ logs/ install log only
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
- **Text and images are not encrypted at rest.** The directory is inside your home directory. If that is not acceptable, do not store secrets in memories and protect the disk with OS-level encryption.
|
|
261
|
+
- **Images are opt-in privacy data.** Only host-approved attachments are captured. `secret` entries never serve their attachments over the HTTP route; `never_say` captions are not echoed. The vision description service is enabled by default, but it only sends an image after you configure an endpoint, and it may cost money. It never uses host credentials automatically.
|
|
262
|
+
- **Network.** No telemetry. Outbound traffic happens only for (a) the optional engine installer downloading Python packages/uv from the configured mirrors, (b) the embedding endpoint you configure, (c) the optional remote summary model, and (d) the vision endpoint you configure (enabled by default; no call is made until an endpoint is configured). The default backend makes no external calls for memory operations.
|
|
263
|
+
- **Shell and filesystem.** The optional engine installer uses Python/pip in a private venv (and a pinned uv fallback inside the plugin directory). It does not modify system Python, install global packages or change `PATH`. All memory writes are confined to the data directory; config writes use temp-file + rename.
|
|
264
|
+
- **Deletion.** Archiving moves a memory out of retrieval; permanent deletion is a separate, guarded action for already-archived entries. Deleting a conversation only unbinds it; it never deletes the library. Library deletion asks for confirmation and is backed up first.
|
|
265
|
+
|
|
266
|
+
## External messages in a long tool turn
|
|
267
|
+
|
|
268
|
+
A host turn may remain open while a third-party tool waits for messages.
|
|
269
|
+
New human input can trigger one bounded recall at the next model step without
|
|
270
|
+
ending that turn or making another model call. Native user messages work directly.
|
|
271
|
+
Unmarked tool logs, sleep completions, failed calls and empty polls do not trigger it.
|
|
272
|
+
The plugin does not depend on a particular waiting implementation.
|
|
273
|
+
|
|
274
|
+
Transport plugins can put this exact object in their own `ToolResult.meta.memoryInbound`:
|
|
275
|
+
|
|
276
|
+
```js
|
|
277
|
+
const batch = {
|
|
278
|
+
type: 'dsh-memu-memory/inbound-batch',
|
|
279
|
+
version: 1,
|
|
280
|
+
producer: 'my-message-transport',
|
|
281
|
+
batchId: 'delivery-42',
|
|
282
|
+
messages: [{
|
|
283
|
+
id: 'remote-message-18',
|
|
284
|
+
role: 'user',
|
|
285
|
+
context: { channelId: 'room-1', speakerId: 'person-7' },
|
|
286
|
+
content: [{ type: 'text', text: 'Where is the deployment script we discussed?' }],
|
|
287
|
+
}],
|
|
288
|
+
}
|
|
289
|
+
// A normal ToolResult: keep the original model-facing content and other metadata.
|
|
290
|
+
return { content: originalContent, meta: { ...originalMeta, memoryInbound: batch } }
|
|
291
|
+
```
|
|
292
|
+
|
|
293
|
+
The channel/character/world/branch must match the conversation's configured memory
|
|
294
|
+
scope; omit unavailable identities rather than guessing them. Images must use
|
|
295
|
+
`{ type: 'image', attachment: hostAdmittedRef }`, never filesystem paths, URLs or bytes.
|
|
296
|
+
If metadata is unavailable, return the complete protocol as JSON text and list
|
|
297
|
+
the exact tool name under **External message tool allowlist**. JSON embedded in logs
|
|
298
|
+
or code fences is not accepted, nor is JSON from an unapproved tool.
|
|
299
|
+
|
|
300
|
+
An in-process integration may instead import
|
|
301
|
+
`ingestInboundBatch` from `dsh-memu-memory/integration` and call
|
|
302
|
+
`ingestInboundBatch({ sessionId, batch, ctx, session })`. It registers work only:
|
|
303
|
+
the producer still delivers the actual incoming content to the model. It does not
|
|
304
|
+
wake the agent, append a fake user turn or write fact memories.
|
|
305
|
+
|
|
306
|
+
Deduplication uses producer + channel + speaker + message id; changing a delivery id
|
|
307
|
+
does not replay an already processed message. Memory cadence advances by human-message
|
|
308
|
+
batches even when the host turn number stays fixed. Pending input is capped at 32
|
|
309
|
+
messages / eight images / 96 KB, with at most 4000 characters per external text block;
|
|
310
|
+
overflow is explicitly refused, never silently discarded. Split oversized batches.
|
|
311
|
+
Recall failure preserves the queue with a 30-second retry delay; cancellation does not consume it.
|
|
312
|
+
Only the admitted batch is confirmed, so messages arriving during recall remain pending.
|
|
313
|
+
Running agents (including waiting tools) and pending batches are not sleep-consolidated;
|
|
314
|
+
the idle window starts from real message activity or the agent's return to idle.
|
|
315
|
+
`memu_status` reports `inbound` queue/clock/result and `inbound_error` when degraded.
|
|
316
|
+
|
|
317
|
+
## Compatibility & limits
|
|
318
|
+
|
|
319
|
+
- **Host:** DSH `>=0.2.0-rc.1`, using public extension points only (tools, injection, session query, subagents, slots, a prefixed HTTP route). No host source modifications. The core surfaces (13 `memu_*` tools, guide injection, settings page, right-sidebar tab, prefixed RPC) were verified on `0.2.2-rc.1` on 2026-11-05; the check table lives in [`docs/host-adaptation.md`](docs/host-adaptation.md). The optional dated-wake feature uses the host-wide `ctx.schedule` task API introduced in `0.2.2`; on `0.2.0`–`0.2.1` (session-scoped reminders) it detects the older shape and skips with one warning instead of retrying every sweep.
|
|
320
|
+
- **Recall quality:** the default backend is lexical. Semantic recall depends on the optional engine and the embedding model you choose; the plugin cannot improve a model it does not own. LongMemEval, long-running group-chat A/B and "human-likeness" scores have **not** been run — test counts are not a quality score. A clear lexical topic match can outweigh rank-flattened competitors; recognised QQ/response-style scaffolding is excluded from that dominance evidence, but arbitrary templates and languages are not semantically understood.
|
|
321
|
+
- **No cloud sync, no accounts, no cross-device sync.** This is a local plugin with no server-side identity.
|
|
322
|
+
- **Images without vision:** without an optional caption/vision endpoint, an image memory is a pointer plus what a person wrote about it. The plugin does not claim to see pixels.
|
|
323
|
+
- **Poisoned v4 sessions:** historical `format v4 message requires a producer-owned source kind` rows can be diagnosed but not rewritten; the plugin never edits private session files.
|
|
324
|
+
- **Agent presets:** injection, guide delivery and the final tool list are separate integration checks. The plugin attaches injection listeners to the current agent context and supplies a conditional first-step `<memory-guide rules="…">` message. Tool availability depends on the preset declaration and host scope, so verify the actual request tool list in the target host. The plugin uses public extension points and does not edit preset files.
|
|
325
|
+
- **Reused session ids in IM channels, and domain switches:** `dsh-channel` and similar surfaces reuse a deterministic id (`qq-dm-<uid>`) across restarts, and the host can re-create a same-id session with an empty transcript. The plugin compares the host session identity (`session.createdAt`; when the host does not expose it, a turn number back at 1 plus the first message id) against the stamp kept on the binding, and on a new incarnation it clears the previous incarnation's `guideRulesKey` / `anchorPushed` so the rules and the anchor are delivered again (1.4.1+). Before this, such a conversation could run its whole life without a `<memory-guide>` message. **Switching the memory domain** re-delivers too: the rules message, the anchor, today's anniversaries, open loops and the time-of-day line are all domain-filtered, so a domain change resets them and they are delivered again for the new domain. Guide delivery is also decoupled from recall: a recall exception no longer swallows the rules message.
|
|
326
|
+
- **Lifecycle maintenance:** expired short-term drafts leave ordinary recall and are archived after their retention period; the body is retained. Open commitments and ended validity windows can enter independent maintenance review. Automatic closure requires explicit user-source evidence and revision checks; a passed deadline alone does not establish whether a promise was kept.
|
|
327
|
+
- **Coding consolidation detail:** the fork seed keeps every coding turn that touched a tool (up to 120 turns, default 60), 2,200 chars of a tool result and 1,000 chars of call arguments; the worker path's turn-log keeps 600-char tool lines and 400-char arguments (default 160/120), and the turn-log-off fallback compaction keeps 1,400/700 (default 400/300). RP/general keep their original caps, and the 500-event window, 12k per-message text and 4,000-char per-record limits still bound everything.
|
|
328
|
+
- **Consolidation worker (C 包, 2026-10-30).** An idle or manual pass now works from a *fixed snapshot*: it takes the public `sessionQuery.observeSession()` lease (falling back to `readSession()` when the host offers no lease), cuts at the last complete `turn/end`, and drops unpaired tool calls and half steps — a live transcript whose last turn is still open is **deferred**, never consolidated. A job is settled only by a structured completion receipt that is cross-checked against the library index (an id the library does not contain is not a success, and a rewrite of an existing id counts as an update, not a new memory). Checked / pending / in-flight ranges and a lease are persisted separately in `consolidation.json`, so a crash, a timeout or a failed turn leaves the range pending instead of looking consolidated. **Limits:** the worker still runs inside the parent preset's own system prompt — it receives an explicit "you are a background consolidation worker, not this character" brief, which reduces but does not remove persona carry-over, because the host has no public API to replace that prompt; and when the conversation's tool surface carries no `memu_private_remember` / `memu_private_update` (or exposes memory only through PTC), consolidation reports `unavailable` (`worker-tools-missing` / `worker-tools-ptc-only`) rather than forking a worker that could not write. The parent's library, scope, domain and memory context are re-checked before dispatch, on every worker tool call, and again before any result is credited.
|
|
329
|
+
- **Consolidation coverage is conservative lexical evidence.** A matching date or a couple of shared terms does not prove a candidate was written. The local check also requires text coverage, retained characters/words and values, and matching clause polarity; uncertain candidates stay in carry. It can retain a paraphrase that was already saved, and it does not claim semantic equivalence.
|
|
330
|
+
- **"Tomorrow" is resolved at write time.** A relative day (今天 / 明天 / 后天 / today / tomorrow) together with a month-day settles into one dated memory; a memory that only says "sometime next month" keeps no date rather than inventing one. A date that was already written as `MM-DD` is not rewritten — the fix applies to new writes.
|
|
331
|
+
- **Not in scope:** cloud MemU integration, source backfill for old entries, automatic repair of already-written v4 corruption.
|
|
332
|
+
|
|
333
|
+
## Development & verification
|
|
334
|
+
|
|
335
|
+
```sh
|
|
336
|
+
npm ci --legacy-peer-deps
|
|
337
|
+
npm test # full suite; the isolated real-engine case skips unless configured
|
|
338
|
+
npm run check # syntax + i18n key alignment + package.json
|
|
339
|
+
npm run build:graph # rebuild shipped offline assets after graph source changes
|
|
340
|
+
node scripts/acceptance-local.mjs # 50 automated acceptance checks
|
|
341
|
+
node scripts/migrate-visibility.mjs # report (add --apply to rewrite) libraries that still store the removed session level
|
|
342
|
+
node --import ./tests/loader-register.mjs scripts/preview.mjs --port 7789
|
|
343
|
+
node scripts/make-readme-shots.mjs # re-record the screenshots above against that preview
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
The preview serves the real WebUI against isolated example data at `http://127.0.0.1:7789/dsh-memu-memory/ui#/settings/memories`.
|
|
347
|
+
|
|
348
|
+
With the preview running, use `npm run test:graph-browser -- http://127.0.0.1:7789/dsh-memu-memory/ui#/settings/memories` in another terminal to check 200 nodes, desktop/narrow layouts, dragging, refresh stability, themes and load retries. Run `npx playwright install chromium` once, or set `GRAPH_BROWSER_CHANNEL=msedge` on Windows to use installed Edge. Stress data is intercepted only in the test browser and never written to memory. No CDN is needed at runtime; the bundle carries no third-party runtime code, which `lib/webui/graph-LICENSE.txt` records.
|
|
349
|
+
|
|
350
|
+
Run the automated acceptance checks with `node scripts/acceptance-local.mjs`. Optional engine integration tests require their documented environment settings; protocol checks do not establish model quality.
|
|
351
|
+
|
|
352
|
+
## Documentation
|
|
353
|
+
|
|
354
|
+
- Release notes: [`CHANGELOG.md`](CHANGELOG.md)
|
|
355
|
+
|
|
356
|
+
[`AGENTS.md`](AGENTS.md) is the index for anyone changing this repo — which file answers
|
|
357
|
+
which question. The detail lives in [`docs/`](docs/): failure modes, the change process,
|
|
358
|
+
the host facts, and the UI, memory and environment rules.
|
|
359
|
+
|
|
360
|
+
## License
|
|
361
|
+
|
|
362
|
+
[MIT](LICENSE) © dsh-memu-memory contributors.
|
|
363
|
+
|
|
364
|
+
You may use, modify, distribute and sell this software, provided the copyright notice and permission notice are included. The software is provided **as is**, without warranty of any kind.
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
If this plugin is useful to you, open an issue with the host version and a minimal reproduction — memory bugs are easiest to fix when the transcript and the storage state are both available.
|