Vector similarity search in PostgreSQL — store embeddings alongside relational data for RAG and semantic search.
Five passes over the same idea, each from a different angle. Do them in order, or jump to whichever you need.
pgvector adds vector data types and similarity search to PostgreSQL. Store embeddings alongside relational data without a separate vector database. Supports L2, inner product, and cosine distance. IVFFlat and HNSW indexes accelerate approximate nearest neighbor search. Ideal for RAG, recommendation, and semantic search.
Where this topic shows up outside its home domain: