-
v0.9.0 Stable
released this
2026-10-17 17:27:28 +00:00 | 7 commits to main since this releaseVSKI v0.9.0
Embeddings: model tags, vector fetch, and a fixed vec0 layout
The embeddings API grows the primitives downstream ML consumers need:
provenance (which embedding model produced these vectors) and export
(the actual vectors, not just distances).Model tags
Upsert accepts an optional
modelform field. The first tagged write pins
it for the collection in the new_vec_metadatasystem table (tenant db,
next to the<collection>_vectable — deliberately not collection
options, which dashboard PATCHes can rewrite). Later upserts declaring a
different model are rejected with 409; search responses and the new
info endpoint echo the pinned tag, so a consumer can refuse embeddings from
a model it wasn't built for:curl -F recordId=$RID -F model=llama-backbone-q8 -F vector=@v.f32 \ localhost:3000/api/collections/notes/embeddingsNew endpoints
GET /api/collections/:name/embeddings—{collection, model, dimensions, metric, count}; a collection with no vectors yet reports
nulls andcount: 0.GET /api/collections/:name/embeddings/:recordId— the exact stored
vector as a JSON float array (float32 values, lossless round-trip).POST /api/collections/:name/embeddings/fetch—{"ids": [...]}→
{"vectors": [{recordId, vector}], "missing": [...]}, indexed point
lookups (max 1000 ids).
Search additionally validates the query dimension against the pinned one
(clear 400 instead of a deep vec0 error) and can be combined with
vec_to_json/hexthrough the admin SQL console as before.The vec0 layout fix (migration required)
The old virtual-table layout (
rowid INTEGER PRIMARY KEYwithrecord_id
as an unindexed metadata column) had two problems: point lookups by
record_idwere full scans, andINSERT OR REPLACEnever conflicted —
every re-upsert of the same record appended a duplicate row that then
duplicated search hits.The canonical layout is now
record_id TEXT PRIMARY KEY, which indexes
record_idin the shadow rowids table (true point queries) and makes
re-upserts replace. vec0 tables cannot beALTERed or renamed, so
BootstrapDBrebuilds legacy tables transactionally on first boot after
the upgrade — copying vectors through a temp table, deduplicating with
last-write-wins — and seeds_vec_metadata(model: null, dimensions
parsed from the old DDL,metric: "l2").Migration notes
- The rebuild copies every vector once; on multi-GB collections expect a
one-time boot proportional to table size. It runs inside a single
transaction per table and is idempotent. - Duplicate rows accumulated by old re-upserts are collapsed to the
latest vector perrecord_id. - Distance semantics are unchanged and now documented: sqlite-vec's
default euclidean L2 over unnormalized float32 vectors, ascending (the vendored sqlite-vec l2 kernel returns the sqrt — plain distance, not the square). make test-vecruns the vec0-dependent Go tests (plaingo test
compiles without thesqlite_vecextension).
Compatibility
API is additive (one new optional upsert field, three new endpoints, two
new response fields). The TS client and the Python SDK gain matching
methods. Existing clients see one behavior change: re-upserting a record
no longer duplicates it in search results — that was the bug.The vendored sqlite driver fork also gained an unconditional
#cgo LDFLAGS: -lminsqlite3.go: cgo compiles every.cfile in the
package directory, sosqlite-vec.c(and itssqrtcalls) links in every
build, not justsqlite_vec-tagged ones — untaggedgo testbinaries
failed to link on toolchains where libm is not implicit.Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
2 downloads