$npx skillfedfor your agent

pgvector

pgvector support for Python

Worth itPyPI DatabaseReleased Jul 202635.6M downloads / moMITPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — pgvector-0.5.0-py3-none-any.whl
v0.5.0 · released 2026-07-06 · Python >=3.10

Yes. The package is actively maintained, has no dependencies, installs cleanly, carries no known vulnerabilities, and is MIT-licensed. Install it if you need vector search in PostgreSQL from Python—it's the standard bridge between pgvector and popular ORMs. Prerequisite: PostgreSQL with pgvector extension already set up.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires PostgreSQL with pgvector extension installed and a supported database driver (Django, SQLAlchemy, Psycopg, asyncpg, etc.)
  • Low friction installation with no runtime dependencies.
  • Active maintenance—last release 39 days ago with 1513 repository stars.

License · maintenance · safety

MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects.

last release 2026-07-06 (39 days) · last repo commit 2026-07-06 · 1,513 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 35,593,280 downloads/mo, #743 on PyPI

Verify before relying

pip install pgvector

from pgvector.django import VectorField
class Item(models.Model):
    embedding = VectorField(dimensions=3)

from pgvector.django import L2Distance
Item.objects.order_by(L2Distance('embedding', [3, 1, 2]))[:5]
  • Whether pgvector extension installation on the PostgreSQL server is automatic or requires manual setup
  • Performance characteristics for large-scale vector indexes (HNSW vs IVFFlat trade-offs)
  • Compatibility matrix details for each supported ORM/driver combination
Same gist for agents: .md · .json

What it is and what it does

pgvector-python is a Python adapter that bridges vector search capabilities from the PostgreSQL pgvector extension into popular Python ORMs and database drivers. It allows you to store embeddings directly in PostgreSQL and query them using similarity metrics like L2 distance, cosine distance, and inner product, without leaving your database.

The package supports Django, SQLAlchemy, SQLModel, Psycopg 3, Psycopg 2, asyncpg, pg8000, and Peewee, providing native field types (VectorField, VECTOR, HALFVEC, BIT, SPARSEVEC) and query operators for nearest-neighbor retrieval, distance filtering, and approximate indexing via HNSW or IVFFlat algorithms. It's designed for applications that combine embeddings from LLMs, sentence transformers, or other ML models with traditional relational data.

Use it for

  • Retrieval-augmented generation (RAG) pipelines storing document embeddings for semantic search
  • Recommendation systems using embedding similarity to find related items or users
  • Hybrid search combining vector similarity with keyword and metadata filters in a single query
  • Image or visual search by storing embeddings from vision models and finding perceptually similar images
  • Topic modeling or document clustering by storing and querying sentence/document embeddings

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

The package is actively maintained, has no dependencies, installs cleanly, carries no known vulnerabilities, and is MIT-licensed. Install it if you need vector search in PostgreSQL from Python—it's the standard bridge between pgvector and popular ORMs. Prerequisite: PostgreSQL with pgvector extension already set up.

Install

pgvector on PyPI

Before you install

Low friction installation with no runtime dependencies. Active maintenance—last release 39 days ago with 1513 repository stars.

Requires PostgreSQL with pgvector extension installed and a supported database driver (Django, SQLAlchemy, Psycopg, asyncpg, etc.)

License in practice

MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects.

Quickstart

pip install pgvector

from pgvector.django import VectorField
class Item(models.Model):
    embedding = VectorField(dimensions=3)

from pgvector.django import L2Distance
Item.objects.order_by(L2Distance('embedding', [3, 1, 2]))[:5]

Verify before relying

  • Whether pgvector extension installation on the PostgreSQL server is automatic or requires manual setup
  • Performance characteristics for large-scale vector indexes (HNSW vs IVFFlat trade-offs)
  • Compatibility matrix details for each supported ORM/driver combination

Package facts

LicenseMIT permissive
Python supportSupports the current Python release >=3.10
Install frictionLow. Pure-Python wheel
Runtime dependenciesNone
MaintenanceActively maintained 39 days since the last release
Last repo commit
First released
Downloads35,593,280 / month, #743 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14

Evidence: pgvector-0.5.0-py3-none-any.whl

Tags

Capabilities
postgresql vector search pythonpgvector django sqlalchemysemantic search embeddings databasevector similarity queries postgresembedding storage retrieval pythonnearest neighbor search sqlvector database orm integration
Topics
vector-searchembeddingsorm-integration

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “pgvector django sqlalchemy”

  • pgvectorAdds vector storage and similarity search support to PostgreSQL…
  • py-pglitepy-pglite provides a zero-config PostgreSQL testing environment for…
  • llama-index-vector-stores-postgresIntegrates PostgreSQL with pgvector extension as a vector store…

Give your agent the search over MCP, or paste the wish link into any chat.

More Database packages

psycopg2-binary Worth it
PyPI · Software Development · released Apr 2026

psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.

copyleftcompiled wheel · 3.9+
271.6Mdownloads / mo
redis Worth it
PyPI · Database · released Jul 2026

Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.

Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.

MITpure Python · 3.10+
268.3Mdownloads / mo
ydb Worth it
PyPI · Database · released Jul 2026

YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.

Install it if you need to connect Python applications to YDB databases.

permissive licensepure Python · 3.10+
210.0Mdownloads / mo
snowflake-connector-python Worth it
PyPI · Software Development · released Aug 2026

Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.

Apache-2.0compiled wheel · 3.10+
193.6Mdownloads / mo
sqlparse Worth it
PyPI · Software Development · released Aug 2026

sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.

Install it if you need to manipulate, format, or analyze SQL text programmatically.

BSD-3-Clausepure Python · 3.10+
148.9Mdownloads / mo
dbt-adapters With conditions
PyPI · Database · released Jul 2026

Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.

Apache-2.0pure Python · 3.10.0+
121.3Mdownloads / mo

See also pgvecto-rs · pyobvector · sqlite-vec · vecs · pgserver · llama-index-vector-stores-postgres · nano-vectordb · pg0-embedded · apache-airflow-providers-pgvector · voyager