// text → coordinates
An embedding model takes a word, sentence, or document and returns a list of numbers — a vector. Treat it as coordinates on a map. "cat" lands near "dog"; both land far from "car." Similar meaning, nearby points.
Similarity is just distance between points — usually cosine similarity (the angle between the vectors). You compare the points, never the raw words. (The real map has hundreds of dimensions; the 2D picture is a simplification.)
The famous king − man + woman
The party trick you've seen: king − man + woman ≈ queen. Meaning has directions, and you can do arithmetic on them.
Why it's the engine of RAG
Because it matches meaning, not exact words — a question and a document can match with zero words in common (even across languages). The retrieval loop:
Two rules that keep it working: use the same model for documents and queries (and its query-vs-document mode if it has one), and remember that vector similarity isn't the same as true relevance — which is why production RAG adds reranking (and why chunking matters).
Sources: OpenAI — embeddings · Pinecone — vector similarity · Cohere — semantic search · Mikolov et al. — word2vec
One concept a week. Free.
The deeper, copy-paste version of each ToolCall short — in your inbox.
// total: 0.00 · spam: void · unsubscribe: one click
