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 ¶
- func FileBackedMemoryModule(filePath string, window int, embedder memory.Embedder, opts *memory.Options) *modules.MemoryModule
- type FileBackedStore
- func (s *FileBackedStore) Count(ctx context.Context) (int, error)
- func (s *FileBackedStore) DeleteMemory(ctx context.Context, ids []int64) error
- func (s *FileBackedStore) Iterate(ctx context.Context, fn func(model.MemoryRecord) bool) error
- func (s *FileBackedStore) SearchMemory(ctx context.Context, sessionID string, queryEmbedding []float32, limit int) ([]model.MemoryRecord, error)
- func (s *FileBackedStore) StoreMemory(ctx context.Context, sessionID, content string, metadata map[string]any, ...) error
- func (s *FileBackedStore) UpdateEmbedding(ctx context.Context, id int64, embedding []float32, lastEmbedded time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileBackedMemoryModule ¶
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) 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 (*FileBackedStore) UpdateEmbedding ¶
Click to show internal directories.
Click to hide internal directories.