Your agent forgets things. Four tools promise to fix it. Here's what each one actually does and which one you should install first.
Three weeks into using OpenClaw, I asked my agent who managed our auth team. I'd told it this in a conversation ten days earlier. The agent searched its memory, retrieved six chunks of text about authentication, and couldn't connect any of them to the person I'd mentioned.
The information was there. The retrieval couldn't find it. That's the difference between storing memory and understanding memory.
OpenClaw's default memory system works fine for the first few weeks. After that, the limitations show up in specific, predictable ways. Four memory plugins exist to fix these limitations: the built-in LCM (Lossless Context Manager), QMD (hybrid search), Mem0 (automatic fact extraction), and Cognee (knowledge graph). They solve different problems. They're not interchangeable. And most people install the wrong one first.
Here's the honest comparison.
What the default memory actually does (and where it breaks)
OpenClaw's built-in memory splits your Markdown files (MEMORY.md, daily logs) into roughly 400-token chunks, embeds each chunk, and stores them in a local SQLite index. When you ask a question, it runs a semantic search over those chunks and returns the top results.
This works when the exact words you're searching for appear in the memory. It breaks in three specific ways.
Keyword misses. The default search is semantic only. If you stored "Docker configuration" but search for "container setup," the match might fail. Semantic search finds conceptual similarity, but it's not perfect. Exact keyword matching would catch this. The default system doesn't do both.
No cross-session recall. Once a conversation ends, the context fades unless the agent explicitly wrote something to a memory file. Information from old conversations that wasn't persisted is gone.
No relational understanding. The system stores text chunks. It doesn't understand that Alice manages the auth team, that the auth team handles permissions, and that you should ask Alice about permission issues. Those are three separate chunks that require reasoning to connect.
For the detailed explanation of how OpenClaw memory and compaction work, our compaction guide covers what happens to your context window during long conversations.
LCM: The built-in context manager
LCM (Lossless Context Manager) ships with OpenClaw. It's not a plugin you install. It's the engine that manages your active conversation context.
What it does: Compresses older messages in the conversation window to keep the context from overflowing. Preserves recent messages in full while summarizing older ones. Controls how much of the context window is used for conversation history versus system prompts and tool results.
What it doesn't do: Cross-session recall. Semantic search. Relationship understanding. LCM manages the current conversation. It doesn't improve how the agent retrieves information from past conversations.
When to tune it: If your agent forgets things mid-conversation (within a single session), adjust LCM's freshTailCount (how many recent messages stay uncompressed) and contextThreshold (when compression triggers). The defaults work for most conversations. Long, complex sessions benefit from a higher freshTailCount (32 instead of the default).
Cost: Free. Built in. No additional API calls.
LCM manages the current session. QMD, Mem0, and Cognee manage everything else. Don't compare LCM to the other three. They work on different problems.
QMD: The hybrid search upgrade (start here)
QMD combines BM25 keyword search with vector semantic search and LLM reranking. It's the single biggest improvement you can make to OpenClaw's memory recall with the least setup effort.
What it does: Searches your Markdown memory files using both exact keyword matching (BM25) and semantic similarity (vectors), then uses an LLM to rerank results by relevance. This means "container setup" matches "Docker configuration" through semantic search while "CVE-2026-25253" matches through exact keywords. The combination catches queries that either approach alone would miss.
What it doesn't do: Automatic fact extraction. Relationship mapping. QMD searches your existing files better. It doesn't create new information or understand connections between facts.
Setup complexity: Low. QMD runs as an MCP server alongside OpenClaw. Community benchmarks show recall accuracy jumping from roughly 45% (default SQLite) to 92% with QMD hybrid search. Setup takes about 5 minutes.
Cost: Free. Runs locally. No external API costs beyond the LLM reranking step (which uses your existing model provider).
Best for: Anyone who writes things down in memory files and wants better retrieval. This is the 80/20 solution. Biggest improvement, least effort.
For the complete guide to OpenClaw best practices including memory file organization, our practices guide covers how to structure memory files that QMD searches effectively.

Mem0: Automatic fact extraction (for people who hate writing notes)
Mem0 watches your conversations, automatically extracts structured facts ("user prefers dark mode," "project deadline is March 15," "Alice manages auth"), deduplicates them, and stores them in a vector database. Before each response, it queries those stored facts and injects relevant ones into the prompt.
What it does: Two processes run on every conversation turn. Auto-Recall searches stored facts for anything relevant to the current message and injects them. Auto-Capture processes the conversation after each exchange, identifies meaningful facts, and stores them. You don't write MEMORY.md entries manually. The system does it for you.
What it doesn't do: Relationship reasoning. Mem0 stores individual facts. It doesn't build connections between them. It's a smart note-taker, not a knowledge graph.
Setup complexity: Low for cloud mode (30 seconds with an API key from app.mem0.ai). Moderate for self-hosted mode (requires configuring vector store and embedding provider). Cloud mode sends conversation data to Mem0's servers. Self-hosted mode keeps everything local.
Cost: Mem0 Cloud free tier available. Pro tier: $249/month for graph features. Self-hosted: free, requires your own embedding API costs.
Best for: Users who interact with OpenClaw conversationally across many sessions and don't want to manually curate memory files. Also strong for multi-user deployments where each user needs isolated memory (Mem0's userId namespace handles this natively).
The privacy trade-off: Mem0 Cloud sends your conversation data to external servers for extraction. If data privacy is a concern, use self-hosted mode or skip Mem0 entirely. The extraction process adds API costs because every conversation turn gets processed twice: once by your agent's model and once by Mem0's extraction model.

Cognee: Knowledge graph for relationship reasoning
Cognee builds a knowledge graph from your Markdown memory files. Instead of searching for similar text, it extracts entities and relationships, then traverses the graph to answer queries that require connecting multiple facts.
What it does: On startup, scans your MEMORY.md and daily logs. Extracts entities (people, projects, teams, dates) and relationships between them. When you ask "who should I talk to about auth permissions?", Cognee traverses: Auth Permissions → Auth Team → Alice (manages). The agent gets structured context: "Alice manages the auth team and handles permissions." Vector search alone would return chunks about auth and chunks about Alice but might not connect them.
What it doesn't do: Keyword search. Simple text retrieval. Cognee is designed for relational queries, not "find the paragraph where I mentioned X." Use QMD for text retrieval and Cognee for relationship reasoning.
Setup complexity: Moderate. Takes about 15 minutes. Requires LLM API for entity extraction during indexing. The initial graph build processes all your memory files, which can be slow and costly for large memory stores.
Cost: Free for local deployment. Cognee Cloud team plan: $35/month. The entity extraction process uses LLM calls during indexing, adding ongoing API costs as memory files grow.
Best for: Teams managing complex, long-running projects where relationships between people, systems, and decisions matter. If you're tracking "who manages what, which team owns which system, and what was decided about X project three weeks ago," Cognee answers these queries that no other plugin handles well.
If managing memory plugins, retrieval tuning, and extraction costs feels like more infrastructure work than you want, Better Claw includes hybrid vector plus keyword search built into the platform. $29/month per agent, BYOK. The memory layer is pre-optimized. No plugins to install or configure.

Which one should you install first?
Here's the practical recommendation.
Most users: start with QMD. It requires the least setup (5 minutes), produces the biggest improvement in recall accuracy (45% to 92%), runs locally with no external API costs, and works with your existing Markdown files without changing how you use OpenClaw. This is the 80/20 answer.
Add Mem0 if you hate writing notes. If you want the agent to automatically remember things from conversations without you curating MEMORY.md, Mem0 handles that. Be aware of the privacy implications (cloud mode sends data externally) and the cost implications (double LLM calls per turn).
Add Cognee if relationships matter. If your work involves connecting people to projects, teams to systems, and decisions to timelines, Cognee's graph retrieval answers queries that text search can't. But it's overkill for personal assistant use cases.
They're not mutually exclusive. QMD and Cognee can run together. Mem0 can run alongside either. The Markdown files remain the shared foundation. The main consideration when stacking: token overhead. Two retrieval systems each injecting context means more tokens per response and higher API costs.
Start with QMD. It's the biggest improvement with the least investment. Add Mem0 or Cognee only when you hit a specific limitation that QMD doesn't solve. Don't install all three because you can. Install the one that fixes the problem you actually have.
The memory problem that plugins can't fix
Here's what nobody tells you about OpenClaw memory plugins.
All four tools improve how the agent retrieves and uses stored information. None of them fix the fundamental problem: your agent only remembers what gets written down.
If a critical fact from a conversation doesn't get persisted to a memory file (either manually by you or automatically by Mem0), it's gone after the session ends. LCM can keep it in the active context for a while. Compaction will eventually summarize it away. And no retrieval plugin can find information that was never stored.
The best memory setup combines a persistence strategy (write important things to MEMORY.md or let Mem0 capture them) with a retrieval strategy (QMD or Cognee to find them later). Both layers matter. Most people focus on retrieval and ignore persistence.
For the complete memory troubleshooting guide including how memory persistence interacts with your system prompt, our guide covers the persistence side of the equation.
If you want memory that works without installing and configuring plugins, give Better Claw a try. $29/month per agent, BYOK with 28+ providers. Hybrid vector plus keyword search is built into the platform. Persistent memory with automatic capture. No QMD setup, no Mem0 API keys, no Cognee graph builds. The memory layer just works.
Frequently Asked Questions
What are the main memory plugins for OpenClaw?
The four primary memory options are: LCM (built-in context manager that compresses old messages in the active session), QMD (hybrid BM25 + vector search that dramatically improves recall accuracy from 45% to 92%), Mem0 (automatic fact extraction from conversations with cloud or self-hosted modes), and Cognee (knowledge graph that understands relationships between entities). LCM manages the current session. QMD, Mem0, and Cognee improve cross-session memory. They're not mutually exclusive and can be layered.
Which OpenClaw memory plugin should I install first?
QMD. It requires the least setup (5 minutes), produces the biggest improvement (recall accuracy from 45% to 92%), runs locally with no external API costs, and works with your existing Markdown files. Start with QMD and only add Mem0 (for automatic fact extraction) or Cognee (for relationship reasoning) when you hit specific limitations that QMD doesn't address.
How much do OpenClaw memory plugins cost?
QMD: free, runs locally. Mem0 Cloud: free tier available, Pro tier $249/month for graph features. Mem0 self-hosted: free, requires your own embedding API costs. Cognee local: free, requires LLM API for entity extraction. Cognee Cloud: $35/month team plan. LCM: free, built into OpenClaw. The hidden cost with Mem0 and Cognee is ongoing API consumption: both run LLM calls for extraction, doubling the per-turn token cost.
Can I use multiple OpenClaw memory plugins at the same time?
Yes. QMD and Cognee can run together (QMD handles text retrieval, Cognee handles relational queries). Mem0 can run alongside either. The Markdown files remain the shared foundation across all plugins. The tradeoff is token overhead: each retrieval system injects context into the prompt before every response, increasing input tokens and API costs.
Does BetterClaw include memory plugins?
BetterClaw includes hybrid vector plus keyword search (similar to QMD's approach) built into the platform with no plugin installation required. Persistent memory with automatic capture is part of the managed infrastructure. If you want Cognee's knowledge graph or Mem0's specific extraction features, those would need to be configured separately. For most users, BetterClaw's built-in memory handles the 80% use case without plugin management.
Related Reading
- OpenClaw Memory Fix Guide — Memory loss, OOM crashes, and the persistence problem
- OpenClaw Memory Compaction Explained — How LCM manages your active context window
- OpenClaw Session Length Is Costing You Money — How memory size affects your API bill
- The OpenClaw SOUL.md Guide — How system prompts interact with memory retrieval
- OpenClaw API Costs: What You'll Actually Pay — The cost impact of stacking memory plugins




