Embedding

An embedding is a list of numbers — typically a few hundred to a few thousand of them — that represents a piece of text, an image or an audio clip as a point in space, positioned so that things with similar meaning end up close together.

Also called: vector, embedding model · Reviewed

How does it work?

An embedding model is trained so that related inputs land near one another. Compare two embeddings with a similarity measure — cosine similarity is the usual choice — and you get a number for how alike their meanings are. "How do I reset my password?" and "I have been locked out of my account" share almost no words and sit very close together, which keyword search can never see. Cosine similarity runs from -1 to 1, where 1 is identical direction and 0 is unrelated; in practice text embeddings rarely go below 0, so the working range is narrower than the theoretical one. Common embedding sizes are 384, 768 and 1,536 numbers per item.

Why does it matter?

It is the mechanism behind semantic search, and therefore behind most retrieval systems, recommendations, deduplication and clustering. Any time software needs to find "things like this one" rather than "things containing this word", embeddings are what makes it possible.

What do people get wrong?

Mixing models. Embeddings from different models are not comparable — the numbers describe positions in different spaces. Changing your embedding model means re-embedding your entire corpus, so it is worth choosing deliberately rather than discovering the cost later.

The other trap is abandoning keywords entirely. Semantic search is weak precisely where exact matching is strong: product codes, error numbers, names, rare acronyms. Hybrid search that combines both consistently beats either alone.

Learning this properly is easier with other people.

OneShopAI is where students, developers and founders work through this material together — sessions, builds and people who answer questions.