pgvector

An open-source PostgreSQL extension that adds a vector column type, distance operators and HNSW and IVF indexes.

In more detail

It keeps vectors next to your relational data, so one query can filter by ordinary columns and rank by similarity. Its operators are <-> for Euclidean distance, <#> for negative inner product and <=> for cosine distance.

Example

ORDER BY embedding <=> $1 LIMIT 5

Related terms

Taught in

References

Certification courses