Neon has released a new version of pg_embedding, its Postgres extension for vector similarity search. The key update moves HNSW index construction from in-memory to on-disk, enabling compatibility with Neon's serverless architecture including autoscaling and scale-to-zero. The release also adds support for cosine similarity, Manhattan distance, and Euclidean distance metrics. While on-disk indexing is roughly 2x slower than in-memory, the trade-off enables AI/LLM applications to scale to millions of users without managing a separate vector store. The post covers HNSW tuning parameters (dims, m, efConstruction, efSearch) and how Neon's read replicas can offload vector search workloads.

5m read timeFrom neon.com
Post cover image
Table of contents
Getting started with pg_embeddingSpeeding up your queries using HNSW indexingHNSW Index on-disk vs. in-memoryScalable vector search on NeonFinal thoughts