> ## Documentation Index
> Fetch the complete documentation index at: https://docs.membase.so/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenClaw

> Add persistent long-term memory and Wiki transcript capture to OpenClaw across Telegram, WhatsApp, Discord, Slack, and more with Membase's universal knowledge layer.

<Frame>
  <img src="https://mintcdn.com/aristo_2/tFV4oJ6Ge1Gx_XMC/images/connectors/membase-openclaw.png?fit=max&auto=format&n=tFV4oJ6Ge1Gx_XMC&q=85&s=213a9f109010469867ff870e0f6b9eba" alt="Membase x OpenClaw" width="1584" height="396" data-path="images/connectors/membase-openclaw.png" />
</Frame>

Persistent long-term memory for OpenClaw, powered by Membase. Works across **Telegram, WhatsApp, Discord, Slack**, and any other channel OpenClaw supports. The plugin can preserve conversation transcripts in Wiki, recall relevant Memory and Wiki context, and use Membase's hybrid retrieval layer across sessions.

## How It Works

Once installed, **Auto-Capture** runs automatically with no extra configuration:

* **Auto-Capture** *(on by default)*: After conversations, user and assistant messages are buffered and saved as original transcript documents in Membase Wiki.
* **Auto-Recall** *(off by default)*: When enabled, the plugin searches memory context before every AI turn and injects relevant snippets. Casual chat is skipped to keep things focused.
* **Auto Wiki Recall** *(off by default)*: When enabled, the plugin also prefetches wiki documents before every AI turn for factual context and references.
* **Knowledge Graph**: Unlike simple vector memory, Membase organizes entities, relationships, and facts into a knowledge graph. Search results include related context for richer responses.

## Setup

<Steps>
  <Step title="Install the Membase plugin">
    ```bash theme={null}
    openclaw plugins install @membase/openclaw-membase
    ```

    Restart OpenClaw after installing.
  </Step>

  <Step title="Log in to Membase">
    ```bash theme={null}
    openclaw membase login
    ```

    A browser window opens automatically for OAuth authentication. Tokens are saved automatically, so there are no API keys to manage.
  </Step>

  <Step title="Start using Membase in OpenClaw">
    Membase is now active. Conversation transcripts are automatically captured to Wiki. To also inject memories before each AI response, enable Auto-Recall by asking your AI: `"Enable auto-recall for Membase"`.
  </Step>
</Steps>

## Configuring Membase

The simplest way to change Membase settings is to just ask your AI in a conversation. No need to edit config files manually.

**Auto-Recall** (inject past memories before each response):

```
"Enable auto-recall for Membase"
"Turn off auto-recall"
```

**Auto Wiki Recall** (inject wiki docs before each response):

```
"Enable auto wiki recall for Membase"
"Turn off auto wiki recall"
```

**Auto-Capture** (automatically save conversation transcripts to Wiki):

```
"Stop capturing my conversations to Membase"
"Re-enable auto-capture"
```

**Memory context size** (how much memory is injected per turn, 500–16000 chars):

```
"Set my Membase recall limit to 8000 characters"
"Reduce the memory context to 2000 characters"
```

The AI will update `~/.openclaw/openclaw.json` and ask you to restart the OpenClaw gateway for the change to take effect. Alternatively, you can edit the config directly. See the [Configuration](#configuration) section below.

## AI Tools

The AI uses these tools autonomously during conversations. The `membase_*` names below are OpenClaw's plugin-side wrappers around the corresponding [Membase MCP tools](/features/membase-mcp).

| Tool                  | Wraps               | Description                                                                                                                                                                                                                                                 |
| --------------------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `membase_search`      | `search_memory`     | Search memories by semantic similarity. Supports date filtering (`date_from`, `date_to`, `timezone`) and source filtering (`sources`, e.g. `slack`, `gmail`). Each result includes a **relevance score** (0–1). Returns episode bundles with related facts. |
| `membase_store`       | `add_memory`        | Save important information to long-term memory. Proactively stores preferences, goals, and context.                                                                                                                                                         |
| `membase_forget`      | `delete_memory`     | Delete a memory. Shows matches first, then deletes after user confirmation (two-step).                                                                                                                                                                      |
| `membase_profile`     | `membase://profile` | Retrieve user profile and related memories for session context.                                                                                                                                                                                             |
| `membase_search_wiki` | `search_wiki`       | Search Wiki documents for factual references and stable knowledge. Results label Project, Basic, or Unknown destinations.                                                                                                                                   |
| `membase_add_wiki`    | `add_wiki`          | Create a Wiki document from full markdown content and an optional Project filing location. Reports the returned destination.                                                                                                                                |
| `membase_update_wiki` | `update_wiki`       | Update title, content, or Project for an existing Wiki document. Set Project to `null` to move to Basic.                                                                                                                                                    |
| `membase_delete_wiki` | `delete_wiki`       | Delete a Wiki document with a confirmation flow.                                                                                                                                                                                                            |

## CLI Commands

```bash theme={null}
openclaw membase login              # OAuth login (PKCE)
openclaw membase logout             # Remove stored tokens
openclaw membase search <query>     # Search memories
openclaw membase search <query> -s slack,gmail  # Filter by source
openclaw membase wiki-search <query>            # Search wiki documents
openclaw membase wiki-search <query> --project "Docs"        # Filter by Project
openclaw membase wiki-search <query> --collection-id <uuid>  # Filter by Project UUID
openclaw membase wiki-add "<title>" --content "<markdown>"   # Add wiki doc
openclaw membase wiki-add "<title>" --content "<markdown>" --project "Docs"
openclaw membase wiki-update <docId> --title "<new title>"   # Update wiki doc
openclaw membase wiki-update <docId> --clear-project         # Move to Basic
openclaw membase wiki-delete <docId>            # Delete wiki doc
openclaw membase status             # Check API connectivity
```

## Auto-Recall

Runs before every AI response (`before_agent_start` hook) when enabled.

Queries Membase for relevant memories and wiki docs and injects them as context when enabled. Casual chat (greetings, acknowledgments) is skipped. The injected context respects a `maxRecallChars` budget to avoid oversized prompts.

Auto-Recall is **disabled by default**. Enable it in your plugin config:

```json theme={null}
{
  "plugins": {
    "entries": {
      "openclaw-membase": {
        "config": {
          "autoRecall": true
        }
      }
    }
  }
}
```

## Auto-Capture

Runs after every AI response (`agent_end` hook).

Buffers user and assistant messages per channel and flushes original transcripts to Membase Wiki. Buffers flush after **5 minutes of silence** or **20 messages**, whichever comes first. The last 2 messages are kept as overlap for continuity across batches.

## Configuration

All configuration is managed through OpenClaw's plugin settings or `~/.openclaw/openclaw.json`:

| Key              | Type    | Default                                         | Description                                                                              |
| ---------------- | ------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `apiUrl`         | string  | `https://api.membase.so`                        | Membase API URL. Override only if instructed by Membase support.                         |
| `tokenFile`      | string  | `~/.openclaw/credentials/openclaw-membase.json` | OAuth token cache file path. Stored outside the plugin directory so it survives updates. |
| `autoRecall`     | boolean | `false`                                         | Inject relevant memories before every AI turn.                                           |
| `autoWikiRecall` | boolean | `false`                                         | Inject relevant wiki documents before every AI turn.                                     |
| `autoCapture`    | boolean | `true`                                          | Automatically store user/assistant conversation transcripts to Wiki.                     |
| `maxRecallChars` | number  | `4000`                                          | Max characters of memory context per turn (500–16000).                                   |
| `debug`          | boolean | `false`                                         | Enable verbose debug logs.                                                               |

OAuth login keeps stable plugin config in `~/.openclaw/openclaw.json` and stores rotating tokens in `tokenFile`.
Legacy keys (`accessToken`, `refreshToken`) are migrated automatically when present.

### Enabling AI Tools

The plugin automatically adds itself to `tools.alsoAllow` on first load. If it doesn't take effect, restart the gateway once.

If you prefer to configure it manually, use `tools.alsoAllow` (not `tools.allow`) to avoid breaking your existing profile allowlist:

```json theme={null}
{
  "tools": {
    "profile": "coding",
    "alsoAllow": ["openclaw-membase"]
  },
  "plugins": {
    "entries": {
      "openclaw-membase": {
        "enabled": true,
        "config": {
          "autoRecall": false,
          "autoWikiRecall": false,
          "autoCapture": true,
          "maxRecallChars": 4000,
          "debug": false
        }
      }
    }
  }
}
```

`"openclaw-membase"` in `tools.alsoAllow` expands to all tools registered by this plugin and is appended on top of the active profile. Using `tools.allow` instead can silently break your profile allowlist. Without this entry, the AI still receives memory context via auto-recall but cannot call the tools explicitly.

## Managing Plugins

Use `openclaw plugins` to manage installed plugins, check status, and update versions.

<Frame caption="OpenClaw plugin list showing Membase loaded">
  <img src="https://mintcdn.com/aristo_2/SyC5fNZLZj3t6Psb/images/connectors/openclaw-plugin.png?fit=max&auto=format&n=SyC5fNZLZj3t6Psb&q=85&s=3d3015fd42810e2efa660124b8c60fa2" alt="OpenClaw plugins list" width="939" height="659" data-path="images/connectors/openclaw-plugin.png" />
</Frame>

### Updating the Plugin

To update Membase to the latest version:

```bash theme={null}
openclaw plugins update openclaw-membase
```

Restart OpenClaw after updating to apply the new version.

## How Membase Differs

|                | Simple vector memory   | **Membase**                                               |
| -------------- | ---------------------- | --------------------------------------------------------- |
| **Storage**    | Flat embeddings        | Hybrid: vector embeddings + knowledge graph               |
| **Search**     | Vector similarity only | Vector + graph traversal (entities, relationships, facts) |
| **Extraction** | Store raw text         | AI-powered entity/relationship extraction                 |
| **Auth**       | API key                | OAuth 2.0 with PKCE (no secrets to manage)                |
| **Ingest**     | Synchronous            | Asynchronous processing                                   |

## GitHub Repository

Want to inspect the plugin source, track releases, or contribute improvements?

<Card title="openclaw-membase on GitHub" icon="github" href="https://github.com/aristoapp/openclaw-membase">
  Browse the source code, open issues, and follow plugin updates in the standalone repository.
</Card>

## Next Steps

<CardGroup cols={2}>
  <Card title="Bring Your Context" icon="download" href="/getting-started/bring-context">
    Import chat history, connect apps, and more.
  </Card>

  <Card title="Use Your Context" icon="comment-dots" href="/getting-started/use-context">
    Chat with Memory, agent retrieval, and dashboard exploration.
  </Card>

  <Card title="Knowledge Wiki" icon="book" href="/features/wiki">
    Store factual knowledge as wiki documents that OpenClaw can search directly.
  </Card>

  <Card title="Membase MCP" icon="link" href="/features/membase-mcp">
    See every MCP tool your agent can call.
  </Card>
</CardGroup>
