# LanceDB

> Embedded vector database for AI apps, built on the Lance columnar format

- Category: Retrieval & Knowledge (RAG) / Vector Databases
- Language: Rust
- Licence: Apache-2.0
- Repository: https://github.com/lancedb/lancedb
- Website: https://lancedb.com
- Canonical page: https://ai-tldr.dev/tools/lancedb/

## In short

LanceDB is an open-source vector database that runs in-process inside your application, similar in spirit to SQLite. Instead of running a separate server, you point it at a directory on local disk or object storage and it stores, indexes, and searches your embeddings there. It sits in the Vector Databases category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Rust and licensed Apache-2.0.

## Overview

LanceDB is an open-source vector database that runs in-process inside your application, similar in spirit to SQLite. Instead of running a separate server, you point it at a directory on local disk or object storage and it stores, indexes, and searches your embeddings there. It is built on top of the Lance columnar storage format.

It is meant for developers building AI and machine-learning features who need vector search without standing up and operating database infrastructure. Beyond plain vector similarity, it supports full-text search and SQL-style filtering, and it can store metadata and multimodal data such as text, images, and video alongside the vectors.

In the vector-database space, LanceDB sits in the embedded / in-process category. It offers Python, Node.js/TypeScript, and Rust SDKs, integrates with tools like LangChain, LlamaIndex, Pandas, and DuckDB, and can also be used through a managed cloud option when you outgrow local storage.

## What it does

- Embedded and in-process: runs inside your app against local disk or object storage, with no server to manage
- Vector similarity search across large datasets, plus full-text search and SQL filtering in one query path
- Stores vectors, metadata, and multimodal data (text, images, video, point clouds) together
- Built on the Lance columnar format for storage and analytics, with automatic data versioning
- SDKs for Python, Node.js/TypeScript, and Rust, plus a REST API
- Integrations with LangChain, LlamaIndex, Apache Arrow, Pandas, Polars, and DuckDB

## Getting started

Install the SDK for your language, connect to a local database directory, add some records with vectors, and run a search. The example below uses the Python SDK.

1. Install LanceDB

   Install the Python package with pip. Node.js and Rust SDKs are also available.

```bash
pip install lancedb
```

2. Connect, create a table, and search

   Connect to a local database directory, create a table with sample records that include vectors, and run a similarity search.

```python
import lancedb

# Connect to local database
uri = "ex_lancedb"
db = lancedb.connect(uri)

# Create table with sample data
data = [
    {"id": "1", "text": "knight", "vector": [0.9, 0.4, 0.8]},
    {"id": "2", "text": "ranger", "vector": [0.8, 0.4, 0.7]},
    {"id": "9", "text": "priest", "vector": [0.6, 0.2, 0.6]},
    {"id": "4", "text": "rogue", "vector": [0.7, 0.4, 0.7]},
]
table = db.create_table("adventurers", data=data, mode="overwrite")

# Run vector similarity search
query_vector = [0.8, 0.3, 0.8]
result = table.search(query_vector).limit(2).to_polars()
print(result)
```

## When to use it

- Add semantic search or retrieval-augmented generation (RAG) to an app without running a separate database server
- Prototype and ship embedding search locally during development, then move to cloud or object storage as data grows
- Store and query multimodal datasets (text, images, video) together with their vectors and metadata
- Use it as the vector store behind LangChain or LlamaIndex pipelines
