Expand description
Embedding storage: read/write embeddings from/to the structural index SQLite.
Operates through direct libsql calls on the same connection as FileIndex.
The embeddings table is created lazily on first write.
When sqlite-vec is available (vec_embeddings virtual table exists), inserts
and deletes are mirrored there so that ann_search can use the ANN index
instead of loading all vectors into memory.
Constants§
- ANN_
CANDIDATE_ COUNT - Number of ANN candidates to retrieve before staleness re-ranking.
Functions§
- ann_
search - ANN search using the
vec_embeddingsvirtual table. - count_
embeddings - Count embeddings stored for a given model.
- delete_
embeddings_ for_ path - Delete embeddings for a specific (source_type, source_path) pair, all models. Used during incremental rebuild when a file changes.
- drop_
embedding_ tables - Drop embedding tables entirely for a full rebuild.
- embedded_
paths - Return the set of file paths that have at least one embedding for the given model.
- ensure_
schema - Ensure the embeddings table and indices exist.
- ensure_
vec_ schema - Ensure the
vec_embeddingsANN virtual table exists. - load_
all_ embeddings - Load all stored embeddings for a given model name.
- load_
embeddings_ for_ type - Load stored embeddings filtered by a specific source type.
- upsert_
embedding - Insert or replace one embedding row.
- vacuum
- Run
VACUUMto reclaim space after a full rebuild. - vec_
table_ available - Returns
trueif thevec_embeddingsvirtual table exists and is queryable.