Skip to main content

Module sparse

Module sparse 

Source
Expand description

Sparse (lexical) vectors for hybrid retrieval (zero dependencies). Sparse (lexical) vectors for hybrid retrieval.

A SparseVector is the learned-lexical counterpart to a dense embedding — for example BGE-M3’s sparse head or SPLADE. It pairs vocabulary indices with weights, and is what pgvector stores in a sparsevec column.

Combining a dense and a sparse branch is what makes hybrid retrieval work: the dense side matches paraphrases, the sparse side matches exact terms (identifiers, statute numbers, rare jargon) that dense vectors blur away.

Structs§

SparseVector
A sparse vector — indices[i] carries weight values[i].