Documentation
¶
Overview ¶
Package sqlite is the pure-Go (modernc.org/sqlite, no cgo) default Store for mneme. Embeddings are stored as little-endian float32 BLOBs and cosine similarity is computed in Go over the scope-filtered rows. This is O(n) per scope — correct and simple, fine for thousands of facts. When that hurts, swap in a sqlite-vec or pgvector Store; the pipeline does not change.
Index ¶
- type Store
- func (s *Store) Close() error
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) ExistingHashes(ctx context.Context, scope types.Scope) (map[string]struct{}, error)
- func (s *Store) Get(ctx context.Context, id string) (types.Record, error)
- func (s *Store) Insert(ctx context.Context, recs []types.Record) error
- func (s *Store) Search(ctx context.Context, scope types.Scope, vec []float32, k int) ([]types.Hit, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a SQLite-backed store.Store.
func Open ¶
Open opens (creating if needed) a SQLite database at path and ensures the schema exists. Use ":memory:" for an ephemeral store. The returned *Store is safe for concurrent use by multiple goroutines.
func (*Store) ExistingHashes ¶
Click to show internal directories.
Click to hide internal directories.