sqlite

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package sqlite provides a SQLite-based vector store for memoryrails.

Uses sqlite-vec extension for vector similarity search. Suitable for edge deployments, CLI tools, and single-machine applications.

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 implements memoryrails.Store using SQLite with in-process cosine similarity computation. Works without sqlite-vec extension by storing embeddings as JSON arrays and computing similarity in Go.

func New

func New(db *sql.DB) (*Store, error)

New creates a new SQLite store. Creates the memories table if it doesn't exist.

func (*Store) Close

func (s *Store) Close() error

func (*Store) Delete

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

func (*Store) Get

func (s *Store) Get(ctx context.Context, id string) (*memoryrails.Memory, error)

func (*Store) List

func (*Store) Put

func (s *Store) Put(ctx context.Context, mem *memoryrails.Memory) error

func (*Store) Search

func (s *Store) Search(ctx context.Context, embedding []float64, opts memoryrails.SearchOptions) ([]memoryrails.SearchResult, error)

Jump to

Keyboard shortcuts

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