Install
openclaw skills install fractal-memoryAutomated hierarchical memory compression system that prevents context overflow through daily→weekly→monthly→core compression. Use when you need (1) long-ter...
openclaw skills install fractal-memoryAutomated hierarchical memory compression that prevents context overflow. Like human sleep, compress raw experience into patterns, patterns into principles—keeping essence while managing scale.
Memory is not accumulation — it is compression with intention.
Each layer compresses the one below without losing essence:
Conversation → Daily → Weekly → Monthly → Core Memory
↓
Timeless Facts (sticky-notes)
mkdir -p memory/diary/{2026/{daily,weekly,monthly},sticky-notes/{workflows,apis,commands,facts}}
Copy templates from assets/:
cp assets/rollup-state.json memory/
cp assets/heartbeat-state.json memory/
Copy all scripts from scripts/ to your workspace scripts/ directory:
cp scripts/*.py ~/.openclaw/workspace/scripts/
chmod +x ~/.openclaw/workspace/scripts/*.py
See references/cron-setup.md for detailed cron configuration.
Quick version:
Add to your AGENTS.md:
## Every Session
1. Read `SOUL.md`
2. Read `USER.md`
3. Read `memory/diary/YYYY/daily/YYYY-MM-DD.md` (today + yesterday)
4. **If in MAIN SESSION**: Also read `MEMORY.md`
**Context loading order:** TODAY → THIS WEEK → THIS MONTH → MEMORY.md
Creates today's daily log if it doesn't exist. Run this in heartbeats or at session start.
python3 scripts/ensure_daily_log.py
Append events to today's daily log programmatically.
python3 scripts/append_to_daily.py "Event description"
Compress today's diary into this week's summary. Runs automatically at 23:59 daily.
python3 scripts/rollup-daily.py
Compress this week's summary into this month's summary. Runs automatically at 23:59 every Sunday.
python3 scripts/rollup-weekly.py
Distill this month's summary into MEMORY.md. Runs automatically at 23:59 on the last day of each month.
python3 scripts/rollup-monthly.py
Check memory system integrity and detect anomalies.
python3 scripts/verify_memory_integrity.py
Write to memory/diary/YYYY/daily/YYYY-MM-DD.md immediately. Don't rely on memory—write it down.
Extract patterns, decisions, key events → append to memory/diary/YYYY/weekly/YYYY-Wnn.md
Compress to themes, trajectory, milestones → append to memory/diary/YYYY/monthly/YYYY-MM.md
Distill major themes, lessons learned → update MEMORY.md
Extract facts that recur 3+ times → store in memory/diary/sticky-notes/{category}/
"Mental notes" don't survive session restarts. Files do.
Files that grow forever become unreadable. Extract patterns, discard noise.
Not everything deserves to persist. Keep what defines you, release what doesn't.
Scripts handle rollups so you don't have to remember.
Load memory in this order for attention optimization:
memory/diary/YYYY/daily/YYYY-MM-DD.mdmemory/diary/YYYY/weekly/YYYY-Wnn.mdmemory/diary/YYYY/monthly/YYYY-MM.mdWhy this order? Primacy + recency optimization. Most recent first, highest level early.
Memory systems create attack surface. The system includes:
verify_memory_integrity.py detects tamperingRun integrity checks periodically:
python3 scripts/verify_memory_integrity.py
Migrating from existing memory systems? See references/migration-guide.md for:
Run ensure_daily_log.py manually or add to heartbeat checks.
Check cron job runs: cron(action="runs", jobId="<job-id>")
memory/rollup-state.json)chmod +x scripts/*.py
Modify cron expressions in references/cron-setup.md
Add custom categories in memory/diary/sticky-notes/:
mkdir memory/diary/sticky-notes/my-category
Run rollup scripts manually anytime:
python3 scripts/rollup-daily.py
python3 scripts/rollup-weekly.py
python3 scripts/rollup-monthly.py
For deep dive into system design, philosophy, and implementation details, see references/architecture.md.
"What grows from chaos is structure. What emerges from structure is memory. What persists through memory is self." — Deva