# How to Add Persistent Memory to OpenClaw

*MEMORY.md, Memory Plugins and MCP, and How to Share OpenClaw’s Memory with Every AI*

Published: 2026-11-06 · Author: Membase Team  
Source: https://membase.com/blog/openclaw-memory

> *Disclosure: Membase is our product. OpenClaw’s built-in memory is good, and for a single agent on one machine it may be all you need. We cover it first. Facts were checked against OpenClaw’s documentation in November 2026.*

## Quick answer

OpenClaw remembers by writing plain Markdown files in your agent’s workspace (by default ~/.openclaw/workspace). There’s no hidden state: the agent only remembers what’s saved to disk.

- **MEMORY.md** holds long-term facts and decisions, loaded at the start of every session.
- **USER.md** holds your preferences and profile.
- **memory/YYYY-MM-DD.md** files hold daily notes, searchable with memory_search.
- **Dreaming** moves the useful parts of daily notes into MEMORY.md in the background.

To swap or extend that memory, OpenClaw has a **memory plugin slot** and supports **MCP servers**. To give OpenClaw the same memory as Claude, ChatGPT and your coding agents, install the Membase plugin:

```bash
openclaw plugins install clawhub:@unibaseio/membase
```

**In this guide:** [How OpenClaw memory works](https://membase.com/blog/openclaw-memory#how-openclaw-memory-works) · [What goes where](https://membase.com/blog/openclaw-memory#what-goes-where) · [Memory tools](https://membase.com/blog/openclaw-memory#memory-tools) · [Dreaming and memory flush](https://membase.com/blog/openclaw-memory#dreaming-and-memory-flush) · [Where OpenClaw memory stops](https://membase.com/blog/openclaw-memory#where-openclaw-memory-stops) · [Memory plugins](https://membase.com/blog/openclaw-memory#openclaw-memory-plugins) · [Add memory with Membase](https://membase.com/blog/openclaw-memory#add-persistent-memory-to-openclaw-with-membase) · [Connect memory over MCP](https://membase.com/blog/openclaw-memory#connect-memory-over-mcp-instead) · [FAQ](https://membase.com/blog/openclaw-memory#faq)

## How OpenClaw memory works

Your agent has four memory files:

| File | What it holds | When it loads |
| --- | --- | --- |
| USER.md (optional) | Stable preferences, communication style, relationships, active projects, written as directives | Start of a session, with its own small budget |
| MEMORY.md | Long-term facts and standing decisions | Start of a session |
| memory/YYYY-MM-DD.md | Daily notes: running context and observations | Today’s and yesterday’s notes load on /new or /reset; older ones are searched |
| DREAMS.md (optional) | Dreaming summaries for you to review | Not loaded; for human review |

To save something, just ask: “Remember that I prefer TypeScript.” The agent writes it to the right file.

## What goes where

- **USER.md** is the compact profile: preferences and facts about you. When a preference changes, it’s updated in place rather than adding a contradicting line.
- **MEMORY.md** is the curated layer: durable facts, standing decisions and short summaries. It’s not a transcript or a daily log.
- **Daily notes** are the working layer: detailed notes and session summaries. They’re indexed for search but not loaded into every turn.

**Watch the size of MEMORY.md.** If it grows past the startup budget, OpenClaw keeps the full file on disk but cuts the copy it loads. Move detail into memory/\*.md and keep a short summary in MEMORY.md. Check with /context list, /context detail or openclaw doctor.

## Memory tools

The agent works with memory through three tools, provided by the active memory plugin (memory-core by default):

| Tool | What it does |
| --- | --- |
| memory_search | Finds relevant notes, even when the wording is different |
| memory_get | Reads a specific memory file or lines |
| intent | Creates, lists or cancels event-triggered standing intents |

With an embedding provider set up, memory_search combines meaning-based and keyword search. OpenClaw uses OpenAI embeddings by default, and supports Gemini, Voyage, Mistral, Ollama, LM Studio, local models and others.

From the command line:

```bash
openclaw memory status
openclaw memory search "query"
openclaw memory index --force
```

**Moving from Claude Code or Codex?** In the Control UI, open **Settings > Import Memory** to copy Markdown memory from Codex, Claude Code or Hermes into OpenClaw. Imported files are kept separate and searchable; your source files aren’t changed.

## Dreaming and memory flush

- **Dreaming** runs in the background by default. It scores what’s been recalled recently and promotes only qualified items into MEMORY.md, writing summaries to DREAMS.md for you to review.
- **Memory flush:** before OpenClaw compacts a long conversation, it runs a silent turn that reminds the agent to save important context. It’s on by default.

## Where OpenClaw memory stops

OpenClaw’s memory is designed for one agent’s workspace. Outside that, it doesn’t reach:

1. **Your other AI tools.** Claude, ChatGPT, Claude Code, Codex and Cursor keep their own memory. A decision you made in OpenClaw doesn’t reach them, and the reverse.
2. **Another machine.** Memory lives in the workspace on the machine running OpenClaw, unless you sync it yourself.
3. **What MEMORY.md can’t fit.** Past the startup budget, the loaded copy is cut, so older facts may not be in context.
4. **What isn’t written down.** If the agent doesn’t save a fact, the next session doesn’t know it.

## OpenClaw memory plugins

OpenClaw has one **memory slot**. The plugin in that slot owns recall and the memory tools.

| Option | What it is | Best for |
| --- | --- | --- |
| memory-core (default) | SQLite-based, with keyword, vector and hybrid search | Most single-agent setups |
| LanceDB | LanceDB-backed memory with auto-recall, auto-capture and local Ollama embeddings | Local vector memory |
| Honcho | Cross-session memory with user modeling | A deeper model of the user |
| memory-wiki | A knowledge vault beside your memory plugin, not a replacement | Turning memory into a maintained wiki |
| Membase | Your Membase account as OpenClaw’s memory, shared with your other AI tools | One memory across OpenClaw, Claude, ChatGPT and coding agents |

## Add persistent memory to OpenClaw with Membase

The Membase plugin makes your Membase account OpenClaw’s memory. Before each turn you send, it recalls what you told other AIs, and it gives the agent three tools:

| Tool | What it does |
| --- | --- |
| membase_search | Searches your Memories; every result names the Memory it came from |
| membase_save | Saves a note, only when you ask the agent to remember something |
| membase_profile | Reads your profile facts, if your key has Profile access |

There’s no delete tool. Removing memory stays in the Membase app.

**Set it up:**

1. **Get a key.** Sign up at [app.membase.com](https://app.membase.com) and open **Connect > Developer keys**. A **Read** key is enough to search. Choose **Read & write** if the agent should save, and have that key reach exactly one Memory. Tick **Profile** if it should read your profile.
2. **Install the plugin** (OpenClaw 2026.10.1 or newer). Keep the clawhub: prefix:

```bash
openclaw plugins install clawhub:@unibaseio/membase
```

**3. Configure it** in ~/.openclaw/openclaw.json:

```json
{
  plugins: {
    slots: { memory: "membase" },
    entries: {
      membase: {
        enabled: true,
        hooks: { allowConversationAccess: true },
        config: {
          apiKey: "${MEMBASE_API_KEY}"
        }
      }
    }
  }
}
```

allowConversationAccess lets the plugin read your message before a turn, which automatic recall needs.

**4. Restart and check:**

```bash
openclaw plugins reload membase
openclaw memory status
```

You should see provider: membase, health: ready.

**Good to know:**

- **One key is one person.** The plugin is for a personal agent: your OpenClaw and your Membase. In group chats or conversations with others, your memory isn’t offered unless you turn on allowSharedConversations, and those conversations can never save.
- **Recall waits up to 8 seconds**, then the turn continues without memory. The first search after a quiet spell is slower; the next is fast.
- **Saving is deliberate.** The agent saves when you ask. Set autoCapture: true to also save durable facts before OpenClaw compacts a long session.
- **memory-core can keep running** alongside as OpenClaw’s local consolidation.

The same Memory also works in Claude Code, Codex and Cursor over MCP, and in Claude and ChatGPT as a connector. Tell OpenClaw something on Monday, and Claude Code knows it on Tuesday.

## Connect memory over MCP instead

OpenClaw can also use MCP servers, saved with openclaw mcp. This adds memory as tools the agent can call, without replacing the memory slot. To add a remote MCP server:

```bash
openclaw mcp add membase \
  --url https://api.app.membase.com/mcp-http \
  --transport streamable-http \
  --auth oauth
openclaw mcp login membase
openclaw mcp doctor membase --probe
```

Stop the Gateway before adding or changing saved MCP servers, or use the Control UI at /settings/mcp.

**Plugin or MCP?** Use the plugin if you want OpenClaw to recall automatically before every turn. Use MCP if you want to keep memory-core in the slot and call Membase only when needed.

## Use it alongside MEMORY.md

You don’t have to choose:

| Layer | Keep here |
| --- | --- |
| USER.md | Your stable preferences |
| MEMORY.md and daily notes | What this agent learns in its workspace |
| Membase | Decisions and context that must follow you across OpenClaw, Claude, ChatGPT and your coding agents |

## Quick links

- [Get a free Membase API key](https://app.membase.com): create a key and a Memory
- [Membase plugin for OpenClaw](https://clawhub.ai/unibaseio/plugins/membase): install from ClawHub
- [How to Add Persistent Memory to Claude Code](https://membase.com/blog/claude-code-memory): the same memory for Claude Code
- [How to Add Persistent Memory to Codex CLI](https://membase.com/blog/codex-memory): the same memory for Codex
- [AGENTS.md vs CLAUDE.md](https://membase.com/blog/agents-md-vs-claude-md): instruction files for coding agents
- [OpenClaw memory overview](https://docs.openclaw.ai/concepts/memory): OpenClaw’s official documentation
- [Membase home](https://membase.com)

## Frequently Asked Questions

### Does OpenClaw have memory?

Yes. It writes Markdown files in your agent’s workspace: MEMORY.md for long-term facts, USER.md for your preferences, and daily notes in the memory folder.

### Where is OpenClaw memory stored?

In your agent’s workspace, by default ~/.openclaw/workspace.

### What is MEMORY.md in OpenClaw?

The curated long-term memory file: durable facts and standing decisions, loaded at the start of every session.

### Why does OpenClaw forget things?

Usually because the fact was never saved, or MEMORY.md grew past the startup budget and the loaded copy was cut. Ask the agent to remember important things, and keep MEMORY.md short.

### What is an OpenClaw memory plugin?

A plugin that fills OpenClaw’s memory slot and provides recall and memory tools. The default is memory-core; others include LanceDB, Honcho and Membase.

### Does OpenClaw support MCP?

Yes. Use openclaw mcp add to save MCP servers for OpenClaw agents, or openclaw mcp serve to expose OpenClaw’s conversations to other MCP clients.

### Can OpenClaw share memory with Claude Code or ChatGPT?

Not with its built-in memory. With the Membase plugin, OpenClaw uses the same memory as Claude Code, Codex, Cursor, Claude and ChatGPT.

### Can I import Claude Code or Codex memory into OpenClaw?

Yes. In the Control UI, open Settings > Import Memory. It copies Markdown memory from Codex, Claude Code or Hermes.
