Skip to main content

Module sidecar

Module sidecar 

Source
Expand description

Generic sidecar search index wrapping FibScorer.

FibSidecarIndex<Id> stores caller-owned IDs alongside encoded FibCodeV1 artifacts and provides approximate nearest-inner-product search via the Gram-table estimator in FibScorer. The index is a sidecar: it produces approximate candidates that callers must rerank with an exact inner-product computation against the original (un-encoded) vectors before acting on the result.

§Model

  1. The caller constructs a FibScorer once (which builds the codebook Gram table).
  2. The caller encodes vectors with [FibQuantizer::encode] and adds them to the sidecar index via FibSidecarIndex::add / add_batch.
  3. At query time, the caller passes a raw query slice. The sidecar calls FibScorer::inner_product_estimate for every stored code, sorts the results in descending order of approximate score, and returns the top top_k * oversample candidates.
  4. FibSidecarIndex::search_with_receipt additionally returns a SearchReceiptV1 documenting the approximate nature of the results.

Structs§

FibSidecarIndex
Generic ID-typed sidecar search index.
IvfCoarseQuantizer
IVF (Inverted File) coarse quantizer for sub-linear search.
ScoredCandidate
A scored candidate from approximate sidecar search.
SearchReceiptIvfV1
Receipt documenting an IVF-accelerated approximate sidecar search.
SearchReceiptV1
Receipt documenting an approximate sidecar search.