Product attributes
pgvector is an open-source vector similarity search extension for PostgreSQL that can also be used for storing embeddings. AI models break down items (words, images, etc.) into vectors, a mathematical representation of the original. Once these vectors are stored in a database, vector similarity search enables users to measure the similarity between two related items. PostgreSQL is an open-source object-relational database system dating back to 1986 that extends the SQL language with many features for storing and scaling the most complicated data workloads.
pgvector supports the following:
- Exact and approximate nearest neighbor search
- L2 distance (Euclidean distance), inner product, and cosine distance
- Any language with a Postgres client
Users can compile and install the extension on their own machine or install it with Docker, Homebrew, PGXN, APT, Yum, or conda-forge. pgvector also comes preinstalled with Postgres.app and other hosted providers. By default, pgvector performs an exact nearest neighbor search, which provides perfect recall. Users can add an index for approximate nearest neighbor search, trading some recall for performance. Unlike typical indexes, users receive different results for queries after adding an approximate index. pgvector can be used from any language with a PostgreSQL client as well as generate and store vectors in one language while querying them in another.