Services

Resources

Company

Embeddings

Embeddings are fixed-length vectors of numbers that an embedding model produces from text, images or other data. The model places items with similar meaning close together in that vector space. Applications compare embeddings to search by meaning, cluster documents, or find the context a retrieval-augmented generation (RAG) app sends to a large language model.

How it works

You send a piece of text to an embedding model and get back a vector of a set size. For example, OpenAI's text-embedding-3-small returns 1,536 numbers per input. To compare two items, you compute cosine similarity between their vectors. The score runs from minus 1 to 1, and higher means closer in meaning. "How do I restart a pod?" and "Kubernetes pod restart steps" score high, while an unrelated sentence scores much lower.

Why it matters in production

Every embedding in a store must come from the same model. If you change the embedding model, you must re-embed the whole corpus, which costs time and money. Embedding calls also add latency and cost to each query, so teams trace them and track similarity scores to spot weak retrieval.

See also

On the One2N blog

References

  1. Efficient estimation of word representations in vector space (Mikolov et al., 2013)

  2. Sentence-BERT: sentence embeddings using siamese BERT networks (Reimers and Gurevych, 2019)

Four-panel comic explaining Embeddings. Embeddings are fixed-length lists of numbers that represent the meaning of text or other data, so similar items sit close together.