DEV Community

Alex Spinov
Alex Spinov

Posted on

LanceDB Has a Free API — Here's How to Build Serverless AI Search with Zero Infrastructure

Why LanceDB?

LanceDB is a serverless vector database that runs embedded — no server process needed. Built on Lance columnar format, it's fast for both vector search and analytics.

Free and open source. LanceDB Cloud has a free tier.

Getting Started

pip install lancedb
Enter fullscreen mode Exit fullscreen mode
import lancedb
import numpy as np

db = lancedb.connect("./my_lancedb")

# Create table with data
data = [
    {"text": "Machine learning transforms industries", "category": "AI", "vector": np.random.rand(128).tolist()},
    {"text": "React 19 introduces new features", "category": "Frontend", "vector": np.random.rand(128).tolist()},
    {"text": "Kubernetes simplifies deployment", "category": "DevOps", "vector": np.random.rand(128).tolist()}
]

table = db.create_table("articles", data)

# Vector search
results = table.search(np.random.rand(128).tolist()).limit(3).to_pandas()
print(results[["text", "category", "_distance"]])

# Filtered search
results = table.search(query_vec).where("category = 'AI'").limit(5).to_pandas()

# Full-text search (hybrid!)
table.create_fts_index("text")
results = table.search("machine learning", query_type="fts").limit(5).to_pandas()
Enter fullscreen mode Exit fullscreen mode

TypeScript

import * as lancedb from "lancedb";

const db = await lancedb.connect("./my_lancedb");
const table = await db.createTable("docs", [
  { text: "Hello world", vector: [0.1, 0.2], category: "greeting" }
]);

const results = await table.search([0.1, 0.2]).limit(5).execute();
results.forEach(r => console.log(r.text));
Enter fullscreen mode Exit fullscreen mode

Why LanceDB?

Feature LanceDB Chroma Pinecone
Embedded Yes Yes No
Format Lance (columnar) Custom Proprietary
Analytics Yes No No
Multimodal Yes Limited No
License Apache 2.0 Apache 2.0 Proprietary

Use Cases

  1. RAG applications — embed docs, retrieve context for LLMs
  2. Multimodal search — images + text in one table
  3. ML pipelines — store embeddings alongside raw data
  4. Edge AI — runs locally, no network latency

Need data for AI? I build production-ready scrapers. Check out my Apify actors or email spinov001@gmail.com for custom data pipelines.

Building with LanceDB? Share your setup below!

Top comments (0)