lancedb

LanceDB 嵌入式向量数据库——无服务器、零配置的 AI 应用向量搜索。适用于无需服务器的向量搜索、嵌入式或本地向量数据库、文件内向量搜索、轻量级 RAG 存储以及表创建、向量搜索、全文搜索、混合搜索和多模态嵌入的场景。

仓库最近推送
GitHub Stars
219
Forks
38
Issues / PRs
1

安装方式

先用 Prompt 核对来源与依赖。也可下载安装包。

用 AI 助手安装

复制提示词,让助手先核对固定版本和依赖。

查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "lancedb":https://skillpi.com/zh/skills/deepskill-36c211cd86bf787c3d1d1e0e1c485412068541dbc8d4fbf8ab530ce30117c778。安装前核对上游来源和版本:https://github.com/TerminalSkills/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。

来源与配置

github.com

配置方式待核实

请查看原始来源中的适用工具、依赖和权限要求。

安装实测待补充

LanceDB 嵌入式向量数据库——无服务器、零配置的 AI 应用向量搜索。适用于无需服务器的向量搜索、嵌入式或本地向量数据库、文件内向量搜索、轻量级 RAG 存储以及表创建、向量搜索、全文搜索、混合搜索和多模态嵌入的场景。

0 下载

介绍来源: third_party · TerminalSkills · 1.0.0 参考来源

SkillPi 解读

适合谁
翻译待完成,请参阅来源文档。
软件、账号及付费要求
翻译待完成,请参阅来源文档。
实测状态
未测试

文件浏览

在原站浏览文件 ↗

原始 SKILL.md

打开原文 ↗
Frontmatter
name: lancedb
description: >-
  Embedded vector database with LanceDB — serverless, zero-config vector search
  for AI applications. Use when someone asks to "vector search without a server",
  "embedded vector database", "LanceDB", "local vector search", "serverless
  vector DB", "vector search in a file", or "lightweight RAG storage". Covers
  table creation, vector search, full-text search, hybrid search, and multimodal
  embeddings.
license: Apache-2.0
compatibility: "Node.js/Python. Runs locally (embedded) or serverless cloud."
metadata:
  author: terminal-skills
  version: "1.0.0"
  category: data-ai
  tags: ["vector", "embedded-db", "lancedb", "rag", "search"]

LanceDB

Overview

LanceDB is an embedded vector database — it runs inside your application process with zero external dependencies. No Docker containers, no servers, no connection strings. Data is stored in Lance format (columnar, optimized for ML) on local disk or object storage (S3). Perfect for prototyping, edge deployments, and applications where running a separate vector database is overkill.

When to Use

  • RAG prototypes and local development (no infrastructure to set up)
  • Edge/embedded applications that need vector search
  • Desktop apps and CLI tools with AI features
  • Projects too small for Pinecone/Qdrant but need more than arrays
  • Multimodal search (text + images in same index)

Instructions

Setup

npm install @lancedb/lancedb
# Optional: for automatic embedding generation
npm install @lancedb/lancedb openai

Basic Usage

// db.ts — Create a LanceDB table and search
import * as lancedb from "@lancedb/lancedb";

// Connect to local database (creates directory if needed)
const db = await lancedb.connect("./my-vector-db");

// Create a table with data
const data = [
  { id: 1, text: "The cat sat on the mat", vector: [0.1, 0.2, 0.3, ...] },
  { id: 2, text: "Dogs are loyal companions", vector: [0.4, 0.5, 0.6, ...] },
  { id: 3, text: "Fish swim in the ocean", vector: [0.7, 0.8, 0.9, ...] },
];

const table = await db.createTable("documents", data);

// Vector search — find similar items
const results = await table
  .vectorSearch([0.1, 0.2, 0.3, ...])  // Query vector
  .limit(5)
  .toArray();

// results: [{ id: 1, text: "The cat sat on the mat", _distance: 0.001 }, ...]

With Automatic Embeddings

// auto-embed.ts — LanceDB generates embeddings automatically
import * as lancedb from "@lancedb/lancedb";
import { getRegistry } from "@lancedb/lancedb/embeddings";

const openai = getRegistry().get("openai")!.create({
  model: "text-embedding-3-small",
});

const db = await lancedb.connect("./my-db");

// Define schema with embedding function
const schema = lancedb
  .schema([
    lancedb.field("id", new lancedb.Int32()),
    lancedb.field("text", new lancedb.Utf8(), openai.sourceField()),
    lancedb.field("vector", openai.vectorField()),  // Auto-generated
  ]);

const table = await db.createTable("docs", [
  { id: 1, text: "How to set up authentication" },
  { id: 2, text: "Database migration guide" },
  { id: 3, text: "Deploying to production" },
], { schema });

// Search with text — embedding generated automatically
const results = await table
  .search("how do I deploy my app?")
  .limit(3)
  .toArray();

Full-Text + Vector Hybrid Search

// hybrid.ts — Combine keyword and semantic search
const table = await db.openTable("documents");

// Create full-text search index
await table.createIndex("text", { config: lancedb.Index.fts() });

// Hybrid search: combines vector similarity + keyword matching
const results = await table
  .search("deploy production", { queryType: "hybrid" })
  .limit(10)
  .toArray();

Filtering

// filter.ts — Vector search with metadata filters
const results = await table
  .vectorSearch(queryVector)
  .where("category = 'docs' AND created_at > '2026-01-01'")
  .limit(10)
  .toArray();

Examples

Example 1: Build a local RAG chatbot

User prompt: "Build a chatbot that answers questions about local documents without any external services."

The agent will use LanceDB embedded to store document embeddings locally, build a search function, and connect to a local LLM (Ollama) for generation.

Example 2: Semantic search for a CLI tool

User prompt: "Add semantic search to my note-taking CLI so I can find notes by meaning."

The agent will create a LanceDB database in the app's data directory, embed notes on save, and add a search command that finds semantically similar notes.

Guidelines

  • Embedded = no server — runs in your process, data in a directory
  • Lance format — columnar, compressed, fast for ML workloads
  • S3-compatible storage — lancedb.connect("s3://bucket/path") for cloud
  • Auto-embeddings — register an embedding function, never manually embed again
  • Hybrid search — combine vector + full-text for best results
  • Filtering with SQL-like syntax — where("category = 'docs'")
  • IVF-PQ index for scale — create index when table exceeds 100K rows
  • Data versioning built-in — Lance format supports time travel
  • No connection pooling — it's embedded, just open and use
  • Great for prototyping — start with LanceDB, migrate to hosted if needed

当前收录版本

1.0.0

核对来源版本 ↗

安全与评测信息

质量评测

满分100 · 来自 SkillPi LAB 实验室的评测报告。

场景价值92/100

亮点

  • 提供 LanceDB 嵌入式向量数据库的完整端到端使用指南
  • 覆盖 RAG 原型、边缘应用、桌面工具等高频刚需场景
  • 支持自动嵌入、混合搜索、过滤等高级功能
触发精准95/100

亮点

  • 触发词覆盖全面且边界清晰
  • 准确描述核心功能和使用场景
结构规范94/100

待提升项

  • description 内容重复 原报告严重程度:轻微

    顶层 frontmatter 和 skill_body 内部均包含 description,内容一致但属冗余

    改进建议:建议保留一处 description 以避免重复

亮点

  • 文档结构清晰完整,包含完整的使用流程和示例
  • frontmatter 信息完整,包含 license、compatibility、metadata 等
执行可靠93/100

待提升项

  • 缺少错误处理示例 原报告严重程度:轻微

    代码示例未展示连接失败、表不存在等常见异常的处理方式

    改进建议:建议添加 try-catch 示例和常见错误处理指南

亮点

  • 工具来源明确,参数使用正确
  • 代码示例完整可执行,涵盖主要使用场景
证据可验 (前四项均值)94/100

取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。

正文静态检测

100 / 100 · skillpi-20261123-no-r3-v1

正文未命中当前规则。

分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。

权限与使用前检查

根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。

  • 安装或获取外部依赖

    使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。

    主文档提及 · 第 38, 40 行

本站展示提示不会授予权限。涉及文件改动、密钥、外部发送或费用时,仍由你使用的工具按需确认。

安全评级与访问范围

safe · 静态证据核验,不代表运行安全保证。

翻译待完成,请参阅来源文档。

使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。