lancedb
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.
What this skill does
# 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
```bash
npm install @lancedb/lancedb
# Optional: for automatic embedding generation
npm install @lancedb/lancedb openai
```
### Basic Usage
```typescript
// 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
```typescript
// 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
```typescript
// 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
```typescript
// 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
Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts — single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score ≥ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.