# ๐ง memory-lancedb-pro ยท ๐ฆOpenClaw Plugin
**AI Memory Assistant for [OpenClaw](https://github.com/openclaw/openclaw) Agents**
*Give your AI agent a brain that actually remembers โ across sessions, across agents, across time.*
A LanceDB-backed OpenClaw memory plugin that stores preferences, decisions, and project context, then auto-recalls them in future sessions.
[](https://github.com/openclaw/openclaw)
[](https://github.com/openclaw/openclaw)
[](https://www.npmjs.com/package/memory-lancedb-pro)
[](https://lancedb.com)
[](LICENSE)
โ
Fully adapted for OpenClaw 2026.3+ new plugin architecture
๐ Uses before_prompt_build hooks (replacing deprecated before_agent_start)
๐ฉบ Run openclaw doctor --fix after upgrading
[English](README.md) | [็ฎไฝไธญๆ](README_CN.md) | [็น้ซไธญๆ](README_TW.md) | [ๆฅๆฌ่ช](README_JA.md) | [ํ๊ตญ์ด](README_KO.md) | [Franรงais](README_FR.md) | [Espaรฑol](README_ES.md) | [Deutsch](README_DE.md) | [Italiano](README_IT.md) | [ะ ัััะบะธะน](README_RU.md) | [Portuguรชs (Brasil)](README_PT-BR.md)
---
## Why memory-lancedb-pro?
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.
### Your AI Memory Assistant in Action
**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 else can it do?
| | 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 |
---
## Quick Start
> **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`; set `retrieval.disableNativeCosine: true` or `MEMORY_LANCEDB_DISABLE_NATIVE_COSINE=1` to 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](https://github.com/CortexReach/memory-lancedb-pro/issues/419) and [#644](https://github.com/CortexReach/memory-lancedb-pro/issues/644) for details.
### Option A: One-Click Install Script (Recommended)
The community-maintained **[setup script](https://github.com/CortexReach/toolbox/tree/main/memory-lancedb-pro-setup)** handles install, upgrade, and repair in one command:
```bash
curl -fsSL https://raw.githubusercontent.com/CortexReach/toolbox/main/memory-lancedb-pro-setup/setup-memory.sh -o setup-memory.sh
bash setup-memory.sh
```
> See [Ecosystem](#ecosystem) below for the full list of scenarios the script covers and other community tools.
### Option B: Manual Install
**Via OpenClaw CLI (recommended):**
```bash
openclaw plugins install memory-lancedb-pro@beta
```
**Or via npm:**
```bash
npm i memory-lancedb-pro@beta
```
> If using npm, you will also need to add the plugin's install directory as an **absolute** path in `plugins.load.paths` in your `openclaw.json`. This is the most common setup issue.
Add to your `openclaw.json`:
```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,
"canonicalCorpus": {
"enabled": true,
"syncOnSearch": true
},
"dreaming": {
"enabled": false
},
"extractMinMessages": 2,
"extractMaxChars": 8000,
"sessionMemory": { "enabled": false }
}
}
}
}
}
```
**Why these defaults?**
- `autoCapture` + `smartExtraction` โ your agent learns from every conversation automatically
- `autoRecall` โ relevant memories are injected before each reply
- `extractMinMessages: 2` โ extraction triggers in normal two-turn chats
- `sessionMemory.enabled: false` โ avoids polluting retrieval with session summaries on day one
---
## โ ๏ธ Memory Architecture (Important)
When `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:**
- Need semantic recall? โ Use `memory_store` or let auto-capture do it
- `memory/YYYY-MM-DD.md` โ treat as a **daily journal / log** that can also be indexed for semantic lookup
- `MEMORY.md` โ curated human-readable reference that can be indexed as canonical context
- `memory/dreaming/**/*.md` โ dream reports exposed as public artifacts and indexed as reflection context
- Session JSONL transcripts โ indexed as `source: "sessions"` when `canonicalCorpus.includeSessionTranscripts` is enabled
- Plugin memory โ primary write path for durable facts, preferences, decisions, and auto-captured memories
OpenClaw hosts receive:
- `api.registerMemoryCapability({ runtime, promptBuilder, flushPlanResolver, publicArtifacts })`
- runtime search results shaped as `path`, `startLine`, `endLine`, `snippet`, `source`, and `citation`
- public artifacts for `MEMORY.md`, `memory/**/*.md`, dream reports, and the dreaming event log at `memory/.dreams/events.jsonl`
Dreaming 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:
```bash
openclaw config validate
openclaw gateway restart
openclaw logs --follow --plain | grep "memory-lancedb-pro"
```
You should see:
- `memory-lancedb-pro: smart extraction enabled`
- `memory-lancedb-pro@...: plugin registered`
Done! Your agent now has long-term memory.