{"modulePath":"github.com/loremlabs/thanks-computer","version":"v0.2.66","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sqlitevec\n\nPackage sqlitevec is the bundled vector.Store backend: SQLite + sqlite-vec, in a dedicated database file (never the config-reloaded runtime DB).\n\nv1 is exact, not approximate. Each collection is a normal table holding a serialized float32 BLOB per item plus a JSON metadata sidecar; search brute-force-ranks with sqlite-vec's vec\\_distance\\_cosine() scalar function and pushes the metadata filter into a parameterized WHERE before ranking. No vec0 virtual table, no ANN, no recall tuning — fine into the ~100k-vector range, and swappable for vec0/ANN behind the vector.Store interface.\n\n## Types\n\n```go\ntype Store struct {\n\t// contains filtered or unexported fields\n}\n```\nStore is the sqlite-vec-backed vector.Store.\n\n```go\nfunc New(dbPath string) (*Store, error)\n```\nNew opens (creating if absent) the vector database at dbPath and verifies sqlite-vec is loaded. The DSN mirrors the chassis runtime convention (WAL + busy\\_timeout, no cache=shared).\n\n```go\nfunc (s *Store) Close() error\n```\n\n```go\nfunc (s *Store) Delete(ctx context.Context, tenant, collection string, ids []string) (int, error)\n```\n\n```go\nfunc (s *Store) DescribeCollection(ctx context.Context, tenant, name string) (vector.Collection, bool, error)\n```\n\n```go\nfunc (s *Store) DropCollection(ctx context.Context, tenant, name string) (int, error)\n```\n\n```go\nfunc (s *Store) EnsureCollection(ctx context.Context, tenant string, c vector.Collection) error\n```\n\n```go\nfunc (s *Store) Get(ctx context.Context, tenant, collection string, sel vector.Selector, after string, limit int) (vector.GetResult, error)\n```\nGet reads items without ranking: the same table and WHERE a search uses, without the distance. The selector's rules and the answer's order and bounds are vector.NormalizeGet / ResultByIDs / ResultByFilter, shared with every backend.\n\n```go\nfunc (s *Store) ListCollections(ctx context.Context, tenant string) ([]vector.Collection, error)\n```\n\n```go\nfunc (s *Store) ListIDs(ctx context.Context, tenant, collection string) ([]string, error)\n```\n\n```go\nfunc (s *Store) Search(ctx context.Context, tenant, collection string, query []float32, limit int, filter vector.Filter) ([]vector.Match, error)\n```\n\n```go\nfunc (s *Store) Shared() bool\n```\nShared reports false: the bundled SQLite backend is per-node (each node owns its own vector.db file), so the store-seed reconciler runs on every node.\n\n```go\nfunc (s *Store) UpdateMetadata(ctx context.Context, tenant, collection string, filter vector.Filter, set map[string]any) (int, error)\n```\n\n```go\nfunc (s *Store) Upsert(ctx context.Context, tenant, collection string, items []vector.Item) (int, error)\n```\n\n","path":"github.com/loremlabs/thanks-computer/chassis/vector/sqlitevec","name":"sqlitevec","synopsis":"Package sqlitevec is the bundled vector.Store backend: SQLite + sqlite-vec, in a dedicated database file (never the config-reloaded runtime DB).","isRedistributable":true}
