Documentation
¶
Overview ¶
Package memory manages file-backed, cross-session long-term memory.
Index ¶
- Constants
- func StripCitations(value string) (string, []string)
- type CitationParser
- type Config
- type PipelineReport
- type Store
- func (s *Store) AddAdHocNamed(filename, note string) (string, error)
- func (s *Store) AddAdHocNote(slug, note string) (string, error)
- func (s *Store) AutoCapture(prompt string) (bool, error)
- func (s *Store) Clear() error
- func (s *Store) Configuration() Config
- func (s *Store) Configure(maxTokens int, autoCapture bool)
- func (s *Store) ConfigureAdvanced(configuration Config)
- func (s *Store) Forget(value string) error
- func (s *Store) Instructions() string
- func (s *Store) Read() (string, error)
- func (s *Store) RecordUsage(rolloutIDs []string)
- func (s *Store) Remember(value string) error
- func (s *Store) RememberWithSource(value, source string) error
- func (s *Store) Root() string
- func (s *Store) RunShutdown(ctx context.Context, modelProvider provider.Provider, sessions *session.Store, ...) (PipelineReport, error)
- func (s *Store) RunStartup(ctx context.Context, modelProvider provider.Provider, sessions *session.Store, ...) (PipelineReport, error)
- func (s *Store) StartStartup(ctx context.Context, modelProvider provider.Provider, sessions *session.Store, ...)
- func (s *Store) Status() string
- func (s *Store) StopStartup(ctx context.Context) error
- func (s *Store) Summary() (string, error)
- func (s *Store) Tools() []tool.Tool
Constants ¶
const ( ToolSearch = "memories_search" ToolRead = "memories_read" ToolList = "memories_list" ToolAdd = "memories_add_ad_hoc_note" )
Variables ¶
This section is empty.
Functions ¶
func StripCitations ¶
Types ¶
type CitationParser ¶
type CitationParser struct {
// contains filtered or unexported fields
}
CitationParser removes hidden memory citations across arbitrary stream chunk boundaries while retaining their rollout IDs for usage feedback.
func (*CitationParser) Finish ¶
func (p *CitationParser) Finish() (string, []string)
func (*CitationParser) Push ¶
func (p *CitationParser) Push(value string) string
type Config ¶
type Config struct {
Generate bool
Use bool
DedicatedTools bool
AutoCapture bool
SummaryTokens int
MaxRolloutsPerStartup int
MaxRolloutAgeDays int
MinRolloutIdleHours int
MaxRawMemoriesForConsolidation int
MaxUnusedDays int
ExtractModel string
ConsolidationModel string
}
Config controls generation and retrieval without coupling memory to one model provider. Empty model names use the active SuperCode model.
func DefaultConfig ¶
func DefaultConfig() Config
type PipelineReport ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
NewStore creates a directory-backed memory store. A historical memory.md path may be supplied for one-time migration into an ad-hoc note.
func (*Store) Clear ¶
Clear is an explicit hard reset retained for programmatic compatibility. It removes generated artifacts, source extracts, notes, generated Skills, metadata, and the private Git baseline. The TUI's /forget command uses Forget and therefore flows through Phase 2 instead.
func (*Store) Configuration ¶
func (*Store) Configure ¶
Configure retains the original API while mapping it onto summary injection and optional deterministic capture of explicit preference statements.
func (*Store) ConfigureAdvanced ¶
func (*Store) Forget ¶
Forget queues a user-authorized deletion or update request for the next global consolidation pass instead of editing generated MEMORY.md directly.
func (*Store) Instructions ¶
func (*Store) RecordUsage ¶
func (*Store) RememberWithSource ¶
func (*Store) RunShutdown ¶
func (s *Store) RunShutdown(ctx context.Context, modelProvider provider.Provider, sessions *session.Store, currentSessionID, activeModel string) (PipelineReport, error)
RunShutdown cancels and joins the background startup pass, then extracts the just-committed current root session without applying the startup idle cutoff. A redacted serialized-content hash provides the same idempotency guard used by startup passes, without treating a metadata-only session commit as new.
func (*Store) RunStartup ¶
func (*Store) StartStartup ¶
func (s *Store) StartStartup(ctx context.Context, modelProvider provider.Provider, sessions *session.Store, currentSessionID, activeModel string)
StartStartup launches the bounded pipeline for idle sessions. It intentionally does not block normal chat startup.
func (*Store) StopStartup ¶
StopStartup cancels and joins the optional background startup pipeline without starting extraction for a current session.