~/talk

A Pythonic semantic search

Talkat PyCon Italia 2025 · 2025-05-28..05-31· [machine-learning, databases]
slides:none on file

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

  1. 0:00Introduction and agenda
  2. 1:50Pythonic and simple approach
  3. 3:13Django vs Flask vs FastAPI
  4. 5:24Why Django for this project
  5. 6:07Setting up the project
  6. 7:13Creating the model
  7. 8:16Database migration and queries
  8. 11:50Switching to PostgreSQL
  9. 13:17PostgreSQL full-text search
  10. 15:28Generated fields for vectors
  11. 17:11Semantic search explained
  12. 19:03Vector databases vs PostgreSQL
  13. 20:10PGVector extension setup
  14. 21:13Embedding with sentence transformers
  15. 22:39Implementing semantic search
  16. 24:29Demo and summary
  17. 25:11Q&A session
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.