Skip to content
← Notebook

RAG & Documents

Which vector database should you use locally for RAG? sqlite-vec, Chroma, LanceDB, FAISS and DuckDB measured with 100,000 Spanish paragraphs

With 100,000 vectors, FAISS exact search answers in 1.6 ms without losing neighbours. Chroma takes 0.6 ms but returns 92%, and LanceDB's default index only 28.7%.

Date
Oct 24, 2026
Reading time
8 min
Result
100% recall with exact FAISS in 1.647 ms • Chroma: 0.595 ms and 92.02% • LanceDB IVF_PQ by default: 28.71%

Translated from the Spanish original. The code, data and READMEs on GitHub are in Spanish.

Up to 100,000 chunks, a local RAG doesn’t need an approximate index: FAISS exact search (IndexFlatIP) returns the 10 correct neighbours (100% recall) in 1.647 ms per query. Chroma answers in 0.595 ms, but with its default configuration returns only 92.02% of the true neighbours. The index LanceDB creates by default (IVF_PQ) drops to 28.71%. sqlite-vec and DuckDB are exact, but take 55.319 ms and 44.606 ms. Measured on 24 October 2026 with 100,000 paragraphs from Spanish Wikipedia, 1,000 queries and 5 repetitions per case.

“Chroma, LanceDB, sqlite-vec or FAISS?” is one of the first questions when building a serverless RAG. The comparisons going around are vendors’ own pages or articles with no reproducible data, and they almost never measure whether the database returns the right neighbours. Here’s the measurement, with the code published.

Definitions

  • Embedded vector database: a library that stores embeddings in a local file or folder and searches them inside the same process, with no separate server.
  • Exact search (brute force): compares the query with every vector. It’s never wrong and its cost grows with the number of vectors.
  • Approximate index (HNSW, IVF_PQ): a structure that avoids comparing against everything. It’s faster at large scale, but may leave out some of the nearest neighbours.
  • Recall@10: of the 10 paragraphs most similar to the query (computed exactly with numpy), how many the engine returns. At 92.02%, 7.98 out of every 100 chunks the RAG should pass to the LLM are left out.
  • p50 / p95 latency: the time for a query at the median and at the 95th percentile of 1,000 queries sent one at a time.

Hypotheses

  1. With 100,000 vectors, engines with an approximate index (Chroma, FAISS HNSW, LanceDB IVF_PQ) are much faster than exact ones.
  2. Their default configuration keeps almost all neighbours (recall above 95%).
  3. sqlite-vec and DuckDB, working from SQL, are somewhat slower than in-memory search.

Setup

  • Data: 479,809 paragraphs of 300 to 1,500 characters taken from a Spanish Wikipedia file (dump of 1 November 2023), shuffled with a fixed seed. 100,000 are indexed (548.97 characters on average) and, as a small corpus, the first 10,000. The queries are the first sentence of another 1,000 paragraphs.
  • Embeddings: intfloat/multilingual-e5-small (384 dimensions, normalised). Computing them for the 100,000 paragraphs took 352.8 s on the laptop’s GPU.
  • Ground truth: the 10 exact neighbours of each query by cosine similarity, computed with numpy.
  • Engines: numpy and FAISS IndexFlatIP (exact, in memory and saved to a file), FAISS IndexHNSWFlat (M = 32), sqlite-vec (a vec0 table with cosine distance), DuckDB (a FLOAT[384] column and ORDER BY array_inner_product, without the VSS extension), Chroma (PersistentClient) and LanceDB, without an index and with the default create_index() (IVF_PQ). All with their default configuration. To see how much is recovered by tuning only the query, two variants: FAISS HNSW with efSearch = 64 and LanceDB IVF_PQ with refine_factor = 10.
  • What’s measured: indexing (inserting and persisting it to disk), size on disk, latency of 1,000 queries with k = 10 after 20 warm-up queries, recall@10 and extra memory (process peak RSS minus RSS before indexing).
  • Repetitions: 5 per engine and size, each in a fresh process and a fresh folder, in random, interleaved order.
  • Machine: Apple M1 Max laptop with 64 GB, macOS 26.6.2 and Python 3.12.13.

Results

100,000 vectors (median of 5 repetitions)

Engine Recall@10 p50 latency p95 latency Indexing Disk Extra memory
FAISS IndexFlatIP (exact) 100% 1.647 ms 1.765 ms 0.04 s 153.6 MB 309.4 MB
numpy (exact) 100% 4.205 ms 4.533 ms 0.02 s 153.6 MB 317.3 MB
LanceDB without index (exact) 100% 15.816 ms 16.122 ms 0.11 s 153.8 MB 1081.4 MB
DuckDB, SQL without extension (exact) 100% 44.606 ms 45.362 ms 3.20 s 156.5 MB 576.3 MB
sqlite-vec (exact) 100% 55.319 ms 56.244 ms 0.97 s 156.6 MB 168.4 MB
FAISS HNSW, efSearch 64 92.57% 0.242 ms 0.290 ms 3.67 s 180.8 MB 339.0 MB
Chroma (default HNSW) 92.02% 0.595 ms 0.682 ms 11.84 s 196.1 MB 621.2 MB
FAISS HNSW (default) 74.64% 0.083 ms 0.118 ms 3.68 s 180.8 MB 338.6 MB
LanceDB IVF_PQ, refine_factor 10 68.45% 3.518 ms 3.705 ms 12.47 s 156.8 MB 1270.0 MB
LanceDB IVF_PQ (default) 28.71% 2.393 ms 2.535 ms 12.41 s 156.8 MB 1284.1 MB

10,000 vectors (median of 5 repetitions)

Engine Recall@10 p50 latency p95 latency Indexing Disk Extra memory
FAISS IndexFlatIP (exact) 100% 0.311 ms 0.316 ms 0.004 s 15.4 MB 32.5 MB
numpy (exact) 100% 0.332 ms 0.366 ms 0.002 s 15.4 MB 39.5 MB
LanceDB without index (exact) 100% 4.041 ms 4.220 ms 0.016 s 15.4 MB 126.1 MB
sqlite-vec (exact) 100% 5.478 ms 5.538 ms 0.098 s 16.0 MB 28.7 MB
DuckDB, SQL without extension (exact) 100% 7.900 ms 8.097 ms 0.931 s 13.6 MB 137.2 MB
FAISS HNSW, efSearch 64 98.35% 0.109 ms 0.126 ms 0.166 s 18.1 MB 36.9 MB
Chroma (default HNSW) 98.00% 0.369 ms 0.402 ms 0.699 s 29.3 MB 126.9 MB
FAISS HNSW (default) 86.13% 0.037 ms 0.047 ms 0.166 s 18.1 MB 36.9 MB
LanceDB IVF_PQ, refine_factor 10 80.21% 2.283 ms 2.457 ms 1.258 s 16.0 MB 142.3 MB
LanceDB IVF_PQ (default) 34.34% 1.164 ms 1.258 ms 1.240 s 16.0 MB 140.9 MB

Spread between repetitions is low. With 100,000 vectors, sqlite-vec’s p50 latency ranges from 55.197 to 56.191 ms and Chroma’s from 0.585 to 0.607 ms. Chroma’s recall ranges from 91.92% to 92.05%. LanceDB IVF_PQ’s from 28.58% to 29.32%, because the index is retrained on each repetition.

What the tables show:

  • The approximate index loses neighbours as the corpus grows. Chroma goes from 98% with 10,000 vectors to 92.02% with 100,000. Default FAISS HNSW (efSearch = 16) goes from 86.13% to 74.64%: it loses 25.36 points compared with exact search. Raising efSearch to 64 recovers up to 92.57% and stays at 0.242 ms.
  • LanceDB’s default IVF_PQ loses 71.29 recall points with 100,000 vectors (28.71%). Re-ranking with the full vectors (refine_factor = 10) raises it to 68.45%, still below any exact option and slower than exact FAISS. It also takes 12.41 s to build the index.
  • Exact search scales well up to here. FAISS IndexFlatIP goes from 0.311 ms to 1.647 ms when the vectors are multiplied by 10: 598 queries per second on a single calling thread. It’s faster than numpy (4.205 ms) with the same vectors and the same result.
  • Doing it from SQL has a price. sqlite-vec needs 13.2 times numpy’s latency with 100,000 vectors (18 queries per second) and DuckDB 10.6 times. In return, sqlite-vec adds the least memory (168.4 MB with 100,000 vectors) and stores the vectors in the same file as the rest of the application’s data.
  • LanceDB and Chroma use more memory. LanceDB without an index adds 1081.4 MB when querying 100,000 vectors (153.8 MB on disk). Chroma adds 621.2 MB and takes up 196.1 MB on disk, 1.28 times the size of the raw vectors.

What it means

  • Hypothesis 1: it holds, but the difference doesn’t matter in a RAG. Chroma (0.595 ms) and FAISS HNSW (0.083 ms) are much faster than sqlite-vec (55.319 ms). Even so, any of the three is small compared with how long an LLM takes to answer. The bottleneck is generation, not search.
  • Hypothesis 2: it doesn’t hold. No approximate index reaches 95% with 100,000 vectors on its default configuration. What gets lost doesn’t raise an error: it’s relevant chunks that never reach the context, and the answer gets worse without warning.
  • Hypothesis 3: it holds. sqlite-vec and DuckDB are exact but take 10 to 13 times as long as numpy: they scan every vector from SQL.

When to use each option

  • Up to about 100,000 chunks and a single process: exact search with FAISS IndexFlatIP (or numpy if you want no dependencies). 100% recall, 1.647 ms and a 153.6 MB file. It’s what we recommend by default for a RAG over internal documentation, contracts or tickets.
  • If the application’s data is already in SQLite: sqlite-vec. With 10,000 chunks it answers in 5.478 ms and adds 28.7 MB of memory, with no second store to keep in sync. With 100,000 it’s still exact, but already takes 55.319 ms per query.
  • If you need sub-millisecond queries at high volume: an HNSW index (FAISS or Chroma), tuning efSearch (or Chroma’s search ef) and measuring recall with your data. Don’t trust the defaults.
  • LanceDB: without an index it behaves like exact search (100%, 15.816 ms) and adds a columnar format, versioning and filters. Its default IVF_PQ index isn’t advisable for RAG below 100,000 vectors without tuning its parameters and measuring recall.
  • DuckDB without extensions: useful for one-off analysis over embeddings you already have in a table, not for serving queries (44.606 ms with 100,000 vectors).

Limitations

  • A single Apple Silicon laptop with other applications open. The figures are good for comparing with each other and for the order of magnitude, not as absolute server latencies.
  • Two sizes (10,000 and 100,000 vectors) of 384 dimensions. With millions of vectors or with models of 1,024 dimensions or more, exact search stops being reasonable and the balance shifts in favour of indexes.
  • Default configuration, apart from two query-side tuned variants. Build-time tuning (M, ef_construction, IVF_PQ partitions and sub-vectors) wasn’t tested, nor LanceDB’s IVF_HNSW index, nor DuckDB’s VSS extension. sqlite-vec 0.1.9 only does exact search.
  • Queries one at a time and without metadata filters. Batch queries, concurrency, updates and deletes, and hybrid full-text search weren’t measured.
  • Extra memory includes the copies each library makes when inserting (for example, the Arrow table in LanceDB) and whatever remains reserved after the queries. It’s the process peak, not what the index takes at rest.
  • Index reopening was saved in the raw results but isn’t published: Chroma reuses the client within the same process, so that figure doesn’t measure a cold open.
  • Recall is measured against the exact neighbours of the same embedding model, not against human relevance judgements. It measures how much is lost by using an index, not the quality of the full RAG.

How to reproduce it

Code, environment and raw results (every measurement of every repetition, the summary with median, minimum, maximum and deviation, and the ratios): yeswelab-laboratorio/bases-vectoriales-locales-rag on GitHub. It downloads the Wikipedia file and the model from Hugging Face without an account. On an M1 Max, the embeddings take about 6 minutes and the 100 measurements about 25.

Building a RAG with your documents and not sure whether a file is enough or you need a vector database? Commission the experiment with your data and your real volume.

#FAISS 1.15.1#sqlite-vec 0.1.9#Chroma 1.5.9#LanceDB 0.40.0#DuckDB 2.0.0#numpy 2.5.4#multilingual-e5-small