← Retrieval-augmented generation (RAG)
Lesson 1 of 4
Embeddings and vector search
Watch, read the card, then practise. Embeddings · Similarity search
The video for this lesson is being recorded.
Meanwhile, the notes below and the 60-second cards cover the same ideas.
Practise this topicEmbeddings
An embedding turns text into a vector of numbers, so texts with similar meaning end up close together.
Remember: Same model for questions and documents, always.
Similarity search
Similarity search finds the chunks whose vectors are closest to the question's vector.
Remember: Meaning → vectors. Exact strings → keywords. Often both.
Try the example in Code Lab
import numpy as np v = np.array([3.0, 4.0]) print((v / np.linalg.norm(v)).tolist())