Module 85: Embeddings and Vector Search

Lesson 4 of 5 · 15–25 minutes

Semantic search

🏠The everyday picture

A helpful librarian understands "books about starting a small shop" even if no title contains those words. A card catalogue only finds exact title words.

📘What it really is

🖱️Try it

Write an indexDocument(documentId) function that splits a document into paragraphs (proper chunking comes in Module 86), embeds them, and stores them. Index your approved documents. Build GET /v1/search?q= returning the top five chunks with their document titles, and add a PostgreSQL full-text search alongside it. Compare both for one meaning-based question and one exact product-code question.

✅Quick check

When does keyword search beat semantic search?

Show the answer

For exact terms such as product codes, names and numbers.

What must happen when an approved document is updated?

Show the answer

Its chunks must be re-created and re-embedded, and old ones removed.

← PreviousVector indexes
ProLearners Assist