Automathing Logo
Back to glossary

AI Engineering / Glossary

Embeddings

Numerical representations of text or images that let a computer compare meaning rather than words.

Definition

An embedding converts a piece of content into a list of numbers positioned so that similar meanings sit close together. This is what allows a search to match "cancel my subscription" with a document titled "Termination of service" despite sharing no words.

What an embedding is, without the mathematics

Keyword search matches characters. Ask it for "cancel my subscription" and it will miss a policy page titled "Termination of service," because the two share no words. To a human they mean the same thing; to a text-matching system they are unrelated.

An embedding solves this by converting content into coordinates. Each piece of text becomes a long list of numbers, arranged so that things meaning similar things end up near each other. "Cancel my subscription" and "Termination of service" land close together. "Termination of employment" lands somewhere else entirely, despite sharing a word.

Once meaning has coordinates, comparing it becomes arithmetic. That is why this is the mechanism underneath semantic search, RAG, deduplication, clustering, and recommendation.

Semantic and keyword search each fail differently

Keyword searchSemantic search
MatchesExact termsMeaning
Handles paraphrasingNoYes
Handles part numbers, codes, namesPreciselyUnreliably
Explains why a result matchedEasilyPoorly
CostCheapHigher

Neither wins outright. Semantic search finds the paraphrase and then confidently returns part number SKU-4471 when you asked for SKU-4417, because those are nearly identical in meaning-space and completely different in the warehouse. Keyword search never makes that error and never finds the paraphrase.

Systems that work in production usually run both and combine the results, an approach often called hybrid search, because most real queries contain both a concept and an identifier.

Practical things worth knowing before you build

Chunk size drives quality. Content is split into pieces before embedding. Too large, and one embedding tries to represent four unrelated ideas and represents none of them well. Too small, and the passage loses the context that made it meaningful. Splitting on real document structure beats splitting every N characters.

Embeddings are model-specific. Vectors from one model cannot be compared with vectors from another. Changing embedding models means re-embedding everything, which is a real migration cost on a large corpus.

They encode meaning, not truth. Two contradictory statements about the same topic sit right next to each other, because they are about the same thing. Retrieval will happily return the outdated policy alongside the current one. Curation is not optional.

How Automathing approaches it

We treat chunking and document structure as the highest-leverage work in any retrieval system, well ahead of embedding model choice. Hybrid search is the default rather than an optimization, since business queries almost always mix concepts with identifiers. And we plan for re-embedding from the start, because embedding models get replaced and a corpus that cannot be rebuilt is a corpus that will eventually be stuck.

Frequently asked questions

What is the difference between embeddings and a vector database?

The embedding is the representation; the vector database is where those representations are stored and searched. You generate embeddings with a model and store them somewhere that can find the nearest ones quickly. Small collections do not need a dedicated database at all.

Do embeddings understand our internal terminology?

Only what it can infer from context. General-purpose embedding models learn from broad text, so an internal code name or an unusual use of a common word may sit in the wrong place. The usual fixes are including surrounding context in each chunk, maintaining a synonym list, and pairing semantic search with keyword search so exact internal terms still match.

Are embeddings a privacy concern?

Treat them as derived copies of the source content. An embedding is not human-readable, but it is not anonymization either: approximate content can be recovered from vectors, and the retrievable text usually sits alongside them anyway. Apply the same access controls and retention rules you would apply to the documents themselves.

How much do embeddings cost to run?

Generating them is inexpensive relative to model inference, and the bulk of the cost is the initial pass over your corpus. Ongoing cost comes from new and changed documents, plus query-time embedding. The expense that surprises people is re-embedding everything after switching models, which is why the choice is worth thinking about once rather than repeatedly.