v0.1.11 — Open Source

vectlite

Embedded vector store for local-first AI

Single-file vector database written in Rust. Dense + sparse hybrid search, HNSW indexing, MongoDB-style metadata filters, transactions and crash-safe persistence — all in a portable .vdb file. No server, no Docker, no network calls.

pip install vectlite
npm install vectlite

Features

Hybrid Search

Dense vectors with HNSW + sparse BM25 keyword retrieval, fused with linear combination or RRF.

Single-File Storage

Everything in one portable .vdb file. Crash-safe WAL, file locking, snapshots and backup.

Bulk Ingestion

Import large datasets efficiently with deferred index rebuilds via bulk_ingest() / bulkIngest().

Rich Metadata Filters

MongoDB-style operators: $eq, $gt, $in, $contains, $exists, with nested dot-path access.

Transactions

Atomic batched writes with rollback. Context manager support in Python, try/catch in Node.js.

Multi-Language

Native Rust core with Python (PyO3) and Node.js (napi-rs) bindings.

Quick Start

import vectlite

with vectlite.open("knowledge.vdb", dimension=384) as db:

    db.upsert("doc1", embedding, {"source": "blog", "title": "Auth Guide"})
    db.upsert("doc2", embedding2, {"source": "notes", "title": "Billing"})

    results = db.search(query_embedding, k=5, filter={"source": "blog"})

    # For large imports, prefer bulk_ingest()
    records = [
        {"id": f"doc{i}", "vector": embeddings[i], "metadata": {"source": "corpus"}}
        for i in range(len(embeddings))
    ]
    db.bulk_ingest(records, batch_size=5000)

    for r in results:
        print(r["id"], r["score"])

    db.compact()

Python 3.9+ / Node.js 18+ — Pre-built wheels for macOS, Linux and Windows.

Search & Retrieval

Named Vectors

Multiple vector spaces per record ("title", "body", ...).

Multi-Vector Queries

Weighted search across vector spaces in a single call.

MMR Diversification

Tunable relevance vs. diversity trade-off.

Namespaces

Logical isolation with per-namespace or cross-namespace search.

Built-in Rerankers

text_match(), metadata_boost(), cross_encoder(), bi_encoder() — composable with compose().

Search Diagnostics

search_with_stats() returns timings, BM25 term scores, ANN stats and explain mode.

Data Management

Physical Collections

open_store() manages a directory of independent databases.

Snapshots & Backup

snapshot() creates a self-contained copy. backup() / restore() with ANN sidecars.

Read-Only Mode

Shared locks for safe concurrent readers.

Text Analyzers

Configurable tokenizer pipeline with stopwords (en/fr), Snowball stemming, n-grams.

Language Roadmap

Python — pip install vectlite
Node.js — npm install vectlite
Swift — planned after FFI layer stabilizes
Kotlin — planned after FFI layer stabilizes

MIT License — Maintained by mcsEdition

rustvector-databasehnswbm25hybrid-searchraglocal-firstpythonnodejs

Python 3.9+ · Node.js 18+ · Rust (core)

In brief

What is VectLite and how does it work?

VectLite is an embedded vector database written in Rust, designed on the SQLite model: a single file on disk, no server to deploy, direct execution in the application process. It exposes official bindings for Python and Node.js, allowing integration into a web app, AI agent, or RAG (Retrieval-Augmented Generation) script in fewer than 5 lines of code. VectLite combines 2 indexes in the same file: a dense HNSW (Hierarchical Navigable Small World) index for semantic embedding searches, and a sparse BM25 index for keyword searches. A hybrid query weighs both scores via Reciprocal Rank Fusion (RRF) and returns results in under 5 milliseconds for 100,000 vectors on commodity hardware.

Why choose VectLite over Pinecone or Chroma?

Pinecone, Weaviate, Qdrant, and Milvus are server-based vector databases, designed for distributed workloads of several million vectors and priced between $70 and $500 per month for the smallest tiers. VectLite targets a different use case: local-first applications, edge computing, RAG embedded in a desktop or mobile app, or prototypes where a hosted service is disproportionate. Typical VectLite database sizes range from 1,000 to 1 million vectors at 768 or 1,536 dimensions — the majority of individual and small-team use cases. VectLite supports ACID transactions, crash-safe persistence via write-ahead logging, and MongoDB-style metadata filters. The library is distributed under the MIT license, is free, and includes no telemetry.

Frequently asked questions

Is VectLite an alternative to Pinecone, Weaviate or Chroma?

Yes. VectLite is a single-file embedded vector database (SQLite-style) written in Rust. Unlike Pinecone, Weaviate or Qdrant — which are distributed servers — VectLite runs in-process inside your Python or Node.js app, perfect for local-first and edge use cases.

Does VectLite support hybrid search?

Yes. VectLite combines a dense HNSW index and a BM25 sparse index for hybrid search, with MongoDB-style metadata filters.

What's the difference between VectLite and FAISS?

FAISS is a pure indexing library — no persistence, no transactions. VectLite adds crash-safe persistence, ACID transactions, MongoDB filters and ready-to-use Python/Node.js bindings in a single install.

VectLite — Embedded Vector Store for Local-First AI | mcsEdition