sqlite

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT Imports: 10 Imported by: 0

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

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

func Open(path string) (*Store, error)

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) Close

func (s *Store) Close() error

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, id string) error

func (*Store) ExistingHashes

func (s *Store) ExistingHashes(ctx context.Context, scope types.Scope) (map[string]struct{}, error)

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (types.Record, error)

func (*Store) Insert

func (s *Store) Insert(ctx context.Context, recs []types.Record) error

func (*Store) Search

func (s *Store) Search(ctx context.Context, scope types.Scope, vec []float32, k int) ([]types.Hit, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL