What is retrieval-augmented generation (RAG)?
PICTURE THIS: AN LLM TURN
Simple meaning
RAG retrieves relevant documents and stuffs them into the prompt so the LLM answers with that evidence.
WHY — Tokens instead of words?
LLMs use tokens (not full words) because it helps them:
who only read docs from people who shipped.
and tied to GenAI / LLM work.
Each piece maps to a number the network can learn.
Fixed pieces are what transformers expect as input.
STEPS — What happens with tokens?
Before the model can read a sentence, it goes through these steps:
- 1RAG retrieves relevant documents
and stuffs them into the prompt so the LLM answers with that evidence.
- 2The model is not
the only knowledge source.
- 3It is the standard
pattern for private or frequently changing data.
- 4Context mix
Attention looks at nearby tokens together.
- 5Next token
The model scores what should come next.
- 6Decode
IDs turn back into readable text.
EXAMPLE — See it in action
Here's a short line you can speak, broken into clear beats:
Note: Adapt this scaffold to your own project — keep it under 60–90 seconds.
Key takeaway
RAG retrieves relevant documents and stuffs them into the prompt so the LLM answers with that evidence. The model is not the only knowledge source.