Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Checkpoint serialization and restoration for SparseVectorManager.

Persists every sparse inverted index so a cold open loads them directly — no rebuild pass over source documents is required.

§Key layout under Namespace::Vector

nodedb_types::Namespace has no sparse-specific variant, so the sparse index shares the vector engine’s namespace behind a distinct sparse: key prefix that cannot collide with the dense HNSW keys.

KeyValue
sparse:_indicesMessagePack Vec<String> — index key list
sparse:{index_key}:docsMessagePack Vec<(String, Vec<(u32, f32)>)>

Documents are stored as their own (dimension, weight) entries rather than as posting lists: the inverted index is a pure function of the document vectors, so storing the source form keeps the blob minimal and makes the restored index structurally identical to a freshly built one.