The Free Encyclopedia

Vector Databases for Local AI

A vector database stores embeddings and finds the nearest ones to a query vector in milliseconds — the retrieval engine behind RAG and semantic search.

The options

DB Best for
Chroma Dead-simple, embedded, great for prototyping
Qdrant Production, fast, rich filtering, runs in Docker
pgvector You already run Postgres; keep it all in SQL
FAISS Library, not a server; max speed, you manage storage

Qdrant in 30 seconds

docker run -p 6333:6333 qdrant/qdrant
from qdrant_client import QdrantClient
c = QdrantClient("localhost", port=6333)
c.create_collection("docs", vectors_config={"size":768,"distance":"Cosine"})
c.upsert("docs", points=[{"id":1,"vector":emb,"payload":{"text":chunk}}])
hits = c.search("docs", query_vector=q_emb, limit=5)

Key concepts

  • Distance metric — cosine for most text embeddings; match what your model was trained on.
  • HNSW index — the graph algorithm that makes search sub-linear.
  • Payload filtering — combine vector search with metadata (date, source) for hybrid retrieval.

Related: RAG with Local Embeddings · Container and Docker Security

Categories: AI Research Local AI RAG