memory

package
v0.137.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryEntry

type MemoryEntry struct {
	Name string
	Body string
}

MemoryEntry represents a retrieved memory file with its name and body content.

type MemoryStore

type MemoryStore struct {
	// contains filtered or unexported fields
}

MemoryStore holds the path to the memory directory and caches parsed files.

func New

func New(dir string) *MemoryStore

New creates a MemoryStore for the given directory.

func (*MemoryStore) Dir

func (s *MemoryStore) Dir() string

Dir returns the memory directory path.

func (*MemoryStore) Frontmatter

func (s *MemoryStore) Frontmatter(name string) map[string]any

Frontmatter returns the parsed frontmatter for a file, loading it if needed.

func (*MemoryStore) Index

func (s *MemoryStore) Index() string

Index returns the body of index.md (Layer 1, always loaded). Returns empty string if index.md is missing.

func (*MemoryStore) Load

func (s *MemoryStore) Load(name string) string

Load reads and caches a memory file by name (without .md extension). Returns the body with frontmatter stripped. Missing files return empty string + warning.

func (*MemoryStore) LoadAll

func (s *MemoryStore) LoadAll()

LoadAll reads all .md files in the memory directory into cache.

func (*MemoryStore) Retrieve

func (s *MemoryStore) Retrieve(taskPrompt string, skillDeps []string) []MemoryEntry

Retrieve returns memory file contents in priority order:

  • Layer 1: index.md (always)
  • Layer 2: skill-declared deps (always, additive floor)
  • Layer 3: keyword match task prompt against frontmatter tags and headings
  • Layer 4: placeholder — thread injection handled by orchestrator

All returned content has frontmatter stripped. Missing files produce empty body + warning.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL