Embedding is the technique of converting data such as text, image or audio into a vector of numbers. This vector captures the meaning of the original data in a mathematical space, where similar items are close together and different items are far apart. It is the foundation of semantic search systems, RAG and recommendation.
How it works
An embedding model receives a text and generates a vector of hundreds or thousands of dimensions. Each dimension represents some abstract feature of meaning. The model learns these representations during training, adjusting the vectors so that texts with similar meaning end up close together.
Comparison between vectors uses metrics such as cosine similarity, which measures the angle between two vectors. The smaller the angle, the more similar the meanings are. This makes it possible to search for documents by meaning instead of by exact words.
Practical example
A knowledge base contains 10 thousand articles. A user asks "how to reset the password". The system converts the question into an embedding and compares it with the embeddings of all articles. Articles about account recovery, password reset and login appear at the top, even if they use different words from the question.
What it is used for
Embeddings are the foundation of semantic search, RAG and recommendation systems. At bridgecode, agents that query knowledge bases use embeddings to find relevant information before generating a response, reducing hallucinations and keeping context up to date.