Embeddings

An embedding is a list of numbers, a vector, that an AI model produces to represent the meaning of a piece of text, an image or other data, so that similar items end up with similar vectors.

Also known as: Vector embeddings, text embeddings

Related terms in this glossary

How it works

An embedding model reads an input and outputs a fixed-length vector, often several hundred to a few thousand numbers. The model is trained so that inputs with related meaning land near each other in that space. "Cancel my subscription" and "how do I stop my plan" produce close vectors even though they share almost no words. Closeness is measured with cosine similarity or dot product.

The idea became mainstream with word2vec (Mikolov and colleagues, 2013). Modern embedding models from OpenAI, Google, Cohere and open-source projects embed whole sentences or passages, and multimodal models place images and text in the same space.

  • Use the same embedding model for your documents and your queries.
  • Changing the model means re-embedding everything already stored.
  • Check language support; quality in Hindi or Tamil can differ sharply from English.

Why it matters

Embeddings are the building block for semantic search, retrieval-augmented generation, recommendations, deduplication, clustering and classification. They let software compare meaning rather than exact words, which is why a search bar can find the right policy document even when the user phrases the question differently. Embedding quality directly limits retrieval quality: if the right passage is not near the query, no downstream model can use it. Benchmarks such as MTEB (Massive Text Embedding Benchmark) help shortlist models, but test on your own data before choosing. Gepton uses embeddings in AI-powered search and smart recommendations.

Embeddings in depth

Example: a hypothetical online pharmacy wants search that works when customers type "bukhar ki dawai", "fever tablet" or a misspelled brand name. Product names, descriptions and common alternate names are embedded with a multilingual embedding model. At query time, the query is embedded with the same model, and a vector database returns the nearest products. Because exact brand and salt names matter in pharmacy, a keyword index runs in parallel and the two result lists are merged, which is hybrid search. A reranker orders the final shortlist. Evaluation uses real search logs labeled by pharmacists.

Choosing an embedding model

FactorWhat to check
Quality on your dataRetrieval recall on a labeled set of your queries, not only leaderboard rank
LanguagesHindi, regional languages and code-mixed text, tested separately
DimensionsMore dimensions cost more storage and memory; some models allow shorter vectors with small quality loss
Input lengthMaximum tokens per input, which constrains chunk size
HostingHosted API or self-hosted open model, relevant for data residency
ThroughputSpeed of embedding the initial corpus and keeping up with updates

Hosted options come from providers such as OpenAI, Google, Cohere and Voyage AI; open models such as the BGE and E5 families can run on your own infrastructure through libraries like Sentence Transformers.

Operating embeddings in production

  • Version everything: store the model name and version with each vector so you know when re-embedding is needed.
  • Plan re-indexing: switching models means embedding the whole corpus again; build it as a repeatable job and run old and new indexes side by side during migration.
  • Normalize consistently: apply the same text cleaning to documents and queries.
  • Use the model's conventions: some models expect different prefixes or task types for queries and documents.
  • Protect sensitive data: vectors derived from personal data should be treated as personal data, with access control and deletion.

How to measure embedding quality

Build a test set of queries with known relevant items. Measure recall at k, mean reciprocal rank and nDCG, sliced by language and query type. Then measure the downstream task: answer accuracy in RAG, click-through in search, or acceptance in recommendations.

Monitor search quality after launch as well. Queries with no clicks, repeated reformulations and low similarity scores for the top result are signals that a topic is missing from the index or that the embedding model struggles with certain phrasing. Review these regularly and add the cases to your test set.

Common mistakes

  • Mixing vectors from two different models in one index.
  • Relying on vectors alone for exact identifiers such as SKUs, invoice numbers or legal citations; add keyword search.
  • Embedding noisy text full of headers and boilerplate.
  • Choosing a model from a benchmark without testing on your languages.

Embeddings power semantic search, recommendations and clustering, and pair with knowledge graphs when relationships matter. We build with them in AI-powered search and smart recommendations.

Questions about Embeddings

Something else? Send us your question and an engineer replies with next steps.

Can embeddings be reversed to recover the original text?

Not exactly, but research has shown that a good deal of information can be reconstructed from embeddings in some conditions, especially for short texts. So embeddings of personal or confidential data should not be treated as anonymized. Store them with the same access controls, encryption and deletion processes as the source data, keep them in approved regions, and remove them when the source record is deleted. This matters for DPDP Act 2023 obligations, since deletion requests must cover derived data as well.

Do we need a separate vector database to use embeddings?

Not always. For small collections, vectors can be stored in an existing database with a vector extension, such as PostgreSQL with pgvector, or searched in memory. Many search engines, including OpenSearch and Elasticsearch, also support vector fields alongside keyword search. A dedicated vector database becomes attractive at larger scale, with high query volume, or when you need advanced filtering and index tuning. Start with what your team already operates and move when measurements show a need.

Articles that mention Embeddings

All articles

Jump to

↑↓ to move↵ to open