Enhanced LanceDB memory plugin for OpenClaw — Hybrid Retrieval (Vector + BM25), Cross-Encoder Rerank, Multi-Scope Isolation, Management CLI
Enhanced LanceDB memory plugin for OpenClaw — Hybrid Retrieval (Vector + BM25), Cross-Encoder Rerank, Multi-Scope Isolation, Management CLI
Most AI agents have amnesia. They forget everything the moment you start a new chat.
memory-lancedb-pro is a production-grade long-term memory plugin for OpenClaw that turns your agent into an AI Memory Assistant — it automatically captures what matters, lets noise naturally fade, and retrieves the right memory at the right time. No manual tagging, no configuration headaches.
Without memory — every session starts from zero:
You: "Use tabs for indentation, always add error handling." (next session) You: "I already told you — tabs, not spaces!" (next session) You: "...seriously, tabs. And error handling. Again."
With memory-lancedb-pro — your agent learns and remembers:
You: "Use tabs for indentation, always add error handling." (next session — agent auto-recalls your preferences) Agent: (silently applies tabs + error handling) ✅ You: "Why did we pick PostgreSQL over MongoDB last month?" Agent: "Based on our discussion on Feb 12, the main reasons were..." ✅
That's the difference an AI Memory Assistant makes — it learns your style, recalls past decisions, and delivers personalized responses without you repeating yourself.
| What you get | |
|---|---|
| Auto-Capture | Your agent learns from every conversation — no manual memory_store needed |
| Smart Extraction | LLM-powered 6-category classification: profiles, preferences, entities, events, cases, patterns |
| Intelligent Forgetting | Weibull decay model — important memories stay, noise naturally fades away |
| Hybrid Retrieval | Vector + BM25 full-text search, fused with cross-encoder reranking |
| Context Injection | Relevant memories automatically surface before each reply |
| Multi-Scope Isolation | Per-agent, per-user, per-project memory boundaries |
| Any Provider | OpenAI, Jina, Gemini, Ollama, or any OpenAI-compatible API |
| Full Toolkit | CLI, backup, migration, upgrade, export/import — production-ready |
CPU Requirement: Your CPU must support AVX instructions. LanceDB native vector search may require AVX2 on some Linux x64 builds and can crash AVX-only CPUs with
SIGILL; setretrieval.disableNativeCosine: trueorMEMORY_LANCEDB_DISABLE_NATIVE_COSINE=1to use a scoped row scan plus JavaScript cosine ranking. Check CPU flags with:grep -o 'avx[^ ]*' /proc/cpuinfo | head -1(no output = not supported). See #419 and #644 for details.
The community-maintained setup script handles install, upgrade, and repair in one command:
curl -fsSL https://raw.githubusercontent.com/CortexReach/toolbox/main/memory-lancedb-pro-setup/setup-memory.sh -o setup-memory.sh
bash setup-memory.shSee Ecosystem below for the full list of scenarios the script covers and other community tools.
Via OpenClaw CLI (recommended):
openclaw plugins install memory-lancedb-pro@betaOr via npm:
npm i memory-lancedb-pro@betaIf using npm, you will also need to add the plugin's install directory as an absolute path in
plugins.load.pathsin youropenclaw.json. This is the most common setup issue.
Add to your openclaw.json:
…Why these defaults?
autoCapture + smartExtraction → your agent learns from every conversation automaticallyautoRecall → relevant memories are injected before each replyextractMinMessages: 2 → extraction triggers in normal two-turn chatssessionMemory.enabled: false → avoids polluting retrieval with session summaries on day oneWhen memory-lancedb-pro owns the OpenClaw memory slot, it now exposes one memory capability with two coordinated stores:
| Memory Layer | Storage | What it's for | Recallable? |
|---|---|---|---|
| Plugin Memory | LanceDB (vector store) | Semantic recall via memory_recall / auto-recall |
✅ Yes |
| Canonical Corpus | MEMORY.md, memory/**/*.md, recent session transcripts, memory/dreaming/**/*.md |
Source-of-truth files and public artifacts | ✅ Via LanceDB semantic index when canonicalCorpus.enabled is true |
Key principle:
Canonical files remain the source of truth. LanceDB is the semantic index used to retrieve them with grounded paths, line spans, snippets, and citations.
What this means for you:
memory_store or let auto-capture do itmemory/YYYY-MM-DD.md → treat as a daily journal / log that can also be indexed for semantic lookupMEMORY.md → curated human-readable reference that can be indexed as canonical contextmemory/dreaming/**/*.md → dream reports exposed as public artifacts and indexed as reflection contextsource: "sessions" when canonicalCorpus.includeSessionTranscripts is enabledOpenClaw hosts receive:
api.registerMemoryCapability({ runtime, promptBuilder, flushPlanResolver, publicArtifacts })path, startLine, endLine, snippet, source, and citationMEMORY.md, memory/**/*.md, dream reports, and the dreaming event log at memory/.dreams/events.jsonlDreaming compatibility is configured under the same plugin entry. If dreaming.enabled is true while this plugin owns plugins.slots.memory, OpenClaw can use the memory-core dreaming sidecar against this plugin's memory capability and public artifacts.
Validate & restart:
openclaw config validate
openclaw gateway restart
openclaw logs --follow --plain | grep "memory-lancedb-pro"You should see:
memory-lancedb-pro: smart extraction enabledmemory-lancedb-pro@...: plugin registeredDone! Your agent now has long-term memory.
More installation paths (existing users, upgrades)Already using OpenClaw?
plugins.load.paths entryplugins.slots.memory = "memory-lancedb-pro"openclaw plugins info memory-lancedb-pro && openclaw memory-pro statsUpgrading from pre-v1.1.0?
# 1) Backup
openclaw memory-pro export --scope global --output memories-backup.json
# 2) Dry run
openclaw memory-pro upgrade --dry-run
# 3) Run upgrade
openclaw memory-pro upgrade
# 4) Verify
openclaw memory-pro statsSee CHANGELOG-v1.1.0.md for behavior changes and upgrade rationale.
Turning on Jina task hints on an existing database?
Task hints are two config keys under the plugin's embedding block:
"memory-lancedb-pro": {
"config": {
"embedding": {
"model": "jina-embeddings-v5-text-small",
"taskQuery": "retrieval.query",
"taskPassage": "retrieval.passage"
}
}
}They only affect vectors written after you set them. Rows already in your store
were embedded without a task hint, so a query embedded with retrieval.query is
compared against passages that live in a different vector space — you get roughly
half the benefit, silently.
To fix existing rows, re-embed into a fresh database and cut over to it. Do
not re-embed in place: reembed writes each row with table.add() (append by
id, not replace), so an in-place run — which is exactly what --force unlocks —
leaves the old vector beside the new one and doubles every row; retries pile on
more. reembed refuses same-path runs unless you force it, for this reason.
…The same cutover applies whenever you change embedding.model or
embedding.dimensions — always re-embed into a fresh dbPath, never in place.
If you are using OpenClaw's Telegram integration, the easiest way is to send an import command directly to the main Bot instead of manually editing config.
Send this message:
…memory-lancedb-pro is the core plugin. The community has built tools around it to make setup and daily use even smoother:
Not just a simple installer — the script intelligently handles a wide range of real-world scenarios:
| Your situation | What the script does |
|---|---|
| Never installed | Fresh download → install deps → pick config → write to openclaw.json → restart |
Installed via git clone, stuck on old commit |
Auto git fetch + checkout to latest → reinstall deps → verify |
| Config has invalid fields | Auto-detect via schema filter, remove unsupported fields |
Installed via npm |
Skips git update, reminds you to run npm update yourself |
openclaw CLI broken due to invalid config |
Fallback: read workspace path directly from openclaw.json file |
extensions/ instead of plugins/ |
Auto-detect plugin location from config or filesystem |
| Already up to date | Run health checks only, no changes |
bash setup-memory.sh # Install or upgrade
bash setup-memory.sh --dry-run # Preview only
bash setup-memory.sh --beta # Include pre-release versions
bash setup-memory.sh --uninstall # Revert config and remove pluginBuilt-in provider presets: Jina / DashScope / SiliconFlow / OpenAI / Ollama, or bring your own OpenAI-compatible API. For full usage (including --ref, --selfcheck-only, and more), see the setup script README.
Install this skill and your AI agent (Claude Code or OpenClaw) gains deep knowledge of every feature in memory-lancedb-pro. Just say "help me enable the best config" and get:
memory_recall, memory_store, memory_forget, memory_update, memory_stats, memory_list, self_improvement_log, self_improvement_extract_skill, self_improvement_review (full toolset requires enableManagementTools: true — the default Quick Start config exposes the 4 core tools)autoRecall default-false, jiti cache, env vars, scope isolation, and moreInstall for Claude Code:
git clone https://github.com/CortexReach/memory-lancedb-pro-skill.git ~/.claude/skills/memory-lancedb-proInstall for OpenClaw:
git clone https://github.com/CortexReach/memory-lancedb-pro-skill.git ~/.openclaw/workspace/skills/memory-lancedb-pro-skillFull walkthrough: installation, configuration, and hybrid retrieval internals. https://youtu.be/MtukF1C8epQ https://www.bilibili.com/video/BV1zUf2BGEgn/
…File Reference (click to expand)For a deep-dive into the full architecture, see docs/memory_architecture_analysis.md.
| File | Purpose |
|---|---|
index.ts |
Plugin entry point. Registers with Op |
No open issues yet, or sync has not completed.