# pgvector/pgvector

> Vector similarity search extension for PostgreSQL.

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/pgvector-pgvector).**

21,662 stars · 1,200 forks · C · PostgreSQL

## Links

- GitHub: https://github.com/pgvector/pgvector
- Homepage: https://github.com/pgvector/pgvector
- awesome-repositories: https://awesome-repositories.com/repository/pgvector-pgvector.md

## Topics

`postgres` `vector-search` `embeddings` `ai` `database`

## Description

This project is an extension for PostgreSQL that enables the storage, indexing, and querying of high-dimensional vector embeddings directly within relational tables. It functions as a vector similarity search engine, allowing users to perform nearest neighbor searches using standard distance metrics such as cosine, inner product, and L2 distance. By integrating these capabilities into the database engine, it allows for the execution of vector operations alongside traditional relational data management.

The extension distinguishes itself by enabling hybrid search workflows, where vector similarity results are combined with relational filters or full-text search criteria within a single query plan. It utilizes specialized indexing structures, including graph-based and cluster-based algorithms, to provide logarithmic search performance on large datasets. These indexes are managed through standard database operators, allowing for the integration of vector-based machine learning workflows into existing SQL syntax.

Beyond core search functionality, the project provides a suite of tools for managing high-dimensional data, including vector aggregation, mathematical transformations, and format conversion. It supports memory-optimized storage formats to reduce the footprint of embeddings and executes distance calculations directly within the database memory space to minimize latency. The extension is designed to be installed as a standard PostgreSQL module, providing native support for vector data types and query optimization.

## Tags

### Data & Databases

- [Vector Database Extensions](https://awesome-repositories.com/f/data-databases/vector-database-extensions.md) — Adds native support for storing, indexing, and querying high-dimensional vector embeddings within relational tables.
- [Hybrid Search](https://awesome-repositories.com/f/data-databases/hybrid-search.md) — Combines vector similarity search with traditional relational filters and full-text search criteria within a single query plan. ([source](https://github.com/pgvector/pgvector))
- [Vector Similarity Search](https://awesome-repositories.com/f/data-databases/vector-similarity-search.md) — Provides native support for nearest neighbor searches using distance metrics like cosine, inner product, and L2 distance. ([source](https://github.com/pgvector/pgvector))
- [Approximate Nearest Neighbor Search](https://awesome-repositories.com/f/data-databases/approximate-nearest-neighbor-search.md) — Implements graph-based and cluster-based indexing structures to enable logarithmic search performance for high-dimensional vector data.
- [Vector Indexing](https://awesome-repositories.com/f/data-databases/vector-indexing.md) — Implements specialized indexing structures like HNSW and IVFFlat to accelerate nearest neighbor searches on large vector datasets. ([source](https://github.com/pgvector/pgvector/blob/master/README.md))
- [Hybrid Query Execution](https://awesome-repositories.com/f/data-databases/vector-indexing/hybrid-query-execution.md) — Integrates vector similarity scans with traditional relational filters within a single unified query plan.
- [Filtered Similarity Searches](https://awesome-repositories.com/f/data-databases/vector-similarity-search/filtered-similarity-searches.md) — Allows narrowing down similarity search results by applying standard relational filters or full-text criteria during query execution. ([source](https://github.com/pgvector/pgvector/blob/master/README.md))
- [Query Operators](https://awesome-repositories.com/f/data-databases/query-operators.md) — Exposes vector similarity metrics as standard database operators for seamless integration with SQL syntax.
- [In-Process Computation](https://awesome-repositories.com/f/data-databases/vector-databases/in-process-computation.md) — Executes distance calculations and transformations directly within the database memory to minimize latency.

### Artificial Intelligence & ML

- [Database-Native ML Integration](https://awesome-repositories.com/f/artificial-intelligence-ml/machine-learning/infrastructure/integrated-development-platforms/machine-learning-platforms/database-native-ml-integration.md) — Integrates vector-based machine learning workflows into standard database queries and hybrid search applications.

### Scientific & Mathematical Computing

- [Distance Metrics](https://awesome-repositories.com/f/scientific-mathematical-computing/numerical-mathematical-foundations/mathematical-libraries-and-utilities/core-mathematical-concepts/distance-metrics.md) — Calculates vector distances using standard metrics like L1, L2, Hamming, and Jaccard to determine similarity. ([source](https://github.com/pgvector/pgvector/blob/master/CHANGELOG.md))
