pgvecto-rs
Python binding for pgvecto.rs
What it is and what it does
pgvecto-rs is a Python client library for PGVecto.rs, a PostgreSQL extension that adds native vector data types and approximate nearest-neighbor search capabilities. It bridges Python applications to PostgreSQL by providing type mappings and helper functions for four vector types: standard vectors, sparse vectors, half-precision vectors, and binary vectors. The library integrates with three major Python database frameworks—SQLAlchemy, Psycopg3, and Django—allowing developers to store, index, and query embeddings through their ORM or query interface.
The package handles vector insertion, approximate indexing via HNSW and IVF algorithms, and distance-based queries. It requires a running PGVecto.rs PostgreSQL instance and supports Python 3.8 through 3.12. Because the package is dormant with no recent updates, users should verify compatibility with their target PostgreSQL and PGVecto.rs versions before adopting it in production.
Use it for:
- Store and query embeddings from machine learning models in PostgreSQL using ORM without writing raw SQL.
- Perform approximate nearest-neighbor searches on vector embeddings with HNSW or IVF indexing for semantic search or recommendation systems.
- Bulk-load large sets of vectors into PostgreSQL via Psycopg3's COPY interface for efficient data ingestion.
- Define vector fields in Django models and run similarity queries through the ORM without custom database functions.
- Support multiple vector representations (full-precision, sparse, half-precision, binary) in a single PostgreSQL database for different use cases.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python bindings for PGVecto.rs, a PostgreSQL vector database extension, with support for multiple vector types and integration with SQLAlchemy, Psycopg3, and Django.
Yes, if you are already committed to PGVecto.rs and need Python ORM integration. The library has low install friction, but its dormant maintenance status (675 days since last release) means no updates for security, compatibility, or bugs. Install only if you can tolerate stalled upstream development and verify compatibility with your PostgreSQL and PGVecto.rs versions independently.
Install
pgvecto-rs on PyPI
pip
pip install pgvecto-rsuv
uv add pgvecto-rspoetry
poetry add pgvecto-rsInstalling pgvecto-rs
Before you install
Low install friction with only two runtime dependencies (numpy and toml). However, the package is dormant—last release was 675 days ago—so maintenance updates and bug fixes are unlikely.
License in practice
Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions.
Quickstart
pip install pgvecto_rs
from pgvecto_rs.sqlalchemy import Vector
# Define a model with a vector column
class Item:
embedding = Vector(3)
# Insert vectors and query by distance
# session.execute(insert(Item).values(embedding=[1, 2, 3]))
# session.scalars(select(Item).filter(Item.embedding.l2_distance([3, 1, 2]) < 5))
Requires a running PGVecto.rs PostgreSQL instance (e.g., via Docker) and the vectors extension enabled in the database.
Verify before relying
- Whether the package remains compatible with current PostgreSQL and PGVecto.rs server versions despite dormant maintenance status.
- Performance characteristics and scalability limits for different vector types and index strategies.
- Community support or active forks available if upstream development remains stalled.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | capped below the current Python release (<3.13,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — numpy, toml |
| Maintenance | dormant — 675 days since the last release |
| First released | |
| Downloads | 231,563/month — #9,084 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pgvecto_rs-0.2.2-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
pgvectorAdds vector storage and similarity search…
permissive · top 1,000 on PyPI
nano-vectordbA lightweight vector database that stores and…
permissive · top 15,000 on PyPI
pyobvectorpyobvector is a Python SDK for OceanBase Vector…
permissive · top 15,000 on PyPI
vecsvecs is a Python client for storing, indexing,…
permissive · top 15,000 on PyPI
sqlite-vecsqlite-vec adds vector search capabilities to…
permissive · top 5,000 on PyPI
pg0-embeddedEmbeds a PostgreSQL database directly in Python…
permissive · top 15,000 on PyPI
llama-index-vector-stores-postgresIntegrates PostgreSQL with pgvector extension…
permissive · top 15,000 on PyPI
pgserverEmbeds a PostgreSQL server with pgvector…
unclear · top 15,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
voyagerVoyager performs fast approximate…
permissive · top 15,000 on PyPI