Files
ruflo/v3/@claude-flow/memory/src
rUvandr 722232566a fix(memory): RvfBackend search through hnsw-index.ts (recall@10 0.09 → 0.89) (#4836)
* fix(memory): RvfBackend search through hnsw-index.ts (recall@10 0.09 -> 0.89)

RvfBackend's inlined HnswLite seeded every search from the first
efConstruction vectors in insertion order and BFS'd a flat neighbour graph,
and each insert was an O(n) brute-force scan. Measured against exact search
on 5,000 random unit vectors (cosine, 200 queries, seed 42):

  index                     384-dim recall@10  1536-dim  clustered 384
  HnswLite (before)         0.091              0.079     0.999
  @ruvector/diskann 0.1.3   0.896              0.739     1.000
  hnsw-index.ts, ef=200     0.888              0.744     0.990

DiskANN matched HNSWIndex on recall but a vector inserted after build() is
not searchable until a full rebuild (3.6-4.3 s at 1k vectors), which breaks
store()-then-search(). HNSWIndex is incremental and is the single HNSW
implementation ADR-125 asks for, so RvfBackend now uses it through a private
RvfVectorIndex (not exported; the prepublishOnly surface check still passes).

- indexes of <= 1000 vectors and dimension-mismatched queries use an exact scan
- distances map back to the old similarity scale; threshold filter unchanged
- re-storing an entry without an embedding removes its old vector
- update() re-indexes when an untyped caller passes an embedding

New rvf-backend-recall.test.ts drives the real RvfBackend.search: recall@10
>= 0.9 on 2000 random 64-dim vectors (HnswLite scored 0.294 there), exact
results at 300 vectors, delete/re-store correctness, recall after reopen.

@claude-flow/memory 3.2.2 -> 3.2.3.

Co-Authored-By: claude-flow <ruv@ruv.net>

* chore(memory): leave the version at 3.2.2 in this PR

audit-leaf-package-publish requires the CLI pin to cover the workspace
version, and audit-leaf-versions-published requires that pin to exist on the
registry. The 3.2.3 bump, its publish and the CLI pin move together in the
release that follows.

Co-Authored-By: claude-flow <ruv@ruv.net>

* release(memory): @claude-flow/memory 3.2.3, CLI pins it

The RvfBackend change has to reach users through a standalone publish:
memory is not bundled into the release tarballs (Publishing Rules).
@claude-flow/memory@3.2.3 is published from this branch's tree; the CLI pin
(dependencies + optionalDependencies) moves to it so audit-leaf-package-publish
and audit-leaf-versions-published both hold. The lockfile also gains the
@ruvector/sona 0.1.10 package entries pnpm reported missing.

Co-Authored-By: claude-flow <ruv@ruv.net>

---------

Co-authored-by: r <r@x>
2026-11-05 19:27:51 -06:00
..
2026-01-04 23:50:45 +00:00
2026-01-04 23:50:45 +00:00
2026-01-05 16:42:40 +00:00
2026-01-04 19:57:32 +00:00
2026-02-08 17:11:18 +00:00
2026-10-20 02:11:26 -04:00
2026-02-08 03:36:39 +00:00
2026-02-08 03:38:14 +00:00
2026-01-05 17:28:09 +00:00