Module 4 of 12

Embeddings

Lessons

About This Module

Retrieval is the heart of RAG, and embeddings are what make it possible. An embedding turns a piece of text into a list of numbers, a vector, so that texts with similar meanings end up close together. That is how a system can find a passage that answers a question even when the two share no keywords.

The lessons start with a short explanation of word and sentence embeddings, then look at how embeddings are learned with word2vec. Next you will see how cosine similarity measures how close two vectors are, and how to use sentence embedding models to build semantic search. A final longer course puts it together by generating embeddings with an API, storing them in a database, and building a small assistant on top.

Watch the lessons in order. The last video previews the next module on vector databases, so feel free to treat it as a first look and come back to it later.

Lessons

5 videos
01

What Are Word and Sentence Embeddings?

A gentle introduction to embeddings: how words and whole sentences are turned into numbers, and why similar meanings are placed close together.

Video 8min
02

Word Embedding and Word2Vec, Clearly Explained

StatQuest walks through why models need words as numbers and how a small neural network learns embeddings, covering word2vec's two methods (continuous bag-of-words and skip-gram) and negative sampling.

Video 16min
03

Cosine Similarity in Machine Learning: Explained Simply

How cosine similarity compares two vectors, the standard way to decide how close two embeddings are and which documents best match a question.

Video 5min
04

Sentence Transformers: Sentence Embedding, Similarity, Semantic Search and Clustering

A code walkthrough of the Sentence Transformers library: creating sentence embeddings, comparing sentences, and using them for semantic search and clustering.

Video 33min
05

Use Vector Embeddings to Create an AI Assistant

A freeCodeCamp course by Ania Kubow on what vector embeddings are and why they matter, generating a text embedding with the OpenAI API, storing vectors in a database, and building an assistant with LangChain. It previews topics from the next modules.

Video 36min