Postgres Embedding is an open-source vector similarity search forPostgres
that usesHierarchical Navigable Small Worlds (HNSW)
for approximate nearest neighbor search.
It supports:This notebook shows how to use the Postgres vector database (
- exact and approximate nearest neighbor search using HNSW
- L2 distance
PGEmbedding
).
The PGEmbedding integration creates the pg_embedding extension for you, but you run the following Postgres query to add it:
OpenAIEmbeddings
.
similarity_search_with_score
execution time. To create the HNSW index on your vector column, use a create_hnsw_index
function: