teacher
Sign in

Retrieval-Augmented Generation (RAG)

Give a model the right pages at question time by searching your documents first, then answering from what was found.

40 min5 interactive

Why retrieval

A model only knows what was in its training data, which has a cutoff date and never included your private documents. Asking it about your refund policy gets a confident guess.

RAG (Retrieval-Augmented Generation) fixes this by searching your documents at question time and pasting the best matches into the prompt. The model then answers from text it can see.

ApproachGood forWeak at
RAGFacts that change, private data, citing sourcesNeeds a search system you must maintain
Fine-tuning (next lessons)Style, format, narrow skillsPoor at adding facts; stale after training
Long context (paste everything)Small corpora, one-off tasksCost and latency grow with every call
1 of 8