Memory System (OpenClaw)

Memory System (OpenClaw)

OpenClaw memory is plain Markdown on disk — no hidden state, fully auditable.

File layout

File Role Loaded when
MEMORY.md Long-term facts and preferences Every session
memory/YYYY-MM-DD.md Daily notes Today + yesterday, automatically
DREAMS.md Dream diary / consolidation summaries Optional

Agent-facing tools

Tool Purpose
memory_search Semantic + keyword search across all notes
memory_get Read a specific file or line range

Search backends

Three pluggable backends:

Backend Description
Builtin SQLite + FTS5 + optional embeddings; zero dependencies; default
QMD Local-first sidecar; adds reranking and query expansion
Honcho AI-native; cross-session user modeling

With an embedding provider, every search is a hybrid of vector similarity and BM25 keyword matching (see Memory Search).

Lifecycle features

Automatic Memory Flush

Before Compaction, the framework reminds the agent to persist important context to memory files. Prevents critical information from being lost in a compaction event.

Dreaming

Background consolidation pass that promotes qualified short-term signals to MEMORY.md based on a scoring threshold and recall frequency. Runs asynchronously.

Grounded Backfill

Replays historical notes to inspect what would qualify as durable memory — without immediately promoting anything to MEMORY.md. Useful for auditing.

Memory Wiki Plugin

Compiles notes into a structured wiki vault with:

Relation to context assembly

Memory search is invoked as part of Context Assembly (phase 3 of the agent loop) to populate the hybrid memory section of the system prompt. The agent also calls memory_search / memory_get directly during a turn when it needs to recall specific facts.

See also