--- id: pgvector version: "0.5.0" license: MIT license_treatment: permissive maintenance: active --- # pgvector — pgvector support for Python License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install pgvector uv add pgvector poetry add pgvector ## Description # pgvector-python [pgvector](https://github.com/pgvector/pgvector) support for Python Supports [Django](https://github.com/django/django), [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy), [SQLModel](https://github.com/tiangolo/sqlmodel), [Psycopg 3](https://github.com/psycopg/psycopg), [Psycopg 2](https://github.com/psycopg/psycopg2), [asyncpg](https://github.com/MagicStack/asyncpg), [pg8000](https://codeberg.org/tlocke/pg8000), and [Peewee](https://github.com/coleifer/peewee) [![Build Status](https://github.com/pgvector/pgvector-python/actions/workflows/build.yml/badge.svg)](https://github.com/pgvector/pgvector-python/actions) ## Installation Run: ```sh pip install pgvector ``` And follow the instructions for your database library: - [Django](#django) - [SQLAlchemy](#sqlalchemy) - [SQLModel](#sqlmodel) - [Psycopg 3](#psycopg-3) - [Psycopg 2](#psycopg-2) - [asyncpg](#asyncpg) - [pg8000](#pg8000) - [Peewee](#peewee) Or check out some examples: - [Retrieval-augmented generation](https://github.com/pgvector/pgvector-python/blob/master/examples/rag/example.py) with Ollama -... ## AI interpretation — verify before relying Provides Python bindings for pgvector, enabling vector storage and similarity search in PostgreSQL through multiple database libraries and ORMs. Verdict: A well-maintained, actively developed library for vector operations in PostgreSQL with broad ORM support. Zero known vulnerabilities, MIT-licensed, and no external Python dependencies make it a low-friction choice for embedding-based applications. [View on SkillFed](https://skillfed.io/packages/pgvector) · [View on PyPI](https://pypi.org/project/pgvector/)