v0.5.23: Faster Memory Compaction, Queries and Multi-Space Recall
This patch publishes the algorithm improvements in PR #330, reducing repeated scans and allocations as data grows:
- Runtime compaction: index original content once, group entries stably into three priority buckets, and count UTF-8 bytes incrementally. The cost falls from O(N²L), for average text length L, to O(N+B), where B is total text bytes.
- Document queries: generate excerpts only for returned documents, preserving live content reads, scoring, result order and access-time updates.
- Memory Space discovery and multi-space recall: use request-local Map/Set indexes for catalog matching, pinned-space resolution and quality counters. Full candidate ordering, permissions, failure handling and Provider call order remain intact.
- Batch-write preparation: reuse synchronous target resolution and append to grouped arrays, using a Set for membership checks. Provider persistence behavior stays the same.
- Holographic queries: compute exact token-set intersections and use a stable bounded heap for the top k items. Finite-score ranking falls from O(M log M) to O(M log k+k log k). Small collections and non-finite scores retain the original sorting path.
Performance evidence
Measurements cover N=1, 10 and 100, with N=1000 added on the same machine and dependency set. These are median times per operation at N=1000:
| Local operation | Before | After |
|---|---|---|
| Runtime compaction | 41.347 ms | 4.047 ms |
| Document search | 40.484 ms | 22.165 ms |
| Multi-space recall orchestration | 254.008 ms | 9.834 ms |
| Pinned-space recall orchestration | 2154.052 ms | 9.400 ms |
These are local latencies with synthetic data and warm file caches. Recall uses local adapter fixtures and does not measure remote Provider or LLM end-to-end latency. Complexity conclusions also rely on code analysis and deterministic work-count tests; timing alone cannot prove Big-O. The algorithm audit and its raw metrics include every size, workload parameters, unchanged complexity bounds and measurement limits.
Upgrade and compatibility
From v0.5.22, use Memory System → Status → Check versions → Update, then restart DSH. To install or update to the exact version from the CLI:
dsh plugin --profile web add dsh-mnemon@0.5.23Restart an existing DSH process after installation; a new installation can choose Enable now on the Plugins page. An explicit version avoids package-manager release waiting windows affecting version selection. For older desktop installations, see Compatibility and upgrades.
The DSH compatibility range from v0.5.22 is unchanged. The complete development profile uses Node ^22.19.0 || >=24.0.0. Storage formats, configuration, permissions and UI flows are unchanged; existing memory needs no migration. No new Starter SDK export is required, so plugin peer floors stay unchanged.
Changed packages
| Package | Previous | New |
|---|---|---|
dsh-mnemon |
0.5.22 | 0.5.23 |
dsh-mnemon-source-runtime |
0.5.11 | 0.5.12 |
dsh-mnemon-source-documents |
0.5.8 | 0.5.9 |
dsh-mnemon-source-memory-spaces |
0.5.14 | 0.5.15 |
dsh-mnemon-provider-holographic |
0.5.5 | 0.5.6 |
The Starter pins these four new plugin versions. Its other 13 component versions are unchanged, as are all locked external dependency versions and their resolved peer graph.
Verification
Before merging, the algorithm changes passed 2063 local tests, with 9 optional integration tests skipped, plus the corresponding independent-plugin, packed-installation, real Headless, Node 20/22/24 and Windows CI checks. Equivalence regressions cover stable ranking, UTF-8 capacity boundaries, live file reads, quality counters, permissions and ordered batch receipts.
The release PR verifies the versioned composition again. Before creating the GitHub release, publication checks frozen artifacts, Registry integrity, installation of all 17 plugins and a real Registry upgrade from v0.5.16. Execution results are available in the repository's Publish to npm workflow.
Previous release: v0.5.22.