OpenClaw Memory
Persistent Long-Term Memory Plugin.
TL;DR
Give OpenClaw autonomous agents persistent memory across every run. The Memwyre plugin auto-injects past project context when an agent session starts and auto-captures decisions when it ends — no manual context files needed. Includes save_memory and search_memwyre tools for on-demand access during agent runs.
The Problem: OpenClaw Agents Forget Everything
Every time an autonomous agent run completes, the context window resets. The debugging breakthroughs, architecture decisions, and code patterns from the last run — all gone. You spend the first minutes of every agent session re-explaining your project's constraints.
OpenClaw doesn't ship with built-in persistent memory. If you use OpenClaw and Claude Code and Cursor, each tool maintains its own isolated silo.
Four Approaches to OpenClaw Memory
| Feature | Manual Context Files | Mem0 / Zep (Agent Frameworks) | MCP Memory Server | Memwyre Plugin |
|---|---|---|---|---|
| Automation | Manual edits | Predictive (LLM decides) | Predictive (LLM decides) | Deterministic (SessionStart/Stop) |
| Storage | Flat files | Local SQLite + ChromaDB | Varies | Cloud vault + entity graph |
| Setup | Manual file creation | Hours (SDK & Database Config) | JSON config + key | openclaw plugins install |
| Cross-Session | ❌ No persistence | ✅ Via SDK API calls | ✅ Via tool calls | ✅ Auto-injected on startup |
| Cross-Tool | ❌ OpenClaw only | ❌ Custom pipelines required | ✅ Any MCP client | ✅ Shared vault (Claude Code, Cursor, VS Code) |
| License | N/A | Apache-2.0 / Proprietary | Varies | Apache-2.0 |
| Best For | Static rules | Custom AI Agent backends | Real-time tool access | Hands-free cross-tool memory |
These approaches are complementary, not exclusive. Use manual files for static rules and Memwyre for dynamic OpenClaw session memory — they work together.
Memwyre vs. Mem0 & Zep for OpenClaw
When building memory for autonomous agents, framework solutions like Mem0 (SDK-first memory) and Zep / Graphiti (temporal knowledge graphs) are popular choice for custom backend developers. However, integrating them into OpenClaw requires writing custom Python/TS wrappers, orchestrating database instances, and managing manual API calls inside your agent loops.
Where Memwyre differs for OpenClaw developers:
- Zero-code CLI integration: Memwyre installs directly into OpenClaw with one command (
openclaw plugins install @memwyre/openclaw-plugin). It automatically hooks into OpenClaw's session lifecycle events to handle context injection and session capture without writing custom SDK code. - Cross-tool ecosystem: Mem0 and Zep require custom sync pipelines to share memory between your CLI agents and your IDE. Memwyre's shared vault connects OpenClaw agent sessions directly to Cursor, VS Code, and Claude Desktop.
- Benchmark performance: On the LoCoMo-10 benchmark, Memwyre's cross-encoder engine scores 73.5% accuracy vs. 43.7% for flat vector RAG baselines, using 88.5% fewer tokens. (Deep dives available on our Memwyre vs. Mem0 and Memwyre vs. Zep pages.)
How Cross-Tool Sync Actually Works
- OpenClaw (plugin): hooks into session lifecycle events. On start → retrieval API. On stop → POST transcript to capture endpoint.
- Claude Code / Cursor / VS Code / Claude Desktop (MCP): connect via Memwyre MCP server, same vault.
- Same API key = same vault. Memory captured in an OpenClaw agent run is available in Cursor at the next prompt.
How the Memwyre OpenClaw Plugin Works
① SessionStart — Context Injection
When an OpenClaw agent session starts, the plugin fires before the first prompt. It reads your working directory, queries the Memwyre retrieval engine for past memories, and injects them into the agent's system prompt.
<memwyre-context>
## Past Memories for my-project
- Database uses PostgreSQL 15 with pgvector
- Auth flow: JWT + refresh tokens in httpOnly cookies
- Fixed: race condition in worker queue (use Redis lock)
</memwyre-context>② Stop — Session Capture
When the agent run completes or goes idle, the plugin reads the session transcript (from event messages, session file, or ~/.openclaw/agents/main/sessions/ JSONL logs), sends it to Memwyre's background worker for extraction.
③ On-Demand Tools
Unlike the Claude Code plugin, OpenClaw's integration also provides two MCP tools:
save_memory(text, tags): Manually save a note/decision during an agent run.search_memwyre(query, limit): Semantic search across your vault mid-session.
Troubleshooting & Edge Cases
- Misclassified memory: view/edit/delete via dashboard or API (
DELETE /api/v1/memories/:id). - Stale facts: Ebbinghaus decay auto-deprioritizes.
- Deduplication: extraction model handles near-duplicates.
- Tool profile requirement: OpenClaw's tool profile must be set to
fullorcoding— the plugin is disabled understandardorminimalprofiles.
Install in 60 Seconds
The Memwyre OpenClaw plugin installs directly via the OpenClaw CLI or JSON config:
- 1. Install the plugin package:
openclaw plugins install @memwyre/openclaw-plugin - 2. Configure your API key:
Add the plugin entry to your
~/.openclaw/config.jsonsettings file:{ "plugins": { "entries": { "@memwyre/openclaw-plugin": { "enabled": true, "config": { "apiKey": "bv_sk_your_api_key_here", "hostUrl": "https://api.memwyre.tech" } } } } }Alternatively, export
MEMWYRE_API_KEY="bv_sk_..."in your shell environment. - 3. Set OpenClaw Agent Tool Profile:
Ensure OpenClaw is running with
fullorcodingtool profile. Custom memory tools are bypassed understandardorminimalprofiles. - 4. Run your agent:
The plugin handles past context injection on agent start and saves session insights on agent exit.
What OpenClaw Remembers With Memwyre
- 🧠 Architecture Decisions: Database choices, API patterns, deployment configs, and framework decisions.
- 🐛 Debugging Solutions: Race conditions fixed, environment variable gotchas, and edge cases.
- 🔗 Entity Relationships: Connections enabling multi-hop reasoning.
- ✂️ Dynamic Pruning: Filters out noise to keep memory lean.
Benchmark: Why Retrieval Quality Matters
| Category | Flat Vector RAG | Memwyre Engine | Improvement |
|---|---|---|---|
| Single-Hop | 53.0% | 80.0% | +51% |
| Multi-Hop | 24.0% | 45.0% | +87.5% |
| Temporal | 48.0% | 74.0% | +54% |
| Open-Domain | 50.0% | 76.0% | +52% |
| Overall | 43.7% | 73.5% | +68% |
| Context Tokens | ~26,000 | ~3,000 | −88.5% |
The improvement comes from architectural drivers like dynamic context pruning, two-stage cross-encoder re-ranking, and Ebbinghaus logarithmic recency decay. View the full LoCoMo-10 benchmark results →
Real-World Workflow: Multi-Agent Codebase Migration
Scenario: Using OpenClaw agents to handle a microservices migration. Agent #1 analyzes service boundaries on Monday. Agent #2 generates API contracts on Tuesday. Agent #3 writes integration tests on Wednesday. Without persistent memory, Agent #3 doesn't know the decisions Agent #1 made. With Memwyre, all three agents share the same vault.
Token Costs, Noise, & Security
Noise Filtration
Not every CLI error needs to be remembered. Memwyre's backend differentiates between ephemeral noise and structural knowledge.
Token Efficiency
By summarizing past sessions, the plugin injects a concise <memwyre-context> block (~1,500 token injections) vs megabytes of raw logs.
Enterprise Security
Zero-retention policies and self-hosting options ensure your code stays private.
License & Requirements
- License: Apache-2.0
- System requirements: Node.js 18+, any OS, no local DB needed
- Self-hosting: Docker deployment available
- Tool Profile: OpenClaw tool profile must be
fullorcoding
Why Not Just Use Manual Context Files?
Manual context files are fine for static rules. But they face real limitations: manual maintenance, flat storage, and they are tool-locked.
FAQ
Does OpenClaw have built-in memory?
How is Memwyre different from Mem0 and Zep for OpenClaw?
openclaw plugins install @memwyre/openclaw-plugin) that hooks directly into agent session lifecycles, enabling instant cross-tool context sync with Cursor, VS Code, and Claude Desktop. Memwyre also scores 73.5% on the LoCoMo-10 benchmark vs. 43.7% for flat vector baselines.What is the best OpenClaw memory plugin?
How is Memwyre different from claude-mem?
Does the plugin work with Claude Code and Cursor too?
What license is Memwyre released under?
What happens if Memwyre captures something wrong?
Is my memory data private?
Give OpenClaw Persistent Memory
One plugin install. Automatic context injection. Automatic session capture. Memory that works seamlessly across your autonomous agent sessions.
Start Free