Module 4 · Vector Databases · Lesson 9 of 34
Embeddings: meaning as numbers
How text becomes a vector, how cosine similarity compares meanings, and why it beats keyword search.
In this lesson · about 18 minutes
- Explain what an embedding is and what its numbers capture
- Calculate cosine similarity for two small vectors
- Explain why semantic search finds matches that share no words
Computers compare numbers easily, but not meanings. An embedding model bridges the gap: it turns a piece of text into a list of numbers, a vector, such that texts with similar meaning get similar vectors.
- Real embeddings have hundreds or thousands of numbers (dimensions), for example 768 or 1,536. No single number has a neat label; meaning is spread across all of them.
- In this lesson's simulator we cheat on purpose: 6 dimensions with readable labels (Animals, Food, Technology, Money, Feelings, Travel), so you can see what is going on.
- "My puppy is unwell" and "our vet clinic hours" share no words, but both point strongly in the Animals direction, so their vectors are close.
Worked example
Cosine similarity by hand
Three tiny 2-D vectors: A = (3, 4), B = (4, 3), C = (4, −3). Which is A more similar to?
Try it · simulator
Embeddings and semantic search
Each article becomes a list of numbers that captures its meaning. Type a question and find the articles whose vectors point the same way.
Query vector (6 numbers)
Words with a meaning in this toy model: puppy
Closest articles (cosine similarity)
Words this toy model knows
airport, angry, app, bank, bark, battery, beach, bread, cat, charger, cheap, code, computer, cook, dinner, dog, eat, fish, flight, food, happy, holiday, hotel, invoice, kitten, laptop, loan, lonely, love, money, passport, password, pasta, pay, pet, phone, pizza, price, puppy, recipe, refund, restaurant, sad, salary, software, ticket, trip, vacation, vet, worried
Check your understanding0 of 4 correct
Quiz score: 0 of 4
Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.