Skip to main content

Module memory

Module memory 

Source
Expand description

File-based memory mechanism.

When the SQLite memory tools are disabled (memory_mode = "file"), the agent keeps long-term memory in Markdown files under the memory directory: a master memory.md plus daily memory-YYYY-MM-DD.md files. This module resolves the memory settings and builds the {memory_section} injected into the system prompt: the mechanism explanation plus the current master file content (bounded by MAX_MEMORY_INJECT_BYTES, truncated beyond that).

Structs§

MemorySettings
Memory settings for one Agent construction.

Constants§

MAX_MEMORY_INJECT_BYTES
Upper bound for the master memory file content injected into the system prompt. Larger files are truncated with a note pointing at read.

Functions§

build_memory_section
Build the {memory_section} text for the system prompt.
resolve_memory_settings
Resolve memory settings from config. Called by frontends when constructing an Agent.