[lore 4/7] VectorStore interface + sqlite-backed reference impl#4
Merged
Conversation
6060908 to
db2bb4e
Compare
Adds pkg/lore/vector with VectorStore interface (Upsert/Delete/Search/Close), Hit and SearchOpts types, and pkg/lore/vector/sqlitevec: a pure-Go SQLite-backed impl using BLOB columns + cosine similarity computed in Go (Path A, no CGO). Includes schema DDL (vectors table), OTel spans on all write/read paths, full test coverage (dimension mismatch, top-K ranking, limit, delete, upsert replace, close idempotence), and README usage example. go.mod: adds go.opentelemetry.io/otel + trace v1.43.0, modernc.org/sqlite v1.50.0.
db2bb4e to
196802c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pkg/lore/vectorwith theVectorStoreinterface (Upsert,Delete,Search,Close), plusHitandSearchOptstypes and sentinel errors (ErrNotFound,ErrInvalidArgument,ErrClosed).pkg/lore/vector/sqlitevec: a pure-Go SQLite-backed reference impl. Vectors stored as little-endian float32 BLOBs; cosine similarity computed in Go over a full table scan (Path A, zero CGO, zero extensions). Acceptable at v0.1.1 scale; 100K scale limit documented in godoc.schema.go(vectorstable withentry_id,dim,vec,updated_at).lore.vector.upsert,lore.vector.delete,lore.vector.searchwithlore.id,lore.dim,lore.limit,lore.candidatesattributes.go.opentelemetry.io/otel+tracev1.43.0,modernc.org/sqlitev1.50.0.Test plan
go build ./...passesgo vet ./...passesgo test -race ./pkg/lore/vector/...passes (10/10 tests)gofmt -l ./pkg/lore/vector/reports no filesPart of lore v0.1.1 build campaign (QUEST-308, parallel with Q2/Q3/Q6).