memory-lancedb-pro

win4r/memory-lancedb-pro-skill · updated Apr 8, 2026

MDX-style export adds YAML metadata + attribution linking explainx.ai and this canonical listing URL.

$npx skills add https://github.com/win4r/memory-lancedb-pro-skill --skill memory-lancedb-pro
0 commentsdiscussion
summary

$22

skill.md

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)

File Purpose Key Exports
index.ts Plugin entry point. Registers with OpenClaw Plugin API, parses config, mounts lifecycle hooks memoryLanceDBProPlugin (default), shouldCapture, detectCategory
openclaw.plugin.json Plugin metadata + full JSON Schema config with uiHints
package.json NPM package. Deps: @lancedb/lancedb, openai, @sinclair/typebox
cli.ts CLI: memory-pro list/search/stats/delete/delete-bulk/export/import/reembed/migrate createMemoryCLI, registerMemoryCLI
src/store.ts LanceDB storage layer. Table creation, FTS indexing, CRUD, vector/BM25 search MemoryStore, MemoryEntry, loadLanceDB
src/embedder.ts Embedding abstraction. OpenAI-compatible API, task-aware, LRU cache Embedder, createEmbedder, getVectorDimensions
src/retriever.ts Hybrid retrieval engine. Full scoring pipeline MemoryRetriever, createRetriever, DEFAULT_RETRIEVAL_CONFIG
src/scopes.ts Multi-scope access control MemoryScopeManager, createScopeManager
src/tools.ts Agent tool definitions: memory_recall/store/forget/update/stats/list registerAllMemoryTools
src/noise-filter.ts Noise filter for low-quality content isNoise, filterNoise
src/adaptive-retrieval.ts Skip retrieval for greetings, commands, emoji shouldSkipRetrieval
src/migrate.ts Migration from legacy memory-lancedb MemoryMigrator, createMigrator
scripts/jsonl_distill.py JSONL session distillation script (Python)

Core Subsystem Reference

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

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? }
how to use memory-lancedb-pro

How to use memory-lancedb-pro on Cursor

AI-first code editor with Composer

1

Prerequisites

Before installing skills in Cursor, ensure your development environment meets these requirements:

  • Cursor installed and configured on your development machine
  • Node.js version 16.0+ with npm package manager (verify with node --version)
  • Active project directory or workspace where you want to add memory-lancedb-pro
2

Execute installation command

Execute the skills CLI command in your project's root directory to begin installation:

$npx skills add https://github.com/win4r/memory-lancedb-pro-skill --skill memory-lancedb-pro

The skills CLI fetches memory-lancedb-pro from GitHub repository win4r/memory-lancedb-pro-skill and configures it for Cursor.

3

Select Cursor when prompted

The CLI will show a list of available agents. Use arrow keys to navigate and space to select Cursor:

◆ Which agents do you want to install to?
│ ── Universal (.agents/skills) ── always included ────
│ • Amp
│ • Antigravity
│ • Cline
│ • Codex
│ ●Cursor(selected)
│ • Cursor
│ • Windsurf
4

Verify installation

Confirm successful installation by checking the skill directory location:

.cursor/skills/memory-lancedb-pro

Reload or restart Cursor to activate memory-lancedb-pro. Access the skill through slash commands (e.g., /memory-lancedb-pro) or your agent's skill management interface.

Security & Verification Notice

We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.

Skills execute code in your development environment. Always verify the publisher's identity, review recent commits, and test in isolated environments before production deployment.

List & Monetize Your Skill

Submit your Claude Code skill and start earning

GET_STARTED →

Use Cases

User Story & Requirements Generation

Create detailed user stories, acceptance criteria, and feature specs

Example

Generate user stories for 'password reset feature' with acceptance criteria, edge cases, and test scenarios

Reduce spec writing time by 50%, ensure comprehensive coverage

Competitive Analysis

Research competitors, compare features, identify gaps

Example

Analyze 5 competitor products, create feature comparison matrix, suggest differentiation opportunities

Complete competitive research in 2 hours instead of 2 days

Roadmap Prioritization

Evaluate features using frameworks (RICE, ICE, Kano) and create prioritized backlogs

Example

Score 20 feature ideas using RICE framework, generate prioritized roadmap with rationale

Make data-driven prioritization decisions faster

Stakeholder Communication

Draft PRDs, status updates, and stakeholder presentations

Example

Create executive summary of Q3 roadmap, monthly progress report, feature launch announcement

Save 3-5 hours/week on communication overhead

Implementation Guide

Prerequisites

  • Claude Desktop or compatible AI client
  • Access to product documentation and roadmap tools (Jira, Notion, etc.)
  • Understanding of product management frameworks (RICE, Jobs-to-be-Done, etc.)
  • Stakeholder contact information and communication channels

Time Estimate

30-60 minutes to see productivity improvements

Installation Steps

  1. 1.Install product management skill
  2. 2.Start with user story generation for known feature
  3. 3.Progress to competitive analysis: research 2-3 competitors
  4. 4.Use for roadmap prioritization: apply RICE/ICE scoring
  5. 5.Draft stakeholder communications and refine based on feedback
  6. 6.Build template library for recurring PM tasks
  7. 7.Share effective prompts with product team

Common Pitfalls

  • Not validating competitive research—verify facts before sharing
  • Accepting user stories without involving engineering team
  • Over-relying on frameworks without qualitative judgment
  • Not customizing outputs to company culture and communication style
  • Skipping stakeholder validation of generated requirements

Best Practices

✓ Do

  • +Validate research and competitive analysis with real data
  • +Collaborate with engineering when generating technical requirements
  • +Customize frameworks and templates to your company context
  • +Use skill for first drafts, refine with stakeholder input
  • +Document successful prompt patterns for PM tasks
  • +Combine AI efficiency with human judgment and intuition

✗ Don't

  • Don't publish competitive analysis without fact-checking
  • Don't finalize user stories without engineering review
  • Don't make prioritization decisions solely on AI scoring
  • Don't skip customer validation of generated requirements
  • Don't ignore company-specific context and culture

💡 Pro Tips

  • Provide context: company goals, constraints, customer feedback
  • Ask for alternatives: 'Show 3 ways to prioritize this roadmap'
  • Request stakeholder-specific formatting: 'Executive summary vs. engineering spec'
  • Use skill for 70% generation + 30% customization to company needs

When to Use This

✓ Use When

Use for user story writing, competitive research, roadmap prioritization, stakeholder communication, and PRD drafting. Best for reducing repetitive documentation and research work.

✗ Avoid When

Avoid for strategic product vision (requires deep customer empathy), pricing decisions (needs market and financial expertise), or when face-to-face customer discovery is more valuable than speed.

Learning Path

  1. 1Basic: user stories, feature specs, status updates
  2. 2Intermediate: competitive analysis, prioritization frameworks, PRDs
  3. 3Advanced: product strategy, go-to-market planning, OKR setting
  4. 4Expert: product vision, market positioning, business model innovation

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.
general reviews

Ratings

4.461 reviews
  • Amelia Torres· Dec 28, 2024

    memory-lancedb-pro has been reliable in day-to-day use. Documentation quality is above average for community skills.

  • Amelia Abebe· Dec 28, 2024

    We added memory-lancedb-pro from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.

  • Daniel Li· Dec 24, 2024

    memory-lancedb-pro is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Kofi Perez· Dec 16, 2024

    Registry listing for memory-lancedb-pro matched our evaluation — installs cleanly and behaves as described in the markdown.

  • Meera Park· Dec 12, 2024

    Solid pick for teams standardizing on skills: memory-lancedb-pro is focused, and the summary matches what you get after install.

  • Yuki Kapoor· Dec 8, 2024

    Keeps context tight: memory-lancedb-pro is the kind of skill you can hand to a new teammate without a long onboarding doc.

  • Kofi Wang· Nov 27, 2024

    memory-lancedb-pro is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.

  • Maya Chawla· Nov 19, 2024

    memory-lancedb-pro fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.

  • Daniel Gill· Nov 19, 2024

    Solid pick for teams standardizing on skills: memory-lancedb-pro is focused, and the summary matches what you get after install.

  • Kofi Li· Nov 7, 2024

    Useful defaults in memory-lancedb-pro — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.

showing 1-10 of 61

1 / 7