Documentation
¶
Overview ¶
Package memory — manager.go provides an LLM-powered memory manager inspired by Agno's MemoryManager.
Package memory provides short-term and long-term memory APIs for agents.
Index ¶
- type Manager
- type MemoryTool
- type Store
- func (s *Store) Get(ctx context.Context, key string) (any, error)
- func (s *Store) ListLongTerm(ctx context.Context) ([]*storage.MemoryRecord, error)
- func (s *Store) ListShortTerm(ctx context.Context) ([]*storage.MemoryRecord, error)
- func (s *Store) SetLongTerm(ctx context.Context, key string, value any) error
- func (s *Store) SetShortTerm(ctx context.Context, sessionID, key string, value any) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager uses an LLM to autonomously decide what to remember from conversations.
func NewManager ¶
NewManager creates an LLM-powered memory manager.
func (*Manager) ExtractMemories ¶
ExtractMemories uses the LLM to identify memorable facts from messages and stores them.
func (*Manager) GetUserMemories ¶
GetUserMemories returns all long-term memories, formatted for context injection.
func (*Manager) MemoryTools ¶
func (m *Manager) MemoryTools() []MemoryTool
MemoryTools returns tool definitions that let the model manage memory directly (agentic memory).
type MemoryTool ¶
type MemoryTool struct {
Name string
Description string
Handler func(ctx context.Context, args map[string]any) (any, error)
}
MemoryTool is a tool definition for agentic memory management.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store provides a high-level memory API on top of storage.Storage.
func (*Store) ListLongTerm ¶
ListLongTerm returns all long-term memories for this agent.
func (*Store) ListShortTerm ¶
ListShortTerm returns all short-term memories for this agent.
func (*Store) SetLongTerm ¶
SetLongTerm stores a value in cross-session persistent memory.