You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The memory module provides persistent, structured storage for agent knowledge across runs. It manages four distinct concerns: tagged memory entries (catalog), failure experience cards, live pinned-file context, and team-shared markdown notes.
Behavior Contract
MemoryCatalog (memory/catalog.py)
Guarantee
Detail
Append-only writes
add() always appends a new JSONL line; it never overwrites or re-sorts existing entries
Content non-empty
add() raises ValueError('memory content cannot be empty') if content strips to ''
Readonly enforcement
All mutating operations (add, add_quarantined, delete_*, quarantine_*) raise RuntimeError('Cannot … in readonly mode') when readonly=True
Tag normalization
Tags are always lowercased, stripped, deduplicated, and sorted before storage
Search never returns empty for missing file
list() and search() return [] if the backing file does not exist — no exception
Show raises FileNotFoundError
show(memory_id) raises FileNotFoundError if memory_id is not found
Delete is atomic
delete_by_branch and delete_by_run_id in memory/catalog.py use os.replace() via _atomic_write_entries() for crash-safe rewrites
Cross-process locking
memory/catalog.py wraps delete_* and quarantine_* in _cross_process_lock() using fcntl.flock(LOCK_EX)
Quarantined entries isolated
Quarantined entries are written to memory-quarantine.jsonl, never to the active memory.jsonl