How OpenClaw Memory ACTUALLY Works (4 Memory Layers)
Video summary
Companion notes
## Bootstrap Files Are Your Only Durable Memory OpenClaw's permanent identity lives in bootstrap files loaded from disk at every session start. Defaults are 20,000 characters per file / 150,000 characters total; anything over gets truncated. The creator's own bot Loki blew past the cap because soul.md ran 100+ lines, and parallel sub-agents only read agents.md and tools.md — that's why they feel personality-less. Keep soul.md to 15–30 lines. Skills .md files are a separate ecosystem, injected on demand rather than every session.
## Session Transcript = Full History, Summarized in Context Every message is dumped to disk (often as scrambled SQLite in .openclaw/memory), but the model only sees a summary once auto-compaction fires. The trigger math: context_limit − reserve_tokens − soft_threshold — for a 200K window that's 200,000 − 40,000 − 4,000 = 156,000, not 200K. The last 20,000 tokens stay intact; everything older becomes a summary. This is why the creator's Discord user SummerU (Safety & Alignment, Meta Superintelligence Labs) watched her OpenClaw bulk-delete emails — the "don't delete" rule lived in chat and was summarized away.
## Context Window Is Fixed-Size and Tool-Heavy Claude Opus/Sonnet: 200K tokens (~150K words, ~300 pages). GPT-4: 128K. Gemini Pro: 1M. Tool results — file reads, web snapshots, API responses — are the biggest consumers, not chat. Tip: for YouTube analysis, copy the transcript to a .rtf and upload it directly. The creator claims this saves ~95% of tokens versus feeding the link through a transcript API.
## Retrieval Index = Hybrid Search Over Memory Files OpenClaw indexes memory.md / memory directory and exposes a two-step memory_search → memory_get flow using keyword + semantic matching. Evergreen trading rules live inside the memory directory; scraped World Monitor news gets offloaded to Obsidian + GitHub so the index stays lean.
## When Memory "Breaks," Check the Layer The creator teases a follow-up: three failure modes (injection, path/folder structure, search) and config fixes — not covered here.
Watch on YouTube
Prefer the native player? Open it on YouTube: https://www.youtube.com/watch?v=HM0ATQCHGP0
