toolcall() ← all concepts

// concept · embeddings

A point on a map of meaning.

That's the whole idea. An embedding turns any text into coordinates, and things that mean the same thing land close together. Everything else — semantic search, RAG — falls out of that.

// 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.

# same model, any input → a vector "cat" → [0.12, 0.91, 0.04, …] "dog" → [0.14, 0.88, 0.05, …] # close to cat "car" → [0.77, 0.10, 0.66, …] # far away

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.

Be careful with this one. It's a real result — from word2vec (Mikolov, 2013) — but it's an intuition pump, not exact: the method discards the input words when searching, the match is only "closest," and this clean arithmetic is a property of static word vectors. It does not transfer cleanly to the modern contextual sentence-embeddings used in RAG. Great for intuition; don't build on it.

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:

1. embed your docs once → store the vectors 2. embed the question 3. grab the nearest vectors # = retrieval

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