🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@noncelogic/openclaw-memory-lancedb

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@noncelogic/openclaw-memory-lancedb

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

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
6
20%
Maintainers
1
Weekly downloads
 
Created
Source

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

OptionTypeDefaultDescription
embedding.apiKeystringrequiredOpenAI API key (supports ${ENV_VAR} syntax)
embedding.modelstringtext-embedding-3-smallEmbedding model (text-embedding-3-small or text-embedding-3-large)
dbPathstring~/.openclaw/memory/lancedbLanceDB database path
autoRecallbooleantrueInject relevant memories before each response
autoCapturebooleanfalseAuto-store important user messages
captureMaxCharsnumber500Max message length for auto-capture (100-10000)

How It Works

Auto-Recall

Before every agent response, the plugin:

  • Embeds the user's message using OpenAI
  • Searches LanceDB for the top 3 most relevant memories (minimum 0.3 similarity)
  • 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:

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

Agent Tools

memory_recall

Search through stored memories.

ParameterTypeDefaultDescription
querystringrequiredSearch query
limitnumber5Max results

memory_store

Save information to long-term memory.

ParameterTypeDefaultDescription
textstringrequiredInformation to remember
importancenumber0.7Importance score (0-1)
categorystring"other"One of: preference, fact, decision, entity, other

memory_forget

Delete memories by ID or search query.

ParameterTypeDescription
querystringSearch to find memory candidates
memoryIdstringSpecific 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

Keywords

openclaw

FAQs

Package last updated on 23 Feb 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts