๐Ÿ“ Memory System

How agents remember things โ€” daily journals, long-term memory, and security rules.

Architecture

Agents wake up fresh each session. Files ARE their memory. Mental notes don't survive restarts โ€” if you want to remember something, write it to a file.

๐Ÿ“… Daily Events
โ†’
๐Ÿ“„ Daily Journal
โ†’
๐Ÿ” Periodic Review
โ†’
๐Ÿง  MEMORY.md

Raw notes get captured daily. Every few days, significant items are promoted to long-term memory.

Daily Notes โ€” memory/YYYY-MM-DD.md

๐Ÿ“ Text > Brain. "Mental notes" don't survive session restarts. Files do. When someone says "remember this" โ†’ write to the daily file.

MEMORY.md โ€” Long-Term Memory

The curated, distilled essence โ€” not raw logs. Like a human's long-term memory versus their daily journal.

What Goes In

Rules

Memory Promotion

Periodically (every few days during heartbeats), agents review and distill:

  1. Read recent memory/YYYY-MM-DD.md files
  2. Identify significant events, lessons, or insights worth keeping
  3. Update MEMORY.md with distilled learnings
  4. Remove outdated info that's no longer relevant
  5. Think of it like reviewing a journal and updating your mental model

Daily files are raw notes. MEMORY.md is curated wisdom.

Dreaming Cycle

Agents have an automated dreaming system that runs during idle periods โ€” similar to how human sleep consolidates memories:

๐Ÿ“– Session Logs
โ†’
๐Ÿ’ก Light Sleep
โ†’
๐Ÿง  REM Sleep
โ†’
๐ŸŒ™ Deep Sleep

Output is stored in memory/dreaming/ with subdirectories light/, rem/, and deep/. Promoted items appear in MEMORY.md with <!-- openclaw-memory-promotion --> tags showing their source.

๐Ÿ”’ Security Rules

Private things stay private. Period.

Lessons Learned

When you make a mistake, document it so future-you doesn't repeat it: