Basics of NLP and RAG · Lesson 3
Vector Databases
A vector database stores embeddings and finds the nearest ones to a query vector quickly. Exact search compares against every vector, which is slow at scale, so databases use Approximate Nearest Neighbour (ANN) indexes like HNSW or IVF.
Popular options: FAISS (library), Chroma (lightweight, local), Pinecone and Weaviate (managed), Qdrant and Milvus (open source servers), and pgvector inside PostgreSQL.
Look for metadata filtering, hybrid search (vectors plus keyword/BM25), persistence, scaling and cost when choosing one.
Key points
- Vector DBs do fast similarity search
- ANN indexes like HNSW trade tiny accuracy for big speed
- pgvector lets you stay in Postgres
- Hybrid search mixes keyword and semantic matching