Skip to main content

Module file_memory

Module file_memory 

Source
Expand description

File-based memory (C1, v0.22.1 §S4): memories are real, inspectable files.

Many agent memory systems model “memory” as an opaque serialized blob. C1 takes the opposite approach: each memory is a plain NAME.md file under a single root directory. This gives the model (and a human auditor) a first-class editing surface — view, create, append, str_replace, rename, delete — mirroring the model editing tools that frontier agents expose, but as a deterministic library primitive, not a tool-calling loop.

§Path safety

Because the memory name arrives from the model, every operation funnels through validated_name, which rejects traversal (..), absolute paths, separators (/, \), drive letters (:), leading/trailing whitespace, and Windows reserved device names. The store root is canonicalized at construction, so no name can escape it. The .md suffix is appended by the store, never by the caller.

Decay / forgetting (TTL + importance) is layered on top in super::decay.

Structs§

FileMemoryStore
A deterministic, path-sandboxed collection of memory files under one root directory.
MemoryEntry
A memory file on disk, ready for inspection.

Enums§

FileMemoryError
Errors from FileMemoryStore operations.