Files
clawhdf5/crates/clawhdf5-agent
osobhandClaude Fable 5.1 390a2e3836 perf(agent): unranked BM25 scores and a top-k merge — same rankings, 4-5x faster
Fusion min-max normalises over every keyword match, so hybrid_search asked
BM25 for a ranked list of the whole corpus: a hash insert per posting, then a
sort of every match, then the merge sorted every candidate again to keep k.

- BM25Index::scores returns every match unsorted, accumulated in a dense array
  (contributions are strictly positive, so zero means untouched). search() is
  built on it with the bounded heap.
- merge_vector_keyword partitions out its top k (select_nth) and orders only
  those, with the same score-then-id order.
- Both hybrid paths use scores().

Rankings are identical (equivalence tests for both changes). p50 0.24 -> 0.07
ms (1K), 2.1 -> 0.49 ms (10K), 23 -> 4.65 ms (100K).

The harness gains --fusion-study, which measured the alternative — capping the
keyword pool — and found it changes the top-10 for most queries (overlap
0.83-0.92, different #1 for 10-35%) for only a 2x saving. Not adopted.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
2026-09-19 13:27:31 -07:00
..
2026-09-19 07:19:11 -07:00

clawhdf5-agent

crates.io docs.rs

HDF5-backed persistent memory store for on-device AI agents.

Built on clawhdf5, clawhdf5-agent provides a vector-searchable memory backend optimized for edge AI workloads. Store embeddings, text chunks, and metadata in a single HDF5 file with SIMD-accelerated similarity search.

Features

  • Persistent vector store in HDF5 format
  • Cosine similarity and L2 distance search
  • SIMD-accelerated via clawhdf5-accel (AVX2, NEON)
  • Optional GPU acceleration via clawhdf5-gpu
  • Memory-mapped access for large stores
  • f16 storage support for compact embeddings

Usage

[dependencies]
clawhdf5-agent = "2.1.0"

License

MIT