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

capacitor-lancedb

v0.2.0

Published

Native LanceDB vector database plugin for Capacitor — on-device vector search with ANN queries. Includes optional memory management layer.

Readme

capacitor-lancedb

npm version CI License: MIT

Native LanceDB vector database plugin for Capacitor — on-device vector search with ANN queries, powered by Rust FFI. Includes an optional memory management layer for AI agent workflows.

Features

  • On-device vector storage — no cloud dependency, all data stays on the device
  • Approximate nearest neighbor (ANN) search — fast similarity search via LanceDB
  • Generic vector DB APIstore, search, delete, list, clear
  • Optional memory layer — auto-recall, auto-capture, and agent tools for AI workflows
  • Prompt injection detection — built-in heuristics to filter unsafe stored content
  • Markdown file indexing — chunk and index MEMORY.md and workspace files
  • Cross-platform — Android (arm64) and iOS (arm64 + simulator)

Install

npm install capacitor-lancedb
npx cap sync

Quick Start

Vector DB API

import { LanceDB } from 'capacitor-lancedb'

// Open a database (auto-created if it doesn't exist)
await LanceDB.open({ dbPath: 'files://my-vectors', embeddingDim: 768 })

// Store a vector entry
await LanceDB.store({
  key: 'doc-1',
  agentId: 'default',
  text: 'The user prefers dark mode',
  embedding: [0.1, 0.2, ...], // your embedding vector
})

// Search by similarity
const { results } = await LanceDB.search({
  queryVector: [0.1, 0.2, ...],
  limit: 5,
})

// List, delete, clear
const { keys } = await LanceDB.list({ prefix: 'doc-' })
await LanceDB.delete({ key: 'doc-1' })
await LanceDB.clear()

MemoryManager (optional)

The MemoryManager wraps the plugin with embedding generation, auto-recall, auto-capture, and agent tools:

import { MemoryManager } from 'capacitor-lancedb'

const memory = new MemoryManager()
await memory.init({
  openaiApiKey: 'sk-...',  // for embeddings (falls back to local hash)
})

// Get agent tools to register with your AI engine
const tools = memory.getTools()

// Auto-recall: inject relevant memories before a turn
const context = await memory.recall('What theme does the user like?')

// Auto-capture: detect and store memorable content
await memory.capture('The user said they prefer dark mode.')

API

LanceDBPlugin

| Method | Description | |--------|-------------| | open({ dbPath, embeddingDim }) | Open or create a database | | store({ key, agentId, text, embedding, metadata? }) | Store a vector entry (upsert) | | search({ queryVector, limit, filter? }) | ANN search, returns SearchResult[] | | delete({ key }) | Delete an entry by key | | list({ prefix?, limit? }) | List keys, optionally filtered | | clear({ collection? }) | Drop all data |

The legacy memoryStore, memorySearch, memoryDelete, memoryList, and memoryClear methods are still available as deprecated aliases for backward compatibility.

MemoryManager Tools

The MemoryManager exposes 5 agent tools:

| Tool | Description | |------|-------------| | memory_recall | Semantic search across stored memories | | memory_store | Store a memory with duplicate detection | | memory_forget | Delete memories by search or key | | memory_search | Search file-indexed content only | | memory_get | Read MEMORY.md snippets |

E2E Tests

16/16 tests passing on both platforms — legacy memory* API (backward compat) + generic vector DB API:

Platforms

| Platform | Architecture | Binary | |----------|-------------|--------| | Android | arm64-v8a | liblancedb_ffi.so (41 MB) | | iOS | arm64 (device) | LanceDBFFI.xcframework | | iOS | arm64 (Apple Silicon sim) | LanceDBFFI.xcframework |

Prebuilt native binaries are included in the npm package. No Rust toolchain required for consumers.

Building Native Binaries

For contributors modifying the Rust FFI code:

# Android
./scripts/build-android.sh

# iOS
./scripts/build-ios.sh

See CONTRIBUTING.md for toolchain requirements.

Contributing

Contributions are welcome! Please read our Contributing Guide and Code of Conduct.

Security

To report vulnerabilities, see SECURITY.md.

License

MIT © 2025-present Techxagon