OpenClaw-Mem0 Plugin Adds Persistent Memory Outside Context Window

✍️ OpenClawRadar📅 Published: February 26, 2026🔗 Source
OpenClaw-Mem0 Plugin Adds Persistent Memory Outside Context Window
Ad

The openclaw-mem0 plugin addresses OpenClaw's default memory limitations by storing memories outside the context window, making them immune to context compaction, token limits, and session restarts.

The Memory Problem in OpenClaw

OpenClaw agents are stateless between sessions, with default memory stored in files that must be explicitly loaded. Context compaction summarizes older context to save tokens, causing injected memory to become lossy - large memory files and learned facts get compressed, rewritten, or dropped without warning.

Community workarounds like comprehensive MEMORY.md files, local BM25 + vector search engines, and SQLite-backed session logs all share the same limitation: they store memory inside the context window, making them vulnerable to compaction or session restarts.

How the Plugin Works

The plugin runs two processes on every conversation turn:

  • Auto-Recall: Searches Mem0 for relevant memories before the agent responds, injecting matching context (preferences, past decisions, project details) into the working context every turn
  • Auto-Capture: Sends each exchange to Mem0 after the agent responds, with Mem0's extraction layer determining what's worth persisting - new facts get stored, outdated ones updated, duplicates merged

Both processes are enabled by default on install.

Ad

Memory Structure

The plugin separates memory into two scopes:

  • Long-term memories: User-scoped, persist across all sessions (name, tech stack, project structure, decisions)
  • Short-term memories: Session-scoped, track active work without polluting long-term store

Both scopes are searched during every recall, with long-term memories surfaced first.

The agent gets five tools for explicit memory management:

  • memory_search - semantic queries across all memories
  • memory_store - explicitly save a specific fact
  • memory_list - view all stored memories
  • memory_get - retrieve a specific memory by ID
  • memory_forget - delete memories (GDPR-compliant)

Setup Options

Cloud setup (easiest):

openclaw plugins install @mem0/openclaw-mem0

Get an API key from app.mem0.ai, then add to openclaw.json:

{
  "openclaw-mem0": {
    "enabled": true,
    "config": {
      "apiKey": "${MEM0_API_KEY}",
      "userId": "your-user-id"
    }
  }
}

Fully local, fully private (self-hosted):

Set "mode": "open-source" and bring your own stack:

{
  "openclaw-mem0": {
    "enabled": true,
    "config": {
      "mode": "open-source",
      "userId": "your-user-id",
      "oss": {
        "embedder": {
          "provider": "ollama",
          "config": {
            "model": "nomic-embed-text"
          }
        },
        "vectorStore": {
          "provider": "qdrant",
          "config": {
            "host": "localhost",
            "port": 6333
          }
        }
      }
    }
  }
}

📖 Read the full source: r/openclaw

Ad

👀 See Also

GrapeRoot tool reduces Claude Code costs by 45% with pre-scanned repository context
Tools

GrapeRoot tool reduces Claude Code costs by 45% with pre-scanned repository context

A free tool called GrapeRoot that pre-scans repositories and builds dependency graphs reduced Claude Code costs by 45% on average across 10 engineering tasks while improving response quality by 13%. The tool eliminates exploration loops that normally consume tokens.

OpenClawRadar
New Structured Data API Provides Subscription Pricing for LLM Agents
Tools

New Structured Data API Provides Subscription Pricing for LLM Agents

A developer has released a structured data API that normalizes subscription pricing across streaming platforms, ride-share services, dating apps, and other subscription-based platforms. The API provides consistent JSON schemas, region-aware pricing where available, and MCP-compatible endpoints for LLM agents to consume without scraping.

OpenClawRadar
Blindspot MCP: An External Brain for AI Coding Agents
Tools

Blindspot MCP: An External Brain for AI Coding Agents

Blindspot MCP is a tool that indexes full codebases using tree-sitter and SQLite to help AI coding agents understand symbols, dependencies, and relationships across files, preventing changes that break code outside their immediate context.

OpenClawRadar
Rails-AI-Context Gem Provides Claude Code with Complete Rails App Model via MCP
Tools

Rails-AI-Context Gem Provides Claude Code with Complete Rails App Model via MCP

The rails-ai-context gem auto-introspects Rails applications and exposes 39 tools via MCP, allowing Claude Code to query specific app details like schema with encrypted columns, model associations, routes, Stimulus wiring, and Turbo mappings instead of reading entire files.

OpenClawRadar