The weights froze the day training ended, so a running model can't learn a new fact. RAG gets knowledge in the only way that's left — it retrieves the closest passages by cosine similarity and prepends them to the prompt. The model just reads them as context.
After training, the weights are frozen (Part 1: "train vs run"). A live model can't absorb a new fact on its own. There are only three ways to get knowledge in: prompting (paste the text yourself), fine-tuning (retrain the weights — permanent, costly, then frozen again), and RAG.
RAG is automated prompting. Keep your documents as embedding vectors in a library; at query time, embed the question and retrieve the closest passages by cosine similarity — the exact operation of Part 1 lesson 2 — then prepend them to the prompt. Retrieval finds the text; prompting injects it.
So retrieval quality gates answer quality. If the top match is strong, the model answers from real text. If nothing is close, RAG injects nothing and you're back to the frozen weights guessing — the honest fix for hallucination (lesson 14).
You already have the text. Paste it into the context. Instant, but bounded by the window — and you must supply it every time.
Retrieval fetches the right passages automatically by embedding similarity, then prompts with them. Update the library, not the model.
Actually retrain the weights on new data. Permanent and expensive — best for teaching a style or skill, not fresh facts.
TRY → Pick a different query and every bar re-runs cos(query, passage) and re-ranks — the retrieved cards and the assembled prompt rebuild. Bump top-N to inject more. Nothing here is stored: it's the Part 1 lesson 2 cosine looped over the library on every click.
Retrieval is literally the cosine of Part 1 lesson 2, run over a document library. Each passage is a 4-dim vector on the axes [animals, weather, cooking, space]; each query is a vector too. Take "biggest planet" = [0, 0.1, 0, 1] against Jupiter P3 = [0, 0.2, 0, 1]:
Every other passage scores near zero for that query — the next best, storm-cloud P1, is only 0.198. So retrieval cleanly returns Jupiter. The other verified queries: "cats sleep" [1,0,0,0] → P0 cos 0.995 (then P4 0.944); "cook onions" [0,0.1,1,0] → P2 cos 1.00, then P5 cos 0.989.
An embedding model turns each passage into a vector once, offline; at query time you embed the question and rank by cosine — that's the entire retrieval step. Fine-tuning would instead bake the facts into the weights (and re-freeze them); prompting is you doing the retrieval by hand. RAG shines when the knowledge changes faster than you can retrain, and it gives the softmax real text to lean on instead of plausibility — the honest fix for the lesson-14 hallucination.
Frozen weights can't learn a fact — so RAG retrieves it by cosine and prepends it to the prompt. Retrieval is Part 1's cosine; injection is prompting. The model just reads.