AI series · Part 2: Retrieval (RAG)
Embeddings: Google Maps Coordinates for Meaning
An embedding turns text into numbers that capture its meaning, so "sick days" and "medical leave" end up close together. This is what makes semantic search work.
An embedding turns text into a list of numbers that captures its meaning. Sentences with similar meaning get similar numbers, even when they use completely different words.
Think of it as Google Maps coordinates for meaning: similar sentences sit close together on the map, and unrelated ones are far apart.
Measured in our HR assistant
| Sentence A | Sentence B | Similarity | Verdict |
|---|---|---|---|
| How many sick days do I get? | What is the medical leave allowance? | 0.34 | Close: same meaning |
| How many sick days do I get? | Where is the cafeteria? | 0.11 | Far: unrelated |
The two leave questions share almost no words, yet they land close together. That's the whole point.
The same idea elsewhere
Spotify's "similar songs" and Amazon's "similar products" work the same way: turn each item into a vector, then find the nearest neighbours.
Embeddings capture meaning, so semantic search finds 'medical leave' when the user types 'sick days'. We compare them with cosine similarity.
- The short version
Next in the GenAI series: Choosing an Embedding Model: Dimensions, Storage and Accuracy
Start from the top: GenAI Quick Answers and Series Guide
We deploy these patterns across production engagements in fintech, healthcare, and eCommerce. Talk to a senior engineer about how they apply to your platform.
