Home / Blog / Vector Databases

Semantic Search with pgvector and Python: Build a Production Search Engine

Semantic search with pgvector and Python: embed text with sentence-transformers or OpenAI, store in PostgreSQL, query with cosine distance. FastAPI search endpoint, batch indexing, filtered search, hybrid BM25+vector, and production checklist for building a semantic search engine in 2026.

May 17, 2026 13 min read

HNSW Explained: Hierarchical Navigable Small World Graphs for Vector Search

HNSW explained: multi-layer graph for approximate nearest neighbor search. Introduced by Malkov and Yashunin in 2016. Greedy routing from coarse upper layers to fine lower layers. Parameters m, ef_construction, ef_search. O(log n) search complexity. 95%+ recall. Production checklist for 2026.

Apr 12, 2026 14 min read

pgvector Performance Tuning: HNSW, Memory, and Query Optimization

pgvector performance tuning: 5 parameters drive 90% of performance. maintenance_work_mem 8-16GB for HNSW builds, ef_search 10-200 per query, shared_buffers 25-40% RAM, EXPLAIN ANALYZE for seq scan detection, iterative scans for filtering, halfvec for storage, and production checklist for 2026.

Mar 28, 2026 14 min read

Embedding Dimensions: 384 vs 768 vs 1024 vs 1536 vs 3072 Explained

Embedding dimensions compared: 384 for prototyping, 768-1024 as production default, 1536 for OpenAI, 3072 for max quality. MTEB scores, storage costs, latency, Matryoshka truncation, pgvector halfvec, and dimension selection guide with benchmarks and production checklist for 2026.

Dec 15, 2025 13 min read

What Is a Vector Database? HNSW, IVF, PQ, and ANN Search Explained

Vector databases store high-dimensional embeddings and answer nearest-neighbor queries with HNSW, IVF, and product quantization. Compare Pinecone, Weaviate, Qdrant, Milvus, pgvector, and Chroma. ANN index types, filtering, quantization, and when to use each database for production RAG.

Dec 10, 2025 14 min read

PostgreSQL Hybrid Search: BM25 + Vector Search with RRF Fusion

PostgreSQL hybrid search: combine BM25 keyword search with pgvector semantic search using Reciprocal Rank Fusion (RRF). ParadeDB BM25, tsvector ts_rank_cd, cosine similarity, RRF formula, Python HybridSearch implementation, and production checklist for 2026.

Oct 11, 2025 14 min read

pgvector vs Weaviate vs Qdrant: Self-Hosted Vector Database Comparison 2026

pgvector vs Weaviate vs Qdrant: pgvector for Postgres simplicity, Weaviate for hybrid BM25+vector, Qdrant for fastest filtered search in Rust. Compare performance, filtering, hybrid search, multi-vector, quantization, scale, and deployment. Decision matrix with 8 criteria and production checklist.

Oct 6, 2025 12 min read

Vector Database Incremental Updates: CDC, Reindexing, and Stale Embeddings

Vector database incremental updates: CDC pipelines for embedding versioning, HNSW absorbs inserts without rebuild, IVFFlat needs REINDEX after 30% new rows. Compare upsert strategies, embedding versioning, stale vector detection, reindexing pipeline, and production checklist for 2026.

Aug 20, 2025 13 min read

Generate Embeddings in Python: OpenAI, Sentence-Transformers, BGE, and Cohere

Generate embeddings in Python with OpenAI API, sentence-transformers, BGE-M3, Cohere, and HuggingFace Inference. Batch embedding, local vs hosted models, dimension control with MRL, async embedding, and production checklist for building embedding pipelines in 2026.

Aug 18, 2025 11 min read

pgvector vs Pinecone: Which Vector Database to Choose in 2026?

pgvector vs Pinecone: pgvector matches Pinecone at 1M scale with HNSW, queries in 5-20ms at 95%+ recall. Pinecone offers managed serverless with zero ops. Compare performance, cost, filtering, scale, hybrid search, and vendor lock-in. Decision matrix with 7 criteria and production checklist.

Jul 28, 2025 13 min read

pgvector Tutorial: Semantic Search in PostgreSQL with HNSW Indexes

pgvector tutorial: install, create extension, store embeddings, build HNSW index, and query with cosine distance. Python examples with psycopg2 and asyncpg. Distance operators, index tuning, filtered search, upserts, and production checklist for PostgreSQL vector search in 2026.

Jul 26, 2025 13 min read

HNSW vs IVFFlat in pgvector: Choosing the Right Vector Index

HNSW vs IVFFlat in pgvector: HNSW is the default for most workloads with 95%+ recall and no rebuild needed. IVFFlat uses 2-5x less memory for large static datasets. Compare parameters (m, ef_construction, ef_search vs lists, probes), recall, latency, memory, and when to choose each index in 2026.

Jul 21, 2025 13 min read

pgvector Docker: Production Setup Guide for PostgreSQL Vector Search

pgvector Docker setup: use pgvector/pgvector:0.8.0-pg16 image, docker-compose with persistent volumes, init.sql for auto-extension, production config (shared_buffers, maintenance_work_mem), HNSW index tuning, resource limits, and production checklist for 2026.

Jul 16, 2025 12 min read

Build a Vector Search API with FastAPI and pgvector: Production Guide

Build a production vector search API with FastAPI and pgvector: asyncpg connection pooling, upsert endpoints, cosine similarity search, hybrid search with reranking, streaming responses, Docker deployment, PgBouncer, read replicas, and production checklist for 2026.

Jul 6, 2025 14 min read