StackLift
All terms

Glossary

Embeddings

Lists of numbers that capture the meaning of text, images or other data so similar items sit close together.

Embeddings are numerical representations of text, images or other data, produced by a model so that items with similar meaning end up close together. They make search by meaning possible, and they are the foundation of RAG, recommendations and clustering.

To search by meaning, you embed your documents once and store the vectors, usually in a vector database or a database with vector search. At question time you embed the question and find the nearest stored vectors.

Embeddings come from a separate embedding model, not the chat model. Use the same embedding model for documents and queries, and plan to re-embed if you ever switch models.

Start in 60 seconds

Put this to work on your project.

Get an AI-assisted, architect-reviewed scope, cost range, and timeline. Free, no login.

The complete guide

Embeddings: the complete guide

Updated November 18, 2026 ยท Published by , Founder, StackLift AI. Written with AI assistance; how we make content.

Short answer

Embeddings are lists of numbers, produced by a model, that capture the meaning of text, images or other data so that similar items sit close together. They let software search by meaning instead of exact words, and they are the foundation of RAG, semantic search, recommendations and clustering.

What are embeddings in simple terms?

An embedding turns a piece of content into a long list of numbers, called a vector. The model that produces it is trained so that content with similar meaning gets similar numbers. A sentence about refund policy ends up near other sentences about returns, even if they share no words.

You can picture each item as a point on a very large map. Searching means finding the points closest to the point for your question.

How are embeddings used step by step?

  1. Prepare your content and split long documents into passages.
  2. Run each passage through an embedding model to get its vector.
  3. Store vectors with the original text and metadata in a vector database or a database with vector search.
  4. When a question arrives, embed it with the same model.
  5. Find the nearest stored vectors, often using cosine similarity, and return those passages.
  6. Optionally hand the passages to a large language model to write an answer; this is RAG.

Embedding models are separate from chat models. They are smaller, cheaper to run and only produce vectors, not text.

What do embeddings power?

Common uses
UseWhat it doesExample
Semantic searchFinds results by meaningSearch a help center for how do I cancel and get the cancellation article
RAGFinds passages to give a modelA support assistant that answers from your docs
RecommendationsFinds similar itemsRelated articles or products
Clustering and taggingGroups similar itemsSorting tickets by topic
Duplicate detectionFinds near-identical contentMerging repeated requests
ClassificationLabels items by closeness to examplesRouting emails to teams

How do you choose an embedding model?

Test candidates on your own content and questions. Public rankings are a starting point, but what matters is whether the right passage comes back for your real queries, including your jargon, languages and document types.

  • Language coverage, if your content is not only English.
  • Quality on your own test questions.
  • Vector size, which affects storage and speed.
  • Maximum input length per passage.
  • Price and speed at your volume; embedding a large archive is a one-time cost, but new content keeps arriving.
  • Data handling terms, or an open-weight model you host yourself.

Use the same embedding model for documents and queries. If you switch models, you must re-embed everything, so keep the original text and plan for that.

How do you get better results from embeddings?

Good retrieval depends as much on how you prepare content as on the model. Chunks that are too large blur several topics together, and chunks that are too small lose context. Add metadata such as title, date and permissions so you can filter before searching.

Many production systems combine vector search with keyword search, then rerank the top results with a second model. Exact terms like product codes or error numbers are often better matched by keywords, and meaning by vectors.

What are the limits and risks?

  • Embeddings find similar content, not true content. Bad or outdated source text gives bad results.
  • Permissions do not travel with vectors. Filter by access rights at query time, or users may see content they should not.
  • Embeddings can leak information about the original text, so treat the vector store with the same care as the source data.
  • Quality drifts as your content changes, so re-test on a regular schedule.

StackLift scopes retrieval, permissions and evaluation as separate deliverables in an architect-reviewed estimate. The free estimate and the LLM integration page are good starting points.

What does adding embeddings and search cost in a project?

Cost comes from several places: preparing and cleaning content, embedding it, storing vectors, running search and keeping the index in sync as content changes. Embedding calls are usually inexpensive compared with chat model calls, but a large archive and frequent updates still add up.

The larger effort is usually engineering: connectors to your sources, chunking rules, permissions, evaluation and monitoring. Estimates separate those deliverables so you can see them. See the LLM integration cost page for the drivers.

How is similarity between embeddings measured?

An embedding is a long list of numbers, so a point in a space with many dimensions. Items with similar meaning sit near each other, and finding matches means finding the nearest points. A few standard measures do that.

Common similarity measures
MeasureWhat it comparesTypical use
Cosine similarityThe angle between two vectors, ignoring lengthThe most common choice for text
Dot productDirection and length togetherModels trained to use it; often equals cosine when vectors are normalized
Euclidean distanceStraight-line distance between pointsSome image and clustering tasks

Your embedding model's documentation says which measure it expects, and your vector store must use the same one. With millions of items, the search uses approximate nearest-neighbor indexes, such as HNSW, which trade a small amount of exactness for a large gain in speed.

What kinds of embeddings are there?

Types and uses
TypeWhat it representsExample use
Text embeddingsWords, sentences or passagesSearch, RAG, duplicate detection
Image embeddingsThe content of picturesVisual search, product matching
Multimodal embeddingsText and images in one shared spaceSearch images with a sentence
Code embeddingsSource code and descriptionsCode search and assistants
Audio embeddingsSound or speechMatching and classification
Record or user embeddingsBehavior, products or accountsRecommendations and clustering

Most business projects start with text embeddings, since documents, tickets and product descriptions are text.

Where should you store embeddings?

Storage options
OptionExamplesBest when
Your existing database with vector supportPostgreSQL with pgvectorYou have moderate volume and want fewer systems
A dedicated vector databaseQdrant, Weaviate, Pinecone, MilvusYou need scale, filtering and tuned performance
A search engine with vectorsElasticsearch, OpenSearchYou already run it and want keyword plus vector together
A cloud serviceManaged offerings from AWS, Azure and Google CloudYou want less to operate

Store metadata beside each vector: the source, date, owner and access rights. Filters on that metadata keep results correct and permission-safe, and let you delete content when it is removed at the source.

What are real-world uses for embeddings?

  • Support and help centers: find the most relevant article or past ticket even when the customer's words differ.
  • Internal knowledge assistants: retrieve policy and project documents for a RAG answer.
  • E-commerce: recommend similar products and match search queries to items that lack the exact keyword.
  • Contract and document review: find clauses similar to a standard or risky one.
  • Duplicate and near-duplicate detection: spot repeated tickets, leads or records.
  • Classification and clustering: group feedback by theme without hand-built rules.
  • Real estate, recruiting and marketplaces: match people or listings by meaning of descriptions.

What mistakes do teams make with embeddings?

Mistakes and fixes
MistakeResultBetter practice
Poor chunkingPassages cut mid-thought; wrong resultsSplit on meaning; see chunking
No evaluation setNo one knows if search is goodKeep real questions with known right answers
Mixing modelsVectors from different models cannot be comparedUse one model per index, and re-embed when you switch
Ignoring permissionsUsers see documents they should notFilter by access rights at search time
Never refreshingAnswers cite outdated contentRe-embed changed documents on a schedule or on change
Embeddings onlyExact codes and names are missedCombine with keyword search
Sending sensitive data to any APIPrivacy exposureReview provider terms; consider private or open-weight models

How do you measure whether embeddings are working?

Look at the results people actually see. Build a list of real questions, mark which documents should come back, and check whether they do near the top. Repeat after every change.

  • Hit quality: does a right answer appear among the first few results?
  • Coverage: are any areas of your content never retrieved?
  • Failure review: read the misses and label why: chunking, wording, missing content, wrong filter.
  • User signals: do people click and accept the result, or rephrase their search?
  • Freshness: how long until new or edited content is searchable?
  • Speed and cost: query time and spend per thousand searches.

Link retrieval quality to answer quality when using RAG. A model cannot answer well from passages that were never retrieved.

What privacy and security questions come with embeddings?

Embeddings are derived from your content and can sometimes be turned back into approximate text, so treat them as sensitive as the source. The same rules that cover the documents should cover the vectors.

  • Apply the same access controls to the vector store as to the original files.
  • Check where the embedding provider processes and stores your text.
  • Remove vectors when the source is deleted, including for erasure requests.
  • Keep separate indexes for data that must stay separate, such as different clients.
  • Log queries on sensitive collections.

See also AI governance and prompt injection, since retrieved text can carry hidden instructions.

How do you add embeddings to a project?

  1. Define the search or matching task, and write ten to fifty real example questions with the right answers.
  2. Collect and clean the content, removing duplicates and outdated versions.
  3. Choose an embedding model, weighing language support, quality on your examples, cost and where data is processed.
  4. Split content into passages and attach metadata such as source, date and permissions.
  5. Embed the passages and store the vectors with the metadata.
  6. Run your example questions, review the misses and tune chunking, filters and hybrid search.
  7. Add monitoring, refresh jobs and access checks before real users arrive.

Start with a narrow collection, prove the results with real users and then widen it. See the RAG implementation playbook for the wider build.

Questions people ask

What is an embedding vector?

It is the list of numbers an embedding model produces for a piece of content. The numbers encode meaning, so similar content produces similar vectors.

What is the difference between embeddings and a vector database?

Embeddings are the data. A vector database stores them and searches for the nearest ones quickly. You need the first to use the second.

Can I use a chat model to make embeddings?

Normally you use a dedicated embedding model. Chat models generate text and are not built to return comparable vectors.

Do embeddings need to be updated?

Yes, when the source content changes or when you switch embedding models. Updating one document means re-embedding its passages.

Can embeddings work on images and audio?

Yes. Multimodal embedding models place text, images and sometimes audio in the same space, so you can search images with a sentence.

Is semantic search better than keyword search?

Each has strengths. Semantic search handles paraphrases; keyword search handles exact terms. Combining them usually gives the best results.

Are embeddings the same as a vector database?

No. Embeddings are the numbers that represent meaning. A vector database is where you store and search them.

How many dimensions does an embedding have?

It depends on the model. Common text models produce vectors of several hundred to a few thousand numbers. More dimensions are not automatically better, so test on your own data.

Can I use embeddings without an LLM?

Yes. Search, recommendations, clustering and duplicate detection can all use embeddings alone. An LLM is only needed when you want a written answer on top.

Sources

Sources and further reading

The standards, rules, research and official documentation this page draws on.