Services

Resources

Company

/

Embeddings

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)

Embeddings explained in one picture: the question How do I restart a pod? goes into an embedding model and comes out as a vector of 1,536 numbers. In a meaning space, it sits close to Kubernetes pod restart steps (high cosine similarity) and far from an unrelated sentence (low). Cosine similarity runs from -1 to 1. A red point asks new model? and warns that you must re-embed the whole corpus.

Putting this into practice?

Talk to One2N about our AI engineering services

Talk to One2N about our AI engineering services