Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
win4r avatar

Memory Lancedb Pro

  • 642 installs
  • 47 repo stars
  • Updated February 28, 2026
  • win4r/memory-lancedb-pro-skill

memory-lancedb-pro is a developer skill that guides maintenance, debugging, and upgrades of the LanceDB-backed memory-lancedb-pro OpenClaw plugin with hybrid vector and BM25 retrieval.

About

memory-lancedb-pro is a comprehensive skill for the memory-lancedb-pro OpenClaw plugin, an enhanced LanceDB-backed long-term memory system. The skill covers hybrid retrieval combining vector search and BM25, RRF fusion, cross-encoder reranking, multi-scope isolation, noise filtering, adaptive retrieval, and a management CLI. Developers use it when adding features, fixing bugs, modifying retrieval stages, changing embedding providers, updating scope and access control, or troubleshooting memory quality. The workflow spans vector search tuning, scoring stages, agent tools, and CLI command changes. Reach for this skill when building or operating production-grade agent memory rather than generic database CRUD tasks.

  • 9 distinct maintenance and development triggers including retrieval pipeline changes and embedding provider updates
  • Hybrid retrieval with Vector + BM25, cross-encoder reranking, and RRF fusion
  • Multi-scope memory isolation with noise filtering and adaptive retrieval
  • Management CLI plus JSONL session distillation pipeline
  • Architecture reference for planning enhancements and data migrations between memory backends

Memory Lancedb Pro by the numbers

  • 642 all-time installs (skills.sh)
  • +3 installs in the week ending Jul 27, 2026 (Skillselion tracking)
  • Ranked #1,524 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Security screen: HIGH risk (skills.sh audit)
  • Data as of Jul 27, 2026 (Skillselion catalog sync)
npx skills add https://github.com/win4r/memory-lancedb-pro-skill --skill memory-lancedb-pro

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs642
repo stars47
Security audit3 / 3 scanners passed
Last updatedFebruary 28, 2026
Repositorywin4r/memory-lancedb-pro-skill

How do you debug hybrid LanceDB agent memory retrieval?

Maintain, debug, and upgrade the memory-lancedb-pro long-term memory plugin for OpenClaw agents.

Who is it for?

Developers maintaining the memory-lancedb-pro OpenClaw plugin who need deep retrieval-pipeline and CLI expertise.

Skip if: Developers who only need generic MongoDB or Postgres storage without agent memory retrieval pipelines.

When should I use this skill?

The user modifies memory-lancedb-pro features, retrieval stages, embeddings, scope logic, CLI tools, or memory quality issues.

What you get

Updated retrieval pipeline, embedding provider config, scope rules, CLI commands, and validated memory quality fixes.

  • retrieval pipeline changes
  • scope and CLI updates
  • memory quality fixes

Files

SKILL.mdMarkdownGitHub ↗

memory-lancedb-pro Plugin Maintenance Guide

Overview

memory-lancedb-pro is an enhanced long-term memory plugin for OpenClaw. It replaces the built-in memory-lancedb plugin with advanced retrieval capabilities, multi-scope memory isolation, and a management CLI.

Repository: https://github.com/win4r/memory-lancedb-pro License: MIT | Language: TypeScript (ESM) | Runtime: Node.js via OpenClaw Gateway

Architecture

┌─────────────────────────────────────────────────────────┐
│                   index.ts (Entry Point)                │
│  Plugin Registration · Config Parsing · Lifecycle Hooks │
└────────┬──────────┬──────────┬──────────┬───────────────┘
         │          │          │          │
    ┌────▼───┐ ┌────▼───┐ ┌───▼────┐ ┌──▼──────────┐
    │ store  │ │embedder│ │retriever│ │   scopes    │
    │ .ts    │ │ .ts    │ │ .ts    │ │    .ts      │
    └────────┘ └────────┘ └────────┘ └─────────────┘
         │                     │
    ┌────▼───┐           ┌─────▼──────────┐
    │migrate │           │noise-filter.ts │
    │ .ts    │           │adaptive-       │
    └────────┘           │retrieval.ts    │
                         └────────────────┘
    ┌─────────────┐   ┌──────────┐
    │  tools.ts   │   │  cli.ts  │
    │ (Agent API) │   │ (CLI)    │
    └─────────────┘   └──────────┘

File Reference (Quick Navigation)

FilePurposeKey Exports
index.tsPlugin entry point. Registers with OpenClaw Plugin API, parses config, mounts lifecycle hooksmemoryLanceDBProPlugin (default), shouldCapture, detectCategory
openclaw.plugin.jsonPlugin metadata + full JSON Schema config with uiHints
package.jsonNPM package. Deps: @lancedb/lancedb, openai, @sinclair/typebox
cli.tsCLI: memory-pro list/search/stats/delete/delete-bulk/export/import/reembed/migratecreateMemoryCLI, registerMemoryCLI
src/store.tsLanceDB storage layer. Table creation, FTS indexing, CRUD, vector/BM25 searchMemoryStore, MemoryEntry, loadLanceDB
src/embedder.tsEmbedding abstraction. OpenAI-compatible API, task-aware, LRU cacheEmbedder, createEmbedder, getVectorDimensions
src/retriever.tsHybrid retrieval engine. Full scoring pipelineMemoryRetriever, createRetriever, DEFAULT_RETRIEVAL_CONFIG
src/scopes.tsMulti-scope access controlMemoryScopeManager, createScopeManager
src/tools.tsAgent tool definitions: memory_recall/store/forget/update/stats/listregisterAllMemoryTools
src/noise-filter.tsNoise filter for low-quality contentisNoise, filterNoise
src/adaptive-retrieval.tsSkip retrieval for greetings, commands, emojishouldSkipRetrieval
src/migrate.tsMigration from legacy memory-lancedbMemoryMigrator, createMigrator
scripts/jsonl_distill.pyJSONL session distillation script (Python)

Core Subsystem Reference

For detailed deep-dives into each subsystem, read the appropriate reference file:

  • Retrieval Pipeline (scoring math, RRF fusion, reranking, all scoring stages): See references/retrieval_pipeline.md
  • Storage & Data Model (LanceDB schema, FTS indexing, CRUD, vector dim): See references/storage_and_schema.md
  • Embedding System (providers, task-aware API, caching, dimensions): See references/embedding_system.md
  • Plugin Lifecycle & Config (hooks, registration, config parsing): See references/plugin_lifecycle.md
  • Scope System (multi-scope isolation, agent access, patterns): See references/scope_system.md
  • Tools & CLI (agent tools, CLI commands, parameters): See references/tools_and_cli.md
  • Common Gotchas & Troubleshooting: See references/troubleshooting.md

Development Workflows

Adding a New Embedding Provider

1. Check if it's OpenAI-compatible (most are). If so, no code change needed — just config 2. If the model is not in EMBEDDING_DIMENSIONS map in src/embedder.ts, add it 3. If the provider needs special request fields beyond task and normalized, extend buildPayload() in src/embedder.ts 4. Test with embedder.test() method 5. Document the provider in README.md table

Adding a New Rerank Provider

1. Add provider name to RerankProvider type in src/retriever.ts 2. Add case in buildRerankRequest() for request format (headers + body) 3. Add case in parseRerankResponse() for response parsing 4. Add to rerankProvider enum in openclaw.plugin.json 5. Test with actual API calls — reranker has 5s timeout protection

Adding a New Scoring Stage

1. Create a private apply<StageName>(results: RetrievalResult[]): RetrievalResult[] method in MemoryRetriever 2. Add corresponding config fields to RetrievalConfig interface 3. Insert the stage in the pipeline sequence in both hybridRetrieval() and vectorOnlyRetrieval() 4. Add defaults to DEFAULT_RETRIEVAL_CONFIG 5. Add JSON Schema fields to openclaw.plugin.json 6. Pipeline order: Fusion → Rerank → Recency → Importance → LengthNorm → TimeDecay → HardMin → Noise → MMR

Adding a New Agent Tool

1. Create registerMemory<ToolName>Tool() in src/tools.ts 2. Define parameters with Type.Object() from @sinclair/typebox 3. Use stringEnum() from openclaw/plugin-sdk for enum params 4. Always validate scope access via context.scopeManager 5. Register in registerAllMemoryTools() — decide if core (always) or management (optional) 6. Return { content: [{ type: "text", text }], details: {...} }

Adding a New CLI Command

1. Add command in registerMemoryCLI() in cli.ts 2. Pattern: memory.command("name <args>").description("...").option("--flag", "...").action(async (args, opts) => { ... }) 3. Support --json flag for machine-readable output 4. Use process.exit(1) for error cases 5. CLI is registered via api.registerCli() in index.ts

Modifying Auto-Capture Logic

1. shouldCapture(text) in index.ts controls what gets auto-captured 2. MEMORY_TRIGGERS regex array defines trigger patterns (supports EN/CJK) 3. detectCategory(text) classifies captures as preference/fact/decision/entity/other 4. Auto-capture runs in agent_end hook, limited to 3 per turn 5. Duplicate detection threshold: cosine similarity > 0.95

Modifying Auto-Recall Logic

1. Auto-recall uses before_agent_start hook (OFF by default) 2. shouldSkipRetrieval() from src/adaptive-retrieval.ts gates retrieval 3. Injected as <relevant-memories> XML block with UNTRUSTED DATA warning 4. sanitizeForContext() strips HTML, newlines, limits to 300 chars per memory 5. Max 3 memories injected per turn

Key Design Decisions

  • autoRecall defaults to OFF — prevents model from echoing injected memory context
  • autoCapture defaults to ON — transparent memory accumulation
  • sessionMemory defaults to OFF — raw session summaries degrade retrieval quality; use JSONL distillation instead
  • LanceDB dynamic import — loaded asynchronously to avoid blocking; cached in singleton promise
  • Startup checks are fire-and-forget — gateway binds HTTP port immediately; embedding/retrieval tests run in background with 8s timeout
  • Daily JSONL backup — 24h interval, keeps last 7 files, runs 1 min after start
  • BM25 score normalization — raw BM25 scores are unbounded, normalized with sigmoid: 1 / (1 + exp(-score/5))
  • Update = delete + re-add — LanceDB doesn't support in-place updates
  • ID prefix matching — 8+ hex char prefix resolves to full UUID for user convenience
  • CJK-aware thresholds — shorter minimum lengths for Chinese/Japanese/Korean text (4–6 chars vs 10–15 for English)
  • Env var resolution${VAR} syntax resolved at config parse time; gateway service may not inherit shell env

Testing

  • Smoke test: node test/cli-smoke.mjs
  • Manual verification: openclaw plugins doctor, openclaw memory-pro stats
  • Embedding test: embedder.test() returns { success, dimensions, error? }
  • Retrieval test: retriever.test() returns { success, mode, hasFtsSupport, error? }

Related skills

How it compares

Choose memory-lancedb-pro over generic vector-database skills when the task targets the OpenClaw plugin retrieval pipeline and management CLI.

FAQ

What retrieval methods does memory-lancedb-pro use?

memory-lancedb-pro uses hybrid retrieval combining vector search and BM25 with RRF fusion, cross-encoder reranking, noise filtering, and adaptive retrieval. The skill helps developers modify and debug each scoring stage.

When should I use the memory-lancedb-pro skill?

Use memory-lancedb-pro when developing features, fixing bugs, changing embedding providers, updating scope access control, or troubleshooting memory quality in the OpenClaw plugin. It is not for unrelated database work.

Is Memory Lancedb Pro safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

AI & Agent Buildingagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.