memory

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package memory provides SQLite-backed persistent memory storage for agents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	ID        string
	AgentID   string
	Content   string
	Category  string    // e.g., "decision", "fact", "preference", "general"
	Embedding []float32 // optional vector embedding
	CreatedAt time.Time
}

Entry is a single piece of persistent agent memory.

type SQLiteMemoryStore

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

SQLiteMemoryStore implements executor.MemoryStore using SQLite FTS5 and optional vector embeddings for hybrid semantic search.

func NewSQLiteMemoryStore

func NewSQLiteMemoryStore(db *sql.DB) (*SQLiteMemoryStore, error)

NewSQLiteMemoryStore creates a new SQLiteMemoryStore. It creates the required tables if they don't exist.

func (*SQLiteMemoryStore) ExtractAndSave

func (ms *SQLiteMemoryStore) ExtractAndSave(ctx context.Context, agentID, transcript string, embedder provider.Embedder) error

ExtractAndSave implements executor.MemoryStore. Extracts key facts from a conversation transcript and saves them.

func (*SQLiteMemoryStore) Save

Save implements executor.MemoryStore.

func (*SQLiteMemoryStore) SaveFull

func (ms *SQLiteMemoryStore) SaveFull(ctx context.Context, entry Entry) error

SaveFull saves an Entry including optional vector embedding.

func (*SQLiteMemoryStore) Search

func (ms *SQLiteMemoryStore) Search(ctx context.Context, agentID, query string, limit int) ([]executor.MemoryEntry, error)

Search implements executor.MemoryStore. Uses FTS5 BM25 ranking to find relevant memories for an agent.

Jump to

Keyboard shortcuts

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