Versions in this module Expand all Collapse all v1 v1.3.0 Apr 13, 2026 Changes in this version + func DefaultStorePath() string + type Block struct + CharLimit int + Content string + CreatedAt time.Time + ExpiresAt *time.Time + ID string + Label string + Metadata map[string]string + Scope string + Source string + Tags []string + Tier Tier + UpdatedAt time.Time + func (b *Block) ExceedsLimit() bool + func (b *Block) IsExpired() bool + func (b *Block) TruncateToLimit() + type ContextWindow struct + LongTerm []Block + MediumTerm []Block + ShortTerm []Block + Summaries []Summary + func (cw *ContextWindow) Render() string + type Manager struct + AutoCleanup bool + AutoPromote bool + DefaultCharLimit int + EnforceCharLimit bool + MediumTermMaxAge time.Duration + ShortTermTTL time.Duration + func DefaultManager() (*Manager, error) + func NewManager(store *Store) *Manager + func (m *Manager) AddNote(tier Tier, label, content string, tags ...string) (*Block, error) + func (m *Manager) AddScopedNote(scope string, tier Tier, label, content string, tags ...string) (*Block, error) + func (m *Manager) BuildContext() (*ContextWindow, error) + func (m *Manager) BuildScopedContext(scope string) (*ContextWindow, error) + func (m *Manager) Clear(tier Tier) (int, error) + func (m *Manager) ClearAll() (int, error) + func (m *Manager) Close() error + func (m *Manager) EndSession() error + func (m *Manager) Forget(idOrQuery string) (int, error) + func (m *Manager) List(tier Tier) ([]Block, error) + func (m *Manager) ListScoped(scope string, tier Tier) ([]Block, error) + func (m *Manager) Remember(content string, tags ...string) (*Block, error) + func (m *Manager) RunMaintenance() error + func (m *Manager) Search(query string) ([]Block, error) + func (m *Manager) SearchScoped(scope, query string) ([]Block, error) + func (m *Manager) Stats() (*Stats, error) + func (m *Manager) Store() *Store + type SleepTimeConfig struct + ConvStore *conversations.Store + Enabled bool + Interval time.Duration + MaxConvs int + SummarizerCfg SummarizerConfig + func DefaultSleepTimeConfig() SleepTimeConfig + type SleepTimeEngine struct + func NewSleepTimeEngine(mgr *Manager, cfg SleepTimeConfig) *SleepTimeEngine + func (e *SleepTimeEngine) RunOnce(ctx context.Context) error + func (e *SleepTimeEngine) Start(stopCh <-chan struct{}) + type Stats struct + DiskSizeBytes int64 + LongTermCount int + MediumTermCount int + ShortTermCount int + TotalCount int + type Store struct + func DefaultStore() (*Store, error) + func OpenStore(path string) (*Store, error) + func (s *Store) Add(block *Block) error + func (s *Store) BuildContext() (*ContextWindow, error) + func (s *Store) ClearAll() (int, error) + func (s *Store) ClearTier(tier Tier) (int, error) + func (s *Store) Close() error + func (s *Store) Delete(id string) error + func (s *Store) DeleteOlderThan(tier Tier, d time.Duration) (int, error) + func (s *Store) DeleteSummariesOlderThan(d time.Duration) (int, error) + func (s *Store) Get(id string) (*Block, error) + func (s *Store) List(tier Tier) ([]Block, error) + func (s *Store) ListSummaries() ([]Summary, error) + func (s *Store) Path() string + func (s *Store) Promote(id string, target Tier) error + func (s *Store) PruneExpired() (int, error) + func (s *Store) SaveSummary(summary *Summary) error + func (s *Store) Search(query string) ([]Block, error) + func (s *Store) Stats() (*Stats, error) + type Summarizer struct + func NewSummarizer(cfg SummarizerConfig) *Summarizer + func (s *Summarizer) ExtractMemories(ctx context.Context, conv *conversations.Conversation) ([]Block, error) + func (s *Summarizer) SummarizeConversation(ctx context.Context, conv *conversations.Conversation) (*Summary, error) + type SummarizerConfig struct + APIKey string + BaseURL string + Model string + Provider string + type Summary struct + Content string + ConversationID string + CreatedAt time.Time + IndexNames []string + MessageCount int + Model string + Title string + type Tier string + const TierLong + const TierMedium + const TierShort + func ParseTier(s string) (Tier, error)