Skip to main content

Module schema

Module schema 

Source
Expand description

SQLite schema for the embeddings table and sqlite-vec ANN index.

Vectors are stored in the same SQLite database as the structural index (.normalize/index.sqlite). The embeddings table holds one row per embedded chunk; the raw f32 vector is stored as a BLOB alongside staleness metadata used for query-time re-ranking.

When the sqlite-vec extension is loaded, a companion vec_embeddings virtual table (backed by vec0) mirrors the vector data and enables approximate nearest-neighbor search. The rowid of vec_embeddings is kept in sync with embeddings.id so they can be JOIN-ed freely.

Constants§

CREATE_EMBEDDINGS_IDX_MODEL
CREATE_EMBEDDINGS_IDX_SOURCE
CREATE_EMBEDDINGS_TABLE
DDL for the embeddings table.
DROP_EMBEDDINGS_IDX_MODEL
DROP_EMBEDDINGS_IDX_SOURCE
DROP_EMBEDDINGS_TABLE
DDL statements to drop embedding tables for a full rebuild.
DROP_VEC_EMBEDDINGS_TABLE

Functions§

create_vec_embeddings_ddl
DDL for the sqlite-vec ANN virtual table.