概述
pgvector adds vector data types and similarity search to PostgreSQL, allowing embeddings to be queried alongside relational application data using vector and relational queries.
详情
pgvector stores embeddings in PostgreSQL tables and compares them with distance operators, so vector retrieval can use the same database as application records. Exact nearest-neighbor search is available directly, while HNSW and IVFFlat indexes provide approximate search options for larger collections. Vectors can be combined with PostgreSQL filtering, joins, and transactions, allowing applications to keep embeddings alongside related records. This is useful for semantic search and retrieval features where developers want vector operations without maintaining a separate database service. Existing SQL filters and transactions can remain part of the retrieval workflow.



