Home / Companies / Neon / Blog / Post Details
Content Deep Dive

20x faster than pgvector: introducing pg_embedding extension for vector search in Postgres and LangChain

Blog post from Neon

Post Details
Company
Date Published
Author
Raouf Chebri
Word Count
1,479
Language
English
Hacker News Points
101
Summary

The `pg_embedding` extension for Postgres and LangChain offers a 20x speed boost for graph-based approximate nearest neighbor search while maintaining 99% accuracy, outperforming the popular IVFFlat indexing technique used in pgvector. The new extension uses the Hierarchical Navigable Small Worlds (HNSW) index to unlock new levels of efficiency in high-dimensional similarity search. pg_embedding can be easily implemented in applications, and prior knowledge of vector indexes is optional. Its performance is comparable to IVFFlat but with better speed and accuracy. The choice between `pg_embedding` and pgvector with IVFFlat depends on specific use cases and requirements, including memory constraints, search speed, accuracy, distance metrics, and index construction speed.