0Pricing
SQL Academy · Lesson

Vector Search with pgvector

Use the pgvector extension to store embeddings and run approximate nearest neighbour search with ivfflat / HNSW.

What Are Vectors For?

Embeddings encode meaning. Two documents about the same topic have similar vectors. Vector search powers semantic search, RAG (retrieval-augmented generation), and recommendation.

Enable pgvector

The extension is widely available (RDS, Cloud SQL, Supabase have it built in):

CREATE EXTENSION vector;

All lessons in this course

  1. Trigram Search (pg_trgm) for Fuzzy Matching
  2. Full-Text Search with tsvector and GIN
  3. Geospatial Indexing with PostGIS
  4. Vector Search with pgvector
← Back to SQL Academy