Documentation
¶
Overview ¶
Package memory gives the agent persistent, file-backed long-term memory. Each memory is a markdown file with YAML frontmatter (name / description / type) in a memory directory; a MEMORY.md index lists them. The agent recalls memories relevant to a query and records new ones via tools, and relevant memories can be auto-injected into the conversation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecallTool ¶
RecallTool lets the agent read memories relevant to a query.
func RecordTool ¶
RecordTool lets the agent persist a durable fact to memory.
func RenderForInjection ¶
RenderForInjection formats memories as context to inject before a user turn.
Types ¶
type Memory ¶
type Memory struct {
Name string
Description string
Type Type
Content string
Path string
ModTime time.Time
}
Memory is a single stored fact.
type Store ¶
type Store struct {
Dir string
}
Store is a memory directory.
func (*Store) Index ¶
Index returns the MEMORY.md content (an index of memories), building it from a scan if the file is absent.
func (*Store) Relevant ¶
Relevant returns up to max memories scored against the query (keyword match on name/description/content), most relevant first, recency breaking ties.
func (*Store) SystemSegment ¶
SystemSegment renders the memory index for inclusion in the system prompt so the agent knows what it remembers and can RecallMemory for details.