Documentation
¶
Overview ¶
Package memories implements a persistent memory system for project context. Memories are stored as markdown files with YAML frontmatter under ~/.celeste/projects/<hash>/memories/.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ValidTypes = []string{"user", "feedback", "project", "reference"}
ValidTypes lists the allowed memory types.
Functions ¶
func CheckStaleness ¶
CheckStaleness returns how many days old a memory is and a warning string. If the memory is fresh (< 7 days), the warning is empty.
func IsValidType ¶
IsValidType checks if a type string is a valid memory type.
func ShouldVerify ¶
ShouldVerify returns true if a memory is older than 7 days.
Types ¶
type Index ¶
type Index struct {
// contains filtered or unexported fields
}
Index manages the MEMORY.md file that summarizes all memories for system prompt injection.
func (*Index) Add ¶
func (idx *Index) Add(entry IndexEntry) error
Add adds an entry to the index. If an entry with the same name exists, it is replaced.
func (*Index) Entries ¶
func (idx *Index) Entries() []IndexEntry
Entries returns a copy of the index entries.
type IndexEntry ¶
IndexEntry represents a single entry in the MEMORY.md index.
type Memory ¶
type Memory struct {
Name string `yaml:"name"`
Description string `yaml:"description"`
Type string `yaml:"type"` // user, feedback, project, reference
Created string `yaml:"created"`
Project string `yaml:"project"`
Content string `yaml:"-"` // everything after frontmatter
}
Memory represents a single memory entry with frontmatter metadata and content.
func ParseMemory ¶
ParseMemory parses a markdown file with YAML frontmatter into a Memory. Frontmatter is delimited by "---" lines.
type MemoryCandidate ¶
type MemoryCandidate struct {
Type string `json:"type"` // feedback, project, user, reference
Content string `json:"content"` // the extracted content
Reason string `json:"reason"` // why this was flagged
}
MemoryCandidate represents a potential memory extracted from conversation.
func ExtractCandidates ¶
func ExtractCandidates(userMsg, assistantMsg string) []MemoryCandidate
ExtractCandidates analyzes a user message and assistant response for potential memories to save.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store manages memory files on disk under a project-specific directory.
func NewStore ¶
NewStore creates a Store for the given project directory. It derives a hash-based path under ~/.celeste/projects/<hash>/memories/.
func NewStoreWithBase ¶
NewStoreWithBase creates a Store with an explicit base directory (useful for testing).
func (*Store) ListByType ¶
ListByType returns all memories of a given type.