// the find
pgvector/pgvector-python
pgvector support for Python
The official Python client for pgvector, covering every major Python database driver: Django ORM, SQLAlchemy, Psycopg 3/2, asyncpg, pg8000, and Peewee. If you're building vector search into a Python app backed by Postgres, this is the integration layer you need. It's maintained by the same team as pgvector itself, so it tracks new features (halfvec, sparsevec, binary quantization) without lag.
First-party maintenance means feature parity with the pgvector extension is essentially guaranteed — halfvec, sparsevec, and binary quantization all have proper type support here. The ORM integrations (Django HnswIndex, SQLAlchemy VECTOR column type) slot into existing patterns instead of requiring raw SQL, which matters for projects that lean on migrations. The examples directory is genuinely useful: hybrid search with RRF, ColBERT late interaction, and bulk loading with COPY are non-trivial patterns that would take real time to get right from scratch. SciPy sparse array round-trip support for SparseVector is a nice touch for ML workloads.
The register_vector() call required for raw Psycopg/asyncpg connections is easy to forget — if you miss it or call it on the wrong connection object (pool vs. individual connection), you get opaque type errors at runtime with no hint about what went wrong. No built-in connection pool helper that handles the registration automatically is a gap. The Django integration has no migration helper for dropping or altering vector columns — you're on your own with RunSQL when the dimension changes. Documentation beyond the README is thin; the examples are good but there's nothing explaining index selection tradeoffs (when to prefer HNSW vs IVFFlat, how to tune ef_search at query time), which trips up most first adopters.