AI Hints
Home›RAG Tutorial›Embeddings
RAG · Lesson 25 of 120

What Are Embeddings

Meaning as numbers.

⏱ 2 min read▶ Video at 24:47🎓 Free
Watch this lesson in the RAG courseWatch on YouTube ↗Full RAG course

Word matching failed when the customer used different words. We need search that understands meaning. Embeddings make that possible, by turning text into a list of numbers that captures what it means.

What Are Embeddings
From the video: What Are Embeddings
  • Words aren't enough
  • We need meaning
  • Embeddings

A map of meaning

Imagine every sentence as a point on a map. Sentences with similar meanings sit close together, even when they use different words. How long does charging take sits right beside the battery charges in four hours. Store opening hours sit somewhere else entirely. An embedding is that position, written as numbers.

charging time?, charges in 4 hours, battery rangeclose together in meaning
opening hours, closed on Sundayclose together in meaning
frame warrantyclose together in meaning
A map of meaning
From the video: A map of meaning

Key facts

An embedding model reads a piece of text, and outputs a fixed length list of numbers, called a vector. Similar meanings give similar vectors. Real models use hundreds or thousands of numbers, not two, but the idea of closeness is the same.

keyvalue
Inputany text
Outputa vector of numbers
Similar meaningclose vectors
Sizehundreds of numbers

Summary

Embeddings turn text into vectors, so that similar meanings land close together. Next, your first embedding.

Key takeaways
  • Text to numbers
  • Close means similar
  • Search by meaning
Next up: Your First Embedding — sentence transformers