Embeddings and Vector Search
How meaning becomes math — and how it powers semantic search and recommendations.
Inspired by learning material from Google
Embeddings are one of the most useful ideas in modern AI: representing meaning as numbers.
What is an embedding?
An embedding is a list of numbers (a vector) that captures the meaning of text, an image, or other data. Similar items have similar vectors.
Measuring similarity
We compare vectors using cosine similarity or distance. Close vectors mean similar meaning — 'car' and 'automobile' land near each other.
Vector search
To find relevant content, embed a query and search for the nearest vectors in a vector database. This enables semantic search — matching by meaning, not exact keywords.
Powering RAG
Retrieval-Augmented Generation uses vector search to fetch relevant documents, then feeds them to an LLM for grounded answers.
Key takeaways
- Embeddings turn meaning into vectors.
- Nearby vectors mean similar content.
- Vector search enables semantic search and RAG.