Tailr
← All posts

What Is an Embedding? A Simple Explanation for AI Beginners

· updated

The word cat turned into a list of numbers, with cat and kitten close together on a chart and car far away

If you’ve read anything about AI search, chatbots that answer questions about your documents, or recommendation systems, you’ve probably run into the word “embedding”. It sounds technical, but the idea is simple, and once it clicks a lot of modern AI makes more sense. This guide explains what embeddings are, how they work and where they’re used, without the maths.

The short answer: An embedding is a list of numbers that represents the meaning of something: a word, a sentence, a document, an image. An AI model creates it so that things with similar meanings get similar numbers. That lets a computer measure how close two pieces of content are in meaning, which powers semantic search, retrieval-augmented generation (RAG), recommendations, clustering and duplicate detection.

Why computers need embeddings

Computers work with numbers, not meaning. Older search tools matched exact words: search for “cheap flights” and you’d miss a page that says “low-cost airfare”. The words are different even though the meaning is the same.

Embeddings fix that. Instead of comparing words, you compare meanings, turned into numbers. “Cheap flights” and “low-cost airfare” get embeddings that are close together, so a search for one finds the other.

How embeddings work, in plain English

Imagine a map where every word has a location. Words with similar meanings sit near each other: “cat” near “kitten” and “dog”, “car” over by “truck” and “bus”. To find words related to “cat”, you just look at what’s nearby.

An embedding is that location, but instead of two coordinates (like a map) it has hundreds or thousands. Each number captures some aspect of meaning the model has learned. No single number means anything you could name; it’s the pattern across all of them that matters.

"cat"    → [0.12, -0.48, 0.91, 0.05, ...]
"kitten" → [0.10, -0.45, 0.88, 0.07, ...]
"car"    → [-0.73, 0.22, -0.10, 0.64, ...]

“Cat” and “kitten” have similar numbers; “car” doesn’t.

Measuring similarity

To compare two embeddings, you measure how close they are. The most common measure is cosine similarity, which looks at the angle between them. A score close to 1 means very similar meaning; close to 0 means unrelated. Other measures include dot product and Euclidean distance.

Where embeddings come from

An embedding model creates them. It’s a neural network trained on huge amounts of text (or images, or both) to place related things close together. You give it a piece of text, and it returns a fixed-length list of numbers. Popular options include OpenAI’s text-embedding-3 models, Google’s Gemini embedding models, Cohere’s Embed models, Voyage AI, and open-source models you can run yourself, such as those listed on Hugging Face’s MTEB leaderboard.

A short history

  • 2013: Word2Vec, from Google, showed that word embeddings could capture relationships. The famous example: “king” minus “man” plus “woman” lands near “queen”.
  • 2014 to 2018: GloVe and other word embeddings followed, then models like BERT that understood words in context (“bank” in “river bank” vs “bank account”).
  • Today: models embed whole sentences, paragraphs, images and code, and they’re a standard building block of AI applications.

What embeddings are used for

Turn every document into an embedding and store them. When someone searches, embed the query and find the documents whose embeddings are closest. Results match by meaning, not just keywords.

Retrieval-augmented generation (RAG)

Large language models don’t know your company’s documents. RAG fixes that: embed your documents, find the ones most relevant to a question, and give them to the model to answer from. Embeddings are the “retrieval” part. See what is RAG for the full picture, and what is an LLM if you’re new to language models.

Recommendations

Embed products, articles or songs, and recommend items close to what someone already liked.

Clustering and classification

Group thousands of support tickets, reviews or survey answers by topic without reading them all, or label new items by finding which group they’re closest to.

Duplicate detection

Find near-identical questions, listings or records even when the wording differs.

Anomaly detection

Spot items that are far from everything else, such as an unusual transaction or log message.

Where embeddings are stored: vector databases

Once you have thousands or millions of embeddings, you need somewhere to store them and a fast way to find the nearest ones. That’s what vector databases do: Pinecone, Weaviate, Qdrant, Milvus and Chroma are popular, and PostgreSQL with the pgvector extension is a common choice for teams that want to stay with a regular database. Our guide to the best vector databases compares them.

For small projects you don’t need one; a few thousand embeddings can be compared directly in memory.

A simple example

Say you have 500 help-centre articles and want a search box that understands questions.

  1. Split each article into short chunks.
  2. Send each chunk to an embedding model and store the numbers alongside the text.
  3. When a user types “I can’t log in on my phone”, embed that question.
  4. Find the five chunks with the highest cosine similarity.
  5. Show those chunks, or pass them to a language model to write an answer.

The article titled “Resetting your password on the mobile app” will rank highly even though it shares few words with the question.

Things to know before you use them

  • Same model in, same model out. Embeddings from different models can’t be compared. If you change model, re-embed everything.
  • Dimensions matter. More numbers can capture more detail but cost more to store and search. Many models produce between a few hundred and a few thousand dimensions, and some let you shorten them.
  • Chunking matters. How you split long documents affects search quality as much as the model does.
  • Embeddings aren’t perfect. They can miss exact matches like product codes or names. Many systems combine embedding search with keyword search (“hybrid search”).
  • They can carry bias from the data the model was trained on.

Embeddings and AI careers

If you’re heading into AI engineering, embeddings are one of the first things you’ll work with, along with RAG, vector databases and prompt design. Expect interview questions like “how would you build search over our documents?” or “how do you evaluate retrieval quality?”. How to get started with AI engineering lays out a learning path, and AI engineer interview questions covers what comes up.

When you apply, AI roles vary a lot: one wants RAG and vector search, another wants fine-tuning, another wants agents. Tailr tailors your resume to the job listing you’re viewing, so the skills that role names come first, using only your real experience. Try Tailr on your next AI engineering application.

Conclusion

An embedding is a list of numbers that captures the meaning of a piece of content, created by a model so that similar things end up close together. Comparing embeddings, usually with cosine similarity, lets computers search, recommend, group and retrieve by meaning instead of exact words. They’re the engine behind semantic search and RAG, they’re stored in vector databases at scale, and they’re one of the most useful ideas to understand if you’re building with AI or working toward an AI engineering job.

Frequently asked questions

01What is an embedding in simple terms?

An embedding is a list of numbers that represents the meaning of something, such as a word, sentence, image or document. Things with similar meanings get similar numbers, so a computer can tell that 'dog' and 'puppy' are related, or that two support tickets are about the same problem, just by comparing their numbers.

02What are embeddings used for?

The most common uses are semantic search (finding results by meaning rather than exact words), retrieval-augmented generation (giving a language model relevant documents to answer from), recommendations, grouping similar items, detecting duplicates and spotting unusual data. They're a building block in most modern AI applications.

03What is the difference between an embedding and a vector?

A vector is just a list of numbers. An embedding is a vector that has been produced by a model to represent meaning. So every embedding is a vector, but not every vector is an embedding. People often use the words interchangeably when talking about AI search.

04How are embeddings created?

An embedding model, which is a neural network trained on large amounts of text or images, reads the input and outputs a fixed-length list of numbers. During training it learns to place items that appear in similar contexts or mean similar things close together. You usually call a model through an API or run an open-source one.

05What is cosine similarity?

Cosine similarity measures how similar two embeddings are by looking at the angle between them. A score near 1 means they point the same way (very similar meaning), near 0 means unrelated. It's the most common way to compare embeddings because it focuses on direction rather than size.

06Do I need a vector database to use embeddings?

Not always. For a few thousand items you can store embeddings in memory or in a normal database and compare them directly. Vector databases become useful when you have millions of embeddings and need fast, filtered similarity search. Some regular databases, such as PostgreSQL with pgvector, also handle it well.