filestore

package
v1.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package filestore provides the lightweight JSON-backed memory used by the autonomous examples. Keeping it here avoids duplicating the example store in every command while making clear that it is not a production backend.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileBackedMemoryModule

func FileBackedMemoryModule(filePath string, window int, embedder memory.Embedder, opts *memory.Options) *modules.MemoryModule

Types

type FileBackedStore

type FileBackedStore struct {
	// contains filtered or unexported fields
}

FileBackedStore is a simple persistent VectorStore that writes to a local JSON file. It is ideal for examples and local testing where you want continuity without running a database.

func NewFileBackedStore

func NewFileBackedStore(filePath string) *FileBackedStore

func (*FileBackedStore) Count

func (s *FileBackedStore) Count(ctx context.Context) (int, error)

func (*FileBackedStore) DeleteMemory

func (s *FileBackedStore) DeleteMemory(ctx context.Context, ids []int64) error

func (*FileBackedStore) Iterate

func (s *FileBackedStore) Iterate(ctx context.Context, fn func(model.MemoryRecord) bool) error

func (*FileBackedStore) SearchMemory

func (s *FileBackedStore) SearchMemory(ctx context.Context, sessionID string, queryEmbedding []float32, limit int) ([]model.MemoryRecord, error)

func (*FileBackedStore) StoreMemory

func (s *FileBackedStore) StoreMemory(ctx context.Context, sessionID, content string, metadata map[string]any, embedding []float32) error

func (*FileBackedStore) UpdateEmbedding

func (s *FileBackedStore) UpdateEmbedding(ctx context.Context, id int64, embedding []float32, lastEmbedded time.Time) error

Jump to

Keyboard shortcuts

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