Documentation
¶
Index ¶
- type MemoryRecord
- type Record
- type Store
- func (s *Store) Count(ctx context.Context) (int, error)
- func (s *Store) Delete(ctx context.Context, id string) error
- func (s *Store) DeleteMemory(ctx context.Context, ids []int64) error
- func (s *Store) Iterate(ctx context.Context, fn func(MemoryRecord) bool) error
- func (s *Store) List(ctx context.Context, scope, sessionID string) ([]Record, error)
- func (s *Store) Root() string
- func (s *Store) Save(ctx context.Context, rec Record) error
- func (s *Store) Search(ctx context.Context, query string, limit int) ([]Record, error)
- func (s *Store) SearchMemory(ctx context.Context, sessionID string, queryEmbedding []float32, limit int) ([]MemoryRecord, error)
- func (s *Store) StoreMemory(ctx context.Context, sessionID, content string, metadata map[string]any, ...) error
- func (s *Store) UpdateEmbedding(ctx context.Context, id int64, embedding []float32, lastEmbedded time.Time) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MemoryRecord ¶ added in v1.11.8
type MemoryRecord struct {
ID int64
SessionID string
Content string
Metadata map[string]any
Embedding []float32
LastEmbedded time.Time
CreatedAt time.Time
}
MemoryRecord wraps Record to satisfy external VectorStore interfaces
type Record ¶
type Record struct {
ID string // String ID for markdown storage
NumID int64 // Numeric ID for VectorStore interface (derived from string ID)
Scope string
SessionID string
Role string
Content string
Tags []string
Metadata map[string]any
Embedding []float32
LastEmbedded time.Time
CreatedAt time.Time
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) DeleteMemory ¶ added in v1.11.8
DeleteMemory deletes memories by numeric IDs
func (*Store) Iterate ¶ added in v1.11.8
Iterate calls fn for each memory record, stopping if fn returns false
func (*Store) SearchMemory ¶ added in v1.11.8
func (s *Store) SearchMemory(ctx context.Context, sessionID string, queryEmbedding []float32, limit int) ([]MemoryRecord, error)
SearchMemory searches by embedding vector (cosine similarity) Falls back to keyword search if no embedding provided
Click to show internal directories.
Click to hide internal directories.