A vector embedding is a list of numbers that represents the meaning of a piece of data — a word, sentence, image, or document — as a point in space. An…
Define a vector embedding as meaning turned into coordinates.
A vector embedding is a list of numbers — often hundreds or thousands of them — that represents the meaning of some data as a single point in a high-dimensional space. An embedding model produces it.
The trick: the model is trained so that similar meanings get nearby points. 'Dog' and 'puppy' end up close; 'dog' and 'invoice' end up far apart. Meaning becomes geometry.
Embeddings work for sentences, whole documents, images, and audio too — anything you can train a model to place meaningfully in space.
Explain how distance in embedding space maps to semantic similarity.
Because the model learned to cluster related concepts, the DISTANCE between two vectors tells you how related the underlying items are. Short distance = similar meaning; long distance = unrelated.
This is powerful because 'How similar are these two paragraphs?' becomes a fast math operation on two lists of numbers — no keyword matching required, so 'car' can match 'automobile'.
Introduce cosine similarity as the standard score.
The most common score is cosine similarity — the cosine of the angle between two vectors. It ranges from 1 (pointing the same way, very similar) down to 0 (unrelated). It ignores length and focuses on direction, which suits meaning.
To find the best matches for a query, you embed the query and return the stored vectors with the highest cosine similarity.
q = embed("how to reset my password") for doc in docs: doc.score = cosine(q, doc.vector) best = sorted(docs, key=lambda d: d.score, reverse=True)[:3]
Embed the query, score every stored document by cosine similarity to it, and return the top 3. A vector database does this at scale in milliseconds.
List the real applications and how RAG relies on them.
Embeddings power semantic search (find by meaning, not keywords), recommendations (items near what you liked), clustering and deduplication, and Retrieval-Augmented Generation (RAG), where relevant documents are fetched by embedding similarity and fed to an LLM.
Stored embeddings live in a vector database, which finds nearest neighbours fast even across millions of vectors.
A vector embedding represents meaning as a point in space; an embedding model places similar items close together. Distance — usually cosine similarity — measures semantic relatedness, so search matches by meaning, not spelling. Embeddings, stored in a vector database, power semantic search, recommendations, and RAG.
You have 10,000 support articles. Describe how you'd use embeddings to let a user find the right article by meaning, and what you'd store where.
What is a vector embedding?
Embeddings turn meaning into coordinates so similarity becomes distance — the foundation of semantic search and RAG.
How is the similarity between two embeddings usually measured?
Cosine similarity scores direction, matching how embedding space encodes meaning.
In RAG, what are embeddings used for?
RAG embeds the query, finds nearest-neighbour documents by similarity, and grounds the LLM's answer in them.