Python library that adds pgvector vector-type and similarity search support to Django, SQLAlchemy, Psycopg, asyncpg, Peewee and other PostgreSQL drivers.
timescale/pgvectorscale
A Postgres extension in Rust that adds a DiskANN-based index and label filtering on top of pgvector for faster, cheaper vector search.
Open-source alternative to:Pinecone
- Stars
- 3,161
- Forks
- 160
- Open issues
- 19
- Last commit
- 24 days ago
What is it?
pgvectorscale is a PostgreSQL extension that works alongside pgvector, the open-source vector data extension, to speed up approximate nearest neighbor search on embedding columns. It adds a StreamingDiskANN index type inspired by Microsoft's DiskANN research, along with a compressed storage layout based on Statistical Binary Quantization.
The extension also supports label-based filtered vector search, so queries can combine similarity ranking with array-overlap filters on a smallint[] column. Arbitrary WHERE clauses are supported too, though they are applied as post-filters after the vector search. Cosine, L2 and inner product distances are available using the same operators as pgvector.
The project is written in Rust with the PGRX framework rather than C. It can be run through a pre-built Docker image or built from source, and it is also offered as an extension on Timescale Cloud.
Key features
- 01Adds a StreamingDiskANN index for pgvector embedding columns.
- 02Uses Statistical Binary Quantization for compressed vector storage.
- 03Supports label-based filtered search using the && array overlap operator.
- 04Supports cosine, L2 and inner product distance operators matching pgvector.
- 05Provides tunable build-time and query-time parameters for accuracy versus speed.
Use cases
- Running semantic search or RAG retrieval inside an existing PostgreSQL database.
- Reducing the cost of large embedding collections (tens of millions of vectors) by self-hosting on Postgres.
- Filtering nearest-neighbor results by category labels or metadata conditions.
Quick start
- 1
Run the TimescaleDB Docker image (see the linked installation docs)
- 2
Connect to your database with psql
psql -d "postgres://<username>:<password>@<host>:<port>/<database-name>" - 3
Create the pgvectorscale extension (CASCADE also installs pgvector)
CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;
Things to know
- Building from source is not supported on macOS Intel (x86) machines due to an open issue.
- Installing from source requires a Rust toolchain and the cargo-pgrx build setup.
In collections
Topics
FAQ
- What is pgvectorscale?
- A Postgres extension in Rust that adds a DiskANN-based index and label filtering on top of pgvector for faster, cheaper vector search. pgvectorscale is a PostgreSQL extension that works alongside pgvector, the open-source vector data extension, to speed up approximate nearest neighbor search on embedding columns. It adds a StreamingDiskANN index type inspired by Microsoft's DiskANN research, along with a compressed storage layout based on Statistical Binary Quantization.
- Is pgvectorscale free to use? What license does it have?
- pgvectorscale is open source under the PostgreSQL license. Check the license terms before using it in commercial products.
- Is pgvectorscale still maintained?
- Actively maintained. The last commit to pgvectorscale was on Oct 14, 2026.
- What can I use pgvectorscale for?
- Running semantic search or RAG retrieval inside an existing PostgreSQL database. Reducing the cost of large embedding collections (tens of millions of vectors) by self-hosting on Postgres. Filtering nearest-neighbor results by category labels or metadata conditions.
- How do I install pgvectorscale?
- Run the TimescaleDB Docker image (see the linked installation docs) Connect to your database with psql: psql -d "postgres://<username>:<password>@<host>:<port>/<database-name>" Create the pgvectorscale extension (CASCADE also installs pgvector): CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;
- Where can I get pgvectorscale?
- The source code and installation instructions are on GitHub: https://github.com/timescale/pgvectorscale
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Go support for the pgvector PostgreSQL extension, with vector types and helpers for pgx, pg, Bun, Ent, GORM and sqlx.
Qdrant is a Rust-based vector similarity search engine and vector database with payload filtering, for semantic search and recommendation.
JavaScript and TypeScript helper library that adds pgvector vector type support to Node.js, Deno, and Bun database clients and ORMs.
Milvus is an open-source, distributed vector database for storing and searching embeddings at scale, used for AI search and RAG applications.
Open-source vector similarity search extension for Postgres, storing and querying embeddings alongside your relational data.