Your personal memory, across sessions, agents, and devices.

OpenClaw Memory: How It Works and Where It Falls Short

memU Team memU Team

OpenClaw memory is a set of Markdown files in the agent's workspace, plus a search index built over them. If you run OpenClaw as a personal assistant, those files decide what it still knows tomorrow. Some files load at session start, and the rest are searched on demand. Compaction decides what survives a long chat. The design stops at the workspace, so Claude Code or Codex never see what OpenClaw learned. Facts come from the OpenClaw docs as read on October 28, 2026.

What is OpenClaw memory, in one sentence?

OpenClaw memory is plain Markdown in the agent workspace, which the agent writes and later finds again through a hybrid keyword and vector search index.

The docs say the model "only remembers what gets saved to disk," and there is no hidden state. OpenClaw itself is an MIT-licensed, open-source assistant that runs on your own computer. You talk to it through chat apps such as WhatsApp and Telegram. The repository showed about 393,000 GitHub stars when we checked.

Because memory is files, you can open it in an editor and delete a wrong line when the agent remembers something false. You can also keep the folder under version control.

How does OpenClaw memory differ from a plain chat history?

A chat transcript and OpenClaw's memory files do different jobs. The transcript records everything. The memory files hold what the agent decided to keep.

Session transcript Memory files (MEMORY.md, daily notes) Search index
What it holds Every message and tool call Curated facts and daily notes Chunks of the memory files, as keywords and vectors
Who writes it OpenClaw, automatically The agent, during a session or a pre-compaction flush OpenClaw, from the files
Loaded at session start? No, only the current session MEMORY.md and USER.md yes. Today's and yesterday's notes on a bare /new or /reset No, it is queried on demand
Survives compaction? Yes, on disk. The model sees only a summary Yes Yes
Can you edit it? Not meant for editing Yes, plain Markdown Rebuilt from the files

Sources: the OpenClaw memory overview and compaction docs.

How does OpenClaw store memory?

Everything lives in the agent workspace, which defaults to ~/.openclaw/workspace. The memory overview lists these files:

  • MEMORY.md holds curated long-term facts and decisions.
  • USER.md is optional. It holds stable preferences and profile directives, with its own small load budget.
  • memory/YYYY-MM-DD.md files are daily notes and raw context. They are indexed but not injected on every turn.
  • DREAMS.md is an optional diary written by the dreaming feature for human review.

MEMORY.md loads at the start of every session. Past the bootstrap budget, OpenClaw truncates the copy it injects. The file on disk keeps every line. Long memory files therefore cost you twice: tokens on every session, and silent cuts once they pass the limit. The docs suggest checking sizes with /context list or openclaw doctor.

OpenClaw can also import history from other agents, including Codex and Claude Code. Imports land in memory/imports/ and are kept apart from MEMORY.md.

How does OpenClaw search its memory?

The default memory plugin is memory-core. It gives the agent two tools. memory_search runs a semantic and keyword search. memory_get reads one file or a line range. The default search is hybrid: vector similarity plus keyword matching.

The builtin engine is SQLite, with no extra dependencies. The memory-core plugin also supports PostgreSQL. Honcho and LanceDB come as plugins. Embeddings default to OpenAI. The memory.search.provider setting switches to other providers, including a local GGUF model.

Two features build on this. Dreaming is on by default. It runs a scheduled sweep over recent notes and scores each candidate on how often it was recalled. Candidates that pass get promoted into MEMORY.md. Active Memory is a deeper recall step for questions about the past. By default it calls a recall sub-agent only when the fast lookup finds no strong match. You turn it on per agent as a setup step.

A bundled memory-wiki plugin can compile durable knowledge into wiki pages that track evidence for each claim. It is off until you run openclaw plugins enable memory-wiki.

What happens to memory when OpenClaw compacts a session?

A long chat eventually fills the model's context window. OpenClaw then compacts: it condenses older turns into a summary and keeps recent messages intact. This happens automatically near the limit or after a context-overflow error. You can also run /compact with a focus, such as "/compact Focus on the API design decisions."

The full transcript stays on disk, and the model works from the summary. The summarizer reads at most about 40,000 tokens of input, so the oldest and middle messages are sampled. Long tool results are cut to their start and end. Images become text markers. When a summary degrades, the docs warn that older details and pending requests may leave the model's context.

OpenClaw softens this with a memory flush. Before compacting, it runs a silent turn that asks the agent to save important context to the daily note. The flush is on by default. It is skipped in read-only sandboxes, and a failed flush does not block compaction. Write important facts to a memory file early, because the flush only saves what the agent chooses to save.

What does OpenClaw do out of the box with agents, automations and memory?

Out of the box you get the memory files and memory-core with SQLite search. The flush and dreaming described above are on too. Scheduled work runs through automations, with openclaw cron kept as an alias. The Gateway stores each job and wakes the agent at the set time. It can post the output to a chat channel or a webhook. A job can run in the main session or in an isolated fresh one.

This matters for memory because a job in a fresh session starts with only what the memory files provide. A daily report job that needs last week's decisions can only find them in MEMORY.md or through the search tool, since it cannot read another chat's history.

Where does OpenClaw memory fall short?

Our view, after reading the docs: the design works well for one assistant on one machine. It has four limits.

  1. It stops at the workspace. Imports from Codex and Claude Code flow one way, into OpenClaw. Claude Code in a repository reads its own CLAUDE.md and memory. OpenClaw's MEMORY.md is invisible to it, so two agents learn the same preferences separately.
  2. Recall depends on the agent writing things down. The docs are explicit that unsaved context is gone once it leaves the window. A missed flush or a vague note means the fact is lost from working memory.
  3. MEMORY.md has a budget. A fact below the cutoff stays in the file but never reaches the model.
  4. Tuning takes work. Embeddings and the search engine are configured separately from dreaming and compaction.

The bottom line

Treat OpenClaw memory as a folder of Markdown you own, and keep MEMORY.md short enough to fit the bootstrap budget (check with /context list). Leave the pre-compaction flush on and run /compact with a focus before a long session drifts. If you also code with Claude Code or Codex, plan for a memory layer that those agents can read too.

How do you share OpenClaw memory with Claude Code and Codex?

OpenClaw's memory files are read by OpenClaw alone. Claude Code in your terminal never sees a preference you taught OpenClaw on Telegram. Codex keeps its own AGENTS.md and session history. You end up writing the same preference into MEMORY.md, CLAUDE.md and AGENTS.md.

memU is a lightweight, agent-driven memory system. It keeps one shared wiki of Markdown that works across agents and devices. It ships an OpenClaw adapter.

On the record side, a scheduled background task reads new OpenClaw sessions from its SQLite store and slices them into jobs. The agent decides what is worth keeping and writes memory or skill Markdown, which memU commits. On the inject side, memU adds a standing instruction to the workspace AGENTS.md that tells the agent to retrieve before answering. memU makes no LLM calls of its own and only stores and retrieves what the agent wrote.

Claude Code and Codex bind to the same backend, so what OpenClaw learned is retrievable from them. The support matrix lists OpenClaw on all three desktop systems. Retrieval on macOS is marked as not yet verified.

To try the hosted version, which is free and syncs across devices, get an API key from memu.so and send your agent one message:

Read https://memu.pro/SKILL.md, follow its instructions to install and configure memU, API Key is YOUR_MEMU_API_KEY.

The self-hosted setup is in the memU GitHub repository, released under Apache-2.0. For the reasoning behind leaving judgment to the agent, see why memU gives memory back to the agent.

FAQ

Does OpenClaw have persistent memory?

Yes. OpenClaw saves memory as Markdown files in its workspace, mainly MEMORY.md plus one daily note per date. MEMORY.md loads at every session start, and the rest is reachable through the memory search tool.

Where does OpenClaw store its memory files?

In the agent workspace, which defaults to ~/.openclaw/workspace. Long-term facts go in MEMORY.md and daily notes go in the memory folder as one file per date.

The builtin engine is SQLite with hybrid keyword and vector search. PostgreSQL works through the default memory-core plugin. Honcho and LanceDB are available as plugins.

Does OpenClaw lose memory when it compacts a conversation?

The full transcript stays on disk, but the model then sees only a summary plus recent messages. OpenClaw runs a memory flush first so the agent can save important context to its daily note.

Can Claude Code read OpenClaw's memory?

Not by default. Claude Code reads its own CLAUDE.md and memory files. A shared layer such as memU, with adapters for both, lets them retrieve from one store.