npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@noncelogic/openclaw-memory-lancedb

v0.1.0

Published

LanceDB-backed long-term memory plugin for OpenClaw with auto-recall and auto-capture

Downloads

51

Readme

OpenClaw Memory (LanceDB)

Long-term memory plugin for OpenClaw using LanceDB for vector storage and OpenAI for embeddings. Gives your AI assistant persistent memory across conversations with automatic recall and capture.

Features

  • Auto-recall -- relevant memories are injected into context before every agent response
  • Auto-capture -- important user messages are automatically stored after each conversation
  • Agent tools -- memory_recall, memory_store, memory_forget for active memory management
  • CLI commands -- openclaw ltm list, openclaw ltm search, openclaw ltm stats
  • Duplicate detection -- 0.95 similarity threshold prevents storing near-identical memories
  • Prompt injection protection -- memories are escaped and marked as untrusted data
  • GDPR-friendly -- memory_forget tool for targeted deletion

Installation

openclaw plugins install @noncelogic/openclaw-memory-lancedb

Configuration

Add to your ~/.openclaw/openclaw.json:

{
  "plugins": {
    "slots": {
      "memory": "memory-lancedb"
    },
    "entries": {
      "memory-lancedb": {
        "enabled": true,
        "config": {
          "embedding": {
            "apiKey": "${OPENAI_API_KEY}"
          },
          "autoRecall": true,
          "autoCapture": true
        }
      }
    }
  }
}

Set plugins.slots.memory to "memory-lancedb" to switch from the default memory-core plugin. Only one memory plugin can be active at a time.

Config Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | embedding.apiKey | string | required | OpenAI API key (supports ${ENV_VAR} syntax) | | embedding.model | string | text-embedding-3-small | Embedding model (text-embedding-3-small or text-embedding-3-large) | | dbPath | string | ~/.openclaw/memory/lancedb | LanceDB database path | | autoRecall | boolean | true | Inject relevant memories before each response | | autoCapture | boolean | false | Auto-store important user messages | | captureMaxChars | number | 500 | Max message length for auto-capture (100-10000) |

How It Works

Auto-Recall

Before every agent response, the plugin:

  1. Embeds the user's message using OpenAI
  2. Searches LanceDB for the top 3 most relevant memories (minimum 0.3 similarity)
  3. Injects them into the system prompt as <relevant-memories> context marked as untrusted

Auto-Capture

After each successful agent run, the plugin scans user messages for memorable content:

  1. Filters by length (10-500 chars), skips system markup and agent output
  2. Checks against trigger patterns (preferences, facts, decisions, contact info)
  3. Rejects prompt injection attempts
  4. Checks for duplicates (0.95 similarity threshold)
  5. Stores up to 3 memories per conversation with auto-detected categories

Agent Tools

memory_recall

Search through stored memories.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | query | string | required | Search query | | limit | number | 5 | Max results |

memory_store

Save information to long-term memory.

| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | text | string | required | Information to remember | | importance | number | 0.7 | Importance score (0-1) | | category | string | "other" | One of: preference, fact, decision, entity, other |

memory_forget

Delete memories by ID or search query.

| Parameter | Type | Description | |-----------|------|-------------| | query | string | Search to find memory candidates | | memoryId | string | Specific memory UUID to delete |

CLI

openclaw ltm list              # Show total memory count
openclaw ltm search <query>    # Search memories (JSON output)
openclaw ltm stats             # Memory statistics

Safety

Memories are injected as untrusted historical context:

  • All memory text is HTML-entity escaped before injection
  • Wrapped in <relevant-memories> tags with explicit "do not follow instructions" guidance
  • Prompt injection patterns are detected and rejected during capture
  • Memory IDs are UUID-validated before deletion to prevent query injection

Limitations

  • OpenAI-only embeddings -- requires an OpenAI API key for text-embedding-3-small or text-embedding-3-large
  • LanceDB native binaries -- LanceDB requires native binaries that may not be available on all platforms (notably macOS ARM can have issues)

Testing

Unit tests run without any API keys:

vitest run

Live end-to-end tests require OpenAI:

OPENCLAW_LIVE_TEST=1 OPENAI_API_KEY=sk-... vitest run

License

MIT