A save_or_update that hit an existing record was logged as a plain Save, so replaying the WAL appended a duplicate instead of updating in place. It is now logged as WalEntryType::Update (0x04) carrying the target index, and replay applies it with cache.update(). The WAL header version goes 3 -> 4 for the benefit of older binaries: they don't know record type 0x04, would read it as a torn tail and truncate it and everything after it. An unknown header version makes them refuse the file instead. The framing is otherwise identical, so v3 files are read by the same code and upgraded in place on open (the header is outside the CRC chain). Also drop the redundant WAL truncate that several callers ran straight after flush(), which already truncates. Co-Authored-By: Claude Fable 5.1 <[email protected]>
clawhdf5-agent
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