A Pythonic semantic search
summary
Implements a working semantic search using Django + PostgreSQL + PGVector and Sentence Transformers, with embeddings computed in Python and saved to a PGVector column via a custom save method; cosine distance queries run inside Postgres so nearest-neighbor filtering happens in the database. Uses a generated tsvector for legacy full-text search, a migration to enable the extension and add a high-dimension vector column, admin integration for interactive queries, and example results where “rock” returns related items like “music” and “stone,” showing the approach is practical and fast.
AI-written summary · about
chapters (17)
- 0:00Introduction and agenda
- 1:50Pythonic and simple approach
- 3:13Django vs Flask vs FastAPI
- 5:24Why Django for this project
- 6:07Setting up the project
- 7:13Creating the model
- 8:16Database migration and queries
- 11:50Switching to PostgreSQL
- 13:17PostgreSQL full-text search
- 15:28Generated fields for vectors
- 17:11Semantic search explained
- 19:03Vector databases vs PostgreSQL
- 20:10PGVector extension setup
- 21:13Embedding with sentence transformers
- 22:39Implementing semantic search
- 24:29Demo and summary
- 25:11Q&A session
related talks
25mSemantic search with Django, PostgreSQL, & pgvector
25mBeyond Filters: Modern Search with Vectors in Django with Kumar Shivendu
43mFull-Text-Search Explained from A to Z with French Food
48mFrom Text to Meaning: pgvector Transforms PostgreSQL Search
27mpgvector for Python developers
59mContextual search with vector search: exploring your options with open source tools
26mA pythonic full-text search
22mFrom Postgres full text search to Retrieval Augmented Generative search
