inmemory

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: 5 Imported by: 0

Documentation

Overview

Package inmemory provides an in-memory vector store for memoryrails.

It uses brute-force cosine similarity search and is suitable for development, testing, and small-scale applications (< 10K memories). Data is not persisted across restarts.

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 an in-memory vector store using brute-force cosine similarity.

func New

func New() *Store

New creates a new in-memory store.

func (*Store) Close

func (s *Store) Close() error

Close is a no-op for the in-memory store.

func (*Store) Delete

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

func (*Store) Get

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

func (*Store) Len

func (s *Store) Len() int

Len returns the number of memories in the store.

func (*Store) List

func (*Store) Put

func (s *Store) Put(_ context.Context, memory *memoryrails.Memory) error

func (*Store) Search

func (s *Store) Search(_ 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