memory-lancedb-pro: Give Your OpenClaw Agent a Brain That Actually Remembers
TL;DR: memory-lancedb-pro is a drop-in replacement for OpenClaw’s built-in memory plugin. It adds hybrid retrieval (vector + BM25), cross-encoder reranking, automatic memory extraction via LLM, Weibull decay for memory lifecycle, and multi-scope isolation. Install with
npm i memory-lancedb-pro@betaand configure inopenclaw.json.
Most AI agents have amnesia. They forget everything the moment you start a new chat. memory-lancedb-pro fixes that — and it’s not just another memory plugin.
What Problem Does memory-lancedb-pro Solve?
OpenClaw ships with a basic memory-lancedb plugin. It works. You can store memories and retrieve them with vector search. But if you’ve used it in production, you’ve hit the walls:
- Vector-only retrieval misses exact matches (“What was the API key format we discussed?”)
- No memory lifecycle — everything stays forever, cluttering retrieval
- No isolation — memories bleed across agents, users, and projects
- Manual extraction — you have to explicitly call
memory_store
memory-lancedb-pro addresses all of this.
What Makes memory-lancedb-pro Different?
How Does Hybrid Retrieval Work?
The retrieval pipeline is sophisticated:
- Vector search finds semantically similar memories
- BM25 full-text search catches exact keyword matches
- RRF fusion combines both result sets
- Cross-encoder reranking (Jina or custom) refines the final ranking
- Recency boost + time decay surfaces recent relevant memories
- MMR diversity prevents redundant results
This hybrid approach means your agent finds “the meeting with Sarah about the API” whether you search semantically or by keyword.
What is Weibull Decay in AI Memory?
Here’s the clever part: memories have a lifecycle.
- Fresh memories start in a probationary tier
- Accessed memories get promoted — importance increases
- Ignored memories decay following a Weibull distribution
- Stale memories eventually fade from retrieval (not deleted, just deprioritized)
This mimics how human memory works. Important things you reference often stay accessible. That random tangent from six months ago naturally fades.
How Does Smart Extraction Work?
Instead of manually calling memory_store, the plugin uses an LLM to automatically extract memories from conversations. It categorizes into 6 types:
- Facts and preferences
- Decisions and commitments
- Technical details
- Relationships and context
- Tasks and follow-ups
- Insights and learnings
With autoCapture: true and smartExtraction: true, your agent learns from every conversation without you doing anything.
How Does Multi-Scope Isolation Work?
Memories can be scoped to:
- Global — shared across everything
- Agent — per-agent boundaries
- User — per-user isolation
- Project — workspace-level separation
- Custom — arbitrary scopes you define
This is essential for multi-tenant deployments or when you have multiple agents with different purposes.
Quick Start
Installation is straightforward:
npm i memory-lancedb-pro@beta
Add to your openclaw.json:
{
"plugins": {
"slots": {
"memory": "memory-lancedb-pro"
},
"entries": {
"memory-lancedb-pro": {
"enabled": true,
"config": {
"embedding": {
"provider": "openai-compatible",
"apiKey": "${OPENAI_API_KEY}",
"model": "text-embedding-3-small"
},
"autoCapture": true,
"autoRecall": true,
"smartExtraction": true,
"extractMinMessages": 2
}
}
}
}
}
For optimal retrieval, use Jina for both embeddings and reranking:
{
"embedding": {
"provider": "openai-compatible",
"apiKey": "${JINA_API_KEY}",
"model": "jina-embeddings-v5-text-small",
"baseURL": "https://api.jina.ai/v1",
"dimensions": 1024,
"taskQuery": "retrieval.query",
"taskPassage": "retrieval.passage"
},
"retrieval": {
"mode": "hybrid",
"vectorWeight": 0.7,
"bm25Weight": 0.3,
"rerank": "cross-encoder",
"rerankProvider": "jina",
"rerankModel": "jina-reranker-v3",
"candidatePoolSize": 12,
"minScore": 0.6
}
}
Management CLI
The plugin includes a full operations toolkit:
# List memories
openclaw memory list --scope agent:main --limit 20
# Search memories
openclaw memory search "API authentication" --top 5
# View statistics
openclaw memory stats
# Export for backup
openclaw memory export --output memories.json
# Upgrade from legacy format
openclaw memory upgrade --dry-run
This isn’t a toy — it’s built for production use with backup, migration, and upgrade paths.
The Comparison
| Feature | Built-in memory-lancedb | memory-lancedb-pro |
|---|---|---|
| Vector search | ✅ | ✅ |
| BM25 full-text | ❌ | ✅ |
| Hybrid fusion | ❌ | ✅ |
| Cross-encoder rerank | ❌ | ✅ |
| Time decay | ❌ | ✅ |
| Multi-scope isolation | ❌ | ✅ |
| Smart extraction | ❌ | ✅ |
| Management CLI | ❌ | ✅ |
| Any embedding provider | Limited | ✅ |
When to Use This
Use memory-lancedb-pro if you:
- Run OpenClaw in production with real users
- Need memories to persist meaningfully over weeks/months
- Have multiple agents or users sharing infrastructure
- Want automatic memory extraction without manual calls
- Need hybrid search (semantic + keyword)
Stick with built-in if you:
- Just experimenting with OpenClaw
- Don’t need cross-session memory
- Prefer minimal configuration
The Bigger Picture
We’ve covered several approaches to agent memory on this blog:
- soul.py — file-based memory with RAG+RLM hybrid
- Memvid — single portable file, no database
- Modulizer pattern — index + modular files
memory-lancedb-pro is the OpenClaw-native answer. If you’re building on OpenClaw and want production-grade memory without leaving the ecosystem, this is it.
The Weibull decay is particularly interesting — it’s a principled approach to memory lifecycle that most systems ignore. Memories shouldn’t live forever with equal weight. The things you reference often should surface; the rest should gracefully fade.
Frequently Asked Questions
What is memory-lancedb-pro?
memory-lancedb-pro is a production-grade long-term memory plugin for OpenClaw that replaces the built-in memory-lancedb plugin. It provides hybrid retrieval (vector + BM25), cross-encoder reranking, automatic memory extraction, and multi-scope isolation for AI agents.
How does memory-lancedb-pro differ from the built-in OpenClaw memory?
The built-in memory-lancedb only offers vector search. memory-lancedb-pro adds BM25 full-text search, hybrid fusion, cross-encoder reranking, Weibull decay for memory lifecycle, LLM-powered smart extraction, multi-scope isolation, and a management CLI.
What is Weibull decay in AI agent memory?
Weibull decay is a statistical approach to memory lifecycle management. Memories that are frequently accessed get promoted and stay accessible, while unused memories gradually fade in retrieval priority. This mimics how human memory works — important things surface, stale information fades.
How do I install memory-lancedb-pro?
Install via npm with npm i memory-lancedb-pro@beta, then configure it in your openclaw.json by setting it as the memory slot and providing your embedding provider credentials (OpenAI, Jina, or any OpenAI-compatible API).
Does memory-lancedb-pro work with local embedding models?
Yes. memory-lancedb-pro supports any OpenAI-compatible embedding API, including local options like Ollama. Configure the baseURL and model in your embedding settings.
What embedding providers does memory-lancedb-pro support?
It supports OpenAI, Jina, Gemini, Ollama, and any OpenAI-compatible API. Jina is recommended for optimal hybrid retrieval since it offers both embeddings and cross-encoder reranking.
How does smart extraction work?
With smartExtraction: true, the plugin uses an LLM to automatically categorize and extract memories from conversations into 6 types: facts/preferences, decisions/commitments, technical details, relationships/context, tasks/follow-ups, and insights/learnings.
Can I isolate memories between different users or projects?
Yes. Multi-scope isolation lets you scope memories to global, per-agent, per-user, per-project, or custom boundaries. This is essential for multi-tenant deployments.
Links: