Embeddings & Vectors, Explained Simply

Last reviewed Jul 7, 2026AI Foundations · beginner

What you'll learn

  • Explain what an embedding is and what 'similar vectors' means
  • See why embeddings power semantic search and recommendations
  • Understand where embeddings fit in a RAG system

Turning meaning into numbers

Computers can’t compare meaning directly, so we convert text into embeddings — lists of numbers (vectors) arranged so that pieces of text with similar meaning end up close together, and unrelated text ends up far apart. “Cancel my subscription” and “how do I unsubscribe” land near each other even though they share almost no words, while “reset my password” sits off in a different neighbourhood.

You don’t need the maths to use this. The one idea to hold onto: close vectors = similar meaning.

What this unlocks

Once text is embedded, “find things that mean the same” becomes “find the nearest vectors” — fast and language-aware. That single trick powers:

  • Semantic search — results by meaning, so a help centre finds the right article even when the user’s words don’t match it.
  • Recommendations — “more like this” for articles, products, or songs.
  • Deduplication and clustering — grouping similar tickets, reviews, or news stories (this site uses the idea to merge duplicate coverage).

Embeddings + LLMs = RAG

The biggest payoff is retrieval-augmented generation (RAG), which you’ll build in a later lesson. The recipe: embed all your documents once, embed the user’s question at query time, retrieve the closest chunks, and hand them to the LLM as grounding. That’s how you get a chatbot that answers from your knowledge base instead of the model’s fuzzy memory.

The catch worth remembering: numeric closeness isn’t judgement. Embeddings can rank an irrelevant or outdated passage as a top match, so retrieval quality — not just the model — decides whether the final answer is right. The RAG playbook goes deep on getting that part correct.

Next: what actually happens when a model is trained, and why “inference” is the part you pay for every day.

Try it yourself — Reason about similarity
Prompt
I have these four phrases: "cancel my subscription", "how do I unsubscribe",
"reset my password", "turn off auto-renew".
Group them by meaning and explain which would sit close together as
embeddings and why.
Sample output
Two clusters:
• Billing/cancellation: "cancel my subscription", "how do I unsubscribe",
  "turn off auto-renew" — all about stopping recurring payment, so their
  embeddings sit close together even though they share few exact words.
• Account access: "reset my password" — a different intent, so its vector
  sits farther away.
Embeddings capture meaning, so "unsubscribe" and "cancel subscription" are
near neighbours despite no shared keywords.

Sample output — AI responses may vary.

Common mistakes

  • Confusing embeddings with keyword matching. Embeddings capture meaning, so they match paraphrases that share no words — and can miss exact codes or IDs that keyword search nails.
  • Assuming any embedding model works for any language or domain. Quality varies; test on your own data.
  • Forgetting that embeddings are only as fresh as when you computed them — re-embed when documents change.

How to check the AI's answer

  • Spot-check a few queries: do the top semantic matches actually make sense to a human? If not, your chunking or model choice needs work.
  • For queries with exact identifiers (part numbers, error codes), verify you also have keyword search — pure embeddings often miss them.

Key terms

EmbeddingA vector of numbers representing the meaning of a piece of text, so similar meanings are numerically close.
VectorAn ordered list of numbers; embeddings are vectors, and 'distance' between them measures similarity.
Semantic searchSearch by meaning using embeddings, rather than by exact keyword match.

Test yourself

3 questions · answers reveal after you check.

1. An embedding is…

An embedding maps text to a vector of numbers such that similar meanings land near each other.

2. Why can embeddings match 'unsubscribe' with 'cancel my subscription'?

Semantic similarity, not shared words, drives the match — that's the whole point of embeddings.

3. Where do embeddings fit in a RAG system?

RAG embeds your documents and the query, retrieves the closest chunks, then feeds them to the LLM.