pgvector for Python developers
summary
Shows how to install the pgvector extension (the extension is actually called vector), create a vector column and use psycopg, asyncpg, SQLAlchemy/SQLModel and the pgvector‑python package to run queries. Demonstrates OpenAI embeddings (1536 dims), recommends the dot product for normalized vectors, builds an HNSW index for fast approximate nearest neighbors (notes IVFflat as an alternative), and deploys a FastAPI vector+full‑text hybrid search that merges results with reciprocal rank fusion — examples like “colorless footwear” return sensible matches.
AI-written summary · about
chapters (7)
- 0:00Intro
- 0:56Overview of vectors
- 5:07Tools to understand vectors
- 7:52Measuring the distance between vectors
- 9:53Storing vectors in PostgreSQL
- 18:05Using pgvector with Python
- 26:02Slides & more...
related talks
52mpgvector Newbie to Expert
52mVector search is now boring, but PostgreSQL has ways to go
48mFrom Text to Meaning: pgvector Transforms PostgreSQL Search
41mPostgreSQL for AI. Real Vector Search in PostgreSQL
48mVectors are the new JSON
53mVectors: how to better support a nasty data type in PostgreSQL
29mA Pythonic semantic search
47mExtendable by Design: Building Generative AI Apps with Postgres and Vector Storage and Azure AI
