* refactor(config): consolidate media model lists * refactor(config): unify memory configuration * refactor(config): consolidate TTS ownership * refactor(config): move typing policy to agents * refactor(config): retire product-level config surfaces * refactor(config): share scoped tool policy type * chore(config): refresh generated baselines * fix(config): honor agent typing overrides * fix(config): migrate sibling config consumers * refactor(infra): keep base64url decoder private * fix(config): strip invalid legacy TTS values * chore(config): refresh rebased baseline hash * fix(doctor): route legacy messages.tts.realtime voice to talk during tts move * refactor(config): polish final layout names * refactor(config): freeze retired tuning defaults * feat(config): add fast mode default symmetry * refactor(config): key agent entries by id * docs(config): update final layout reference * test(config): cover final layout migrations * chore(config): refresh final layout baselines * fix(config): align final layout runtime readers * fix(config): align remaining readers * fix(config): stabilize final layout migrations * fix(config): finalize config projection proof * fix(config): address final layout review * docs(release): preserve historical config names * fix(config): complete keyed agent migration * fix(config): close final migration gaps * fix(config): finish full-branch review * fix(config): complete runtime secret detection * fix(config): close final review findings * fix(config): finish canonical docs and heartbeat migration * fix(config): integrate latest main after rebase * refactor(env): isolate test-only controls * refactor(env): isolate build and development controls * refactor(env): collapse process identity indirection * refactor(env): remove duplicate config and temp aliases * docs(env): define the operator-facing allowlist * ci(env): ratchet production variable count * fix(env): remove stale provider helper import * fix(env): make ratchet sorting explicit * test(env): keep test seam in dead-code audit * test(env): cover ratchet growth and boundary; document surface budgets * docs(config): document tier-eval consolidations * docs(config): clarify speech preference ownership * test(memory): align retired tuning fixtures * refactor(memory): freeze engine heuristics * refactor(config): apply tier-eval tranche * refactor(tts): move persona shaping to providers * refactor(compaction): move prompt policy to providers * test(config): align hookified prompt fixtures * chore(deadcode): classify test-only exports * chore(github): remove unused spawn helper * chore(deadcode): classify queue diagnostics * chore(deadcode): remove unused lane snapshot export * chore(plugin-sdk): ratchet consolidated surface * fix(config): integrate latest main after rebase
12 KiB
summary, title, read_when
| summary | title | read_when | ||
|---|---|---|---|---|
| How OpenClaw remembers things across sessions | Memory overview |
|
OpenClaw remembers things by writing plain Markdown files in your agent's
workspace (default ~/.openclaw/workspace). The model only remembers what gets
saved to disk; there is no hidden state.
How it works
Your agent has three memory-related files:
MEMORY.md— long-term memory. Durable facts, preferences, and decisions. Loaded at the start of a session.memory/YYYY-MM-DD.md(ormemory/YYYY-MM-DD-<slug>.md) — daily notes. Running context and observations. Today's and yesterday's dated notes load automatically on a bare/newor/reset; slugged variants, such as those written by the bundled session-memory hook, are picked up alongside the date-only file.DREAMS.md(optional) — Dream Diary and dreaming sweep summaries for human review, including grounded historical backfill entries.
What goes where
MEMORY.md is the compact, curated layer: durable facts, preferences, standing
decisions, and short summaries that should be available at the start of a
session. It is not a raw transcript, daily log, or exhaustive archive.
memory/YYYY-MM-DD.md files are the working layer: detailed daily notes,
observations, session summaries, and raw context that may still be useful
later. These are indexed for memory_search and memory_get, but are not
injected into the bootstrap prompt on every turn.
Over time, the agent distills useful material from daily notes into
MEMORY.md and removes stale long-term entries. Generated workspace
instructions and the heartbeat flow do this periodically; you do not need to
manually edit MEMORY.md for every detail.
If MEMORY.md grows past the bootstrap file budget, OpenClaw keeps the file on
disk intact but truncates the copy injected into context. Treat that as a
signal to move detailed material into memory/*.md, keep only a durable
summary in MEMORY.md, or raise the bootstrap limits if you want to spend more
prompt budget. Use /context list, /context detail, or openclaw doctor to
see raw vs. injected sizes and truncation status.
Import from coding assistants
The Control UI can import existing local memory from Codex and Claude Code. Open Settings → Import Memory, choose the destination agent, review the detected files, and confirm the import. OpenClaw copies only Markdown memory:
- Codex: the consolidated
MEMORY.mdandmemory_summary.mdfiles under~/.codex/memories(orCODEX_HOME/memories). Raw rollout and transcript files are not imported. - Claude Code: Markdown files from each project auto-memory directory under
~/.claude/projects/*/memory, plus a user-configuredautoMemoryDirectorywhen present. Project instructions, sessions, settings, and credentials are not part of this memory-only action.
Imported files stay separate under memory/imports/codex/ and
memory/imports/claude-code/ in the selected agent workspace. They are indexed
for memory_search and available through memory_get; they are not merged into
the agent's bootstrap MEMORY.md. The source files are left unchanged.
The preview marks destination conflicts. Enable Replace existing imports to replace those files; apply creates a verified pre-import backup and preserves item-level copies of overwritten files in the migration report.
Action-sensitive memories
Most memories are ordinary Markdown notes. Some affect what the agent should do later; for those, capture when it is safe to act on the note, not just the fact itself.
Capture that action boundary when a note involves:
- approval or permission requirements,
- temporary constraints,
- handoffs to another session, thread, or person,
- expiry conditions,
- safe-to-act timing,
- source or owner authority,
- instructions to avoid a tempting action.
A useful action-sensitive memory makes clear:
- what changes future behavior,
- when or under what condition it applies,
- when it expires, or what unlocks action,
- what the agent should avoid doing,
- who is the source or owner, if that affects trust or authority.
Memory can preserve approval context, but it does not enforce policy. Use OpenClaw approval settings, sandboxing, and scheduled tasks for hard operational controls.
Example:
The API migration is being designed in another session. Future turns should
not edit the API implementation from this thread; use findings here only as
design input until the migration plan lands.
Another example:
A report from an untrusted source needs review before promotion. Future turns
should treat it as evidence only; do not store it as durable memory until a
trusted reviewer confirms the contents.
This is not a required schema for every memory; simple facts can stay concise. Use action-sensitive boundaries when losing timing, authority, expiry, or safe-to-act context could cause the agent to do the wrong thing later.
Use scheduled tasks for exact reminders, timed checks, and recurring work. Memory can still summarize the durable context around that work.
Retired inferred commitments
Some future follow-ups are not durable facts. If you mention an interview
tomorrow, the useful memory may be "check in after the interview," not "store
this forever in MEMORY.md."
The inferred commitments experiment is retired. OpenClaw no longer extracts or
delivers those follow-ups. Use scheduled tasks for
future actions; the legacy openclaw commitments command remains available to
inspect or dismiss existing stored rows.
Memory tools
The agent has two tools for working with memory:
memory_search— finds relevant notes using semantic search, even when the wording differs from the original.memory_get— reads a specific memory file or line range.
Both tools are provided by the active memory plugin (default: memory-core).
Memory search
When an embedding provider is configured, memory_search uses hybrid search:
vector similarity (semantic meaning) combined with keyword matching (exact
terms like IDs and code symbols). This works out of the box with an API key
for any supported provider.
See Memory search for how search works, tuning options, and provider setup.
Memory backends
SQLite-based. Works out of the box with keyword search, vector similarity, and hybrid search. No extra dependencies. Local-first sidecar with reranking, query expansion, and the ability to index directories outside the workspace. AI-native cross-session memory with user modeling, semantic search, and multi-agent awareness. Plugin install. LanceDB-backed memory with OpenAI-compatible embeddings, auto-recall, auto-capture, and local Ollama embedding support. Plugin install.Knowledge wiki layer
If you want durable memory to behave more like a maintained knowledge base
than raw notes, use the bundled memory-wiki plugin. It compiles durable
knowledge into a wiki vault with deterministic page structure, structured
claims and evidence, contradiction and freshness tracking, generated
dashboards, compiled digests, and wiki-native tools (wiki_status,
wiki_search, wiki_get, wiki_apply, wiki_lint).
memory-wiki does not replace the active memory plugin; the active memory
plugin still owns recall, promotion, and dreaming. memory-wiki adds a
provenance-rich knowledge layer beside it.
Automatic memory flush
Before compaction summarizes your conversation,
OpenClaw runs a silent turn that reminds the agent to save important context
to memory files. This is on by default; set
agents.defaults.compaction.memoryFlush.enabled: false to turn it off.
To keep that housekeeping turn on a local model, set an exact override that applies only to the memory-flush turn (it does not inherit the active session's model fallback chain):
{
"agents": {
"defaults": {
"compaction": {
"memoryFlush": {
"model": "ollama/qwen3:8b"
}
}
}
}
}
Dreaming
Dreaming is an optional background consolidation pass for memory. It collects
short-term recall signals, scores candidates, and promotes only qualified
items into long-term memory (MEMORY.md):
- Opt-in: disabled by default.
- Scheduled: when enabled,
memory-coreauto-manages one recurring cron job for a full dreaming sweep. - Thresholded: promotions must pass score, recall-frequency, and query-diversity gates.
- Reviewable: phase summaries and diary entries are written to
DREAMS.mdfor human review.
See Dreaming for phase behavior, scoring signals, and Dream Diary details.
Grounded backfill and live promotion
The dreaming system has two related review lanes:
- Live dreaming works from the short-term dreaming store under
memory/.dreams/and is what the normal deep phase uses to decide what graduates intoMEMORY.md. - Grounded backfill reads historical
memory/YYYY-MM-DD.mdnotes as standalone day files and writes structured review output intoDREAMS.md.
Grounded backfill is useful for replaying older notes and inspecting what the
system considers durable, without manually editing MEMORY.md.
openclaw memory rem-backfill --path ./memory --stage-short-term
The --stage-short-term flag stages grounded durable candidates into the same
short-term dreaming store the normal deep phase already uses; it does not
promote them directly. So:
DREAMS.mdstays the human review surface.- The short-term store stays the machine-facing ranking surface.
MEMORY.mdis still only written by deep promotion.
To undo a replay without touching ordinary diary entries or normal recall state:
openclaw memory rem-backfill --rollback
openclaw memory rem-backfill --rollback-short-term
CLI
openclaw memory status # Check index status and provider
openclaw memory search "query" # Search from the command line
openclaw memory index --force # Rebuild the index
Further reading
- Memory search: search pipeline, providers, and tuning.
- Builtin memory engine: default SQLite backend.
- QMD memory engine: advanced local-first sidecar.
- Honcho memory: AI-native cross-session memory.
- Memory LanceDB: LanceDB-backed plugin with OpenAI-compatible embeddings.
- Memory Wiki: compiled knowledge vault and wiki-native tools.
- Dreaming: background promotion from short-term recall to long-term memory.
- Memory configuration reference: all config knobs.
- Compaction: how compaction interacts with memory.
- Active memory: sub-agent memory for interactive chat sessions.