Let me show you what's happening under the hood. OpenClaw stores a per-agent SQLite database at ~/.openclaw/memory/. This database has 5 core tables that index the content from your Markdown files. The tables track individual memory entries, their source files, embedding vectors, full-text search tokens, and metadata like creation timestamps.
When you write to MEMORY.md or a daily file, the sync process splits the content into chunks, generates embeddings, and updates the index. Reads always go through SQLite for speed, but writes always go to the Markdown files first. If the database ever gets corrupted, OpenClaw rebuilds it from the files on next startup.