Skip to main content
Membase x OpenClaw
Persistent long-term memory for OpenClaw, powered by Membase. Works across Telegram, WhatsApp, Discord, Slack, and any other channel OpenClaw supports. The plugin automatically remembers conversations, recalls relevant context, and builds a knowledge graph, all backed by a hybrid vector + graph search engine.

How It Works

Once installed, Auto-Capture runs automatically with no extra configuration:
  • Auto-Capture (on by default): After conversations, messages are buffered and sent to Membase for extraction and long-term storage. Entities and relationships are automatically extracted into a knowledge graph.
  • Auto-Recall (off by default): When enabled, the plugin searches your memories by semantic similarity before every AI turn and injects relevant context. Casual chat is skipped to keep things focused.
  • Knowledge Graph: Unlike simple vector memory, Membase stores entities, relationships, and facts in a graph database. Search results include related nodes and edges for richer context.

Setup

1

Install the Membase plugin

openclaw plugins install @membase/openclaw-membase
Restart OpenClaw after installing.
2

Log in to Membase

openclaw membase login
A browser window opens automatically for OAuth authentication. Tokens are saved automatically, so there are no API keys to manage.
3

Start using Membase in OpenClaw

Membase is now active. Conversations are automatically captured and stored to memory. To also inject memories before each AI response, enable Auto-Recall — just ask your AI: "Enable auto-recall for Membase".

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-Capture (automatically save conversations to memory):
"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 section below.

AI Tools

The AI uses these tools autonomously during conversations:
ToolDescription
membase_searchSearch 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_storeSave important information to long-term memory. Proactively stores preferences, goals, and context.
membase_forgetDelete a memory. Shows matches first, then deletes after user confirmation (two-step).
membase_profileRetrieve user profile and related memories for session context.

CLI Commands

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 status             # Check API connectivity

Auto-Recall

Runs before every AI response (before_agent_start hook) when enabled. Queries Membase for relevant memories and injects them as context. 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:
{
  "plugins": {
    "entries": {
      "openclaw-membase": {
        "config": {
          "autoRecall": true
        }
      }
    }
  }
}

Auto-Capture

Runs after every AI response (agent_end hook). Buffers conversation messages per channel and flushes them to Membase for knowledge extraction. Buffers flush after 5 minutes of silence or 20 messages, whichever comes first. At least 2 messages are required before flushing. 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:
KeyTypeDefaultDescription
apiUrlstringhttps://api.membase.soMembase API URL. Override for self-hosted.
tokenFilestring~/.openclaw/credentials/openclaw-membase.jsonOAuth token cache file path. Stored outside the plugin directory so it survives updates.
autoRecallbooleanfalseInject relevant memories before every AI turn.
autoCapturebooleantrueAutomatically store conversations to memory.
maxRecallCharsnumber4000Max characters of memory context per turn (500–16000).
debugbooleanfalseEnable 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:
{
  "tools": {
    "profile": "coding",
    "alsoAllow": ["openclaw-membase"]
  },
  "plugins": {
    "entries": {
      "openclaw-membase": {
        "enabled": true,
        "config": {
          "autoRecall": 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.
OpenClaw plugins list

Updating the Plugin

To update Membase to the latest version:
openclaw plugins update openclaw-membase
Restart OpenClaw after updating to apply the new version.

How Membase Differs

Simple vector memoryMembase
StorageFlat embeddingsHybrid: vector embeddings + Neo4j knowledge graph
SearchVector similarity onlyVector + graph traversal (entities, relationships, facts)
ExtractionStore raw textAI-powered entity/relationship extraction
AuthAPI keyOAuth 2.0 with PKCE (no secrets to manage)
IngestSynchronousAsync pipeline with background graph sync