#🧱 Building Block: Vector Database (Milvus / Pinecone / pgvector)

#Overview

A Vector Database is a specialized data store designed to index, store, and query high-dimensional vectors (embeddings). It powers similarity search for recommendation engines, semantic search, image retrieval, and RAG (Retrieval-Augmented Generation) for LLMs.

#Key Concepts

Database Type Strengths
Milvus Standalone, open-source Best for large-scale (billions of vectors), GPU support
Pinecone Managed SaaS Easiest to operate, good for startups
pgvector PostgreSQL extension Good for < 10M vectors, no extra infra
Weaviate Standalone, open-source Built-in ML model integration
Qdrant Standalone, open-source Rust-based, excellent filtering support

#When to Use

#When NOT to Use

#Key Performance Numbers

HNSW on 100M vectors (256-dim):
  Query latency:  < 5ms (top-200 neighbors)
  Memory:         ~40GB (vectors + graph overhead)
  Recall@200:     95%+
  Build time:     ~2 hours

#Trade-offs

#Used In This Repo