Documentation
¶
Overview ¶
Package local implements Leros built-in file-backed memory.
Index ¶
- Constants
- func DefaultMemoryRoot() (string, error)
- func ReadEntries(path string) ([]string, error)
- type EntrySet
- type Options
- type Result
- type Store
- func (s *Store) Add(ctx context.Context, target string, content string) (*Result, error)
- func (s *Store) BuildPromptBlock(ctx context.Context) (string, error)
- func (s *Store) Load(ctx context.Context, target string) (*EntrySet, error)
- func (s *Store) Remove(ctx context.Context, target string, oldText string) (*Result, error)
- func (s *Store) Replace(ctx context.Context, target string, oldText string, newContent string) (*Result, error)
- func (s *Store) RootDir() string
Constants ¶
View Source
const ( // TargetMemory stores worker facts, environment notes, and durable lessons. TargetMemory = "memory" // TargetUser stores user preferences and profile facts. TargetUser = "user" // TargetProjectMemory stores project-level persistent memory. TargetProjectMemory = "project_memory" )
View Source
const (
// EntryDelimiter separates individual memory entries within a file.
EntryDelimiter = "\n§\n"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultMemoryRoot ¶
DefaultMemoryRoot returns the workspace memory directory.
func ReadEntries ¶
ReadEntries reads and parses memory entries from a file.
Types ¶
type EntrySet ¶
type EntrySet struct {
Target string `json:"target"`
Entries []string `json:"entries"`
Usage string `json:"usage"`
EntryCount int `json:"entry_count"`
}
EntrySet is the live memory state for one target.
type Result ¶
type Result struct {
Success bool `json:"success"`
Message string `json:"message,omitempty"`
Target string `json:"target,omitempty"`
Entries []string `json:"entries,omitempty"`
Usage string `json:"usage,omitempty"`
EntryCount int `json:"entry_count,omitempty"`
Error string `json:"error,omitempty"`
Matches []string `json:"matches,omitempty"`
MemoryRoot string `json:"memory_root,omitempty"`
MemoryFile string `json:"memory_file,omitempty"`
}
Result is returned from mutating memory operations.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store persists compact curated memories to USER.md and MEMORY.md.
func (*Store) BuildPromptBlock ¶
BuildPromptBlock renders the current memory snapshot for system prompt injection.
Click to show internal directories.
Click to hide internal directories.