Guide
What RAG is
When a question comes in, the relevant passage is found in your own material first, and the answer is written from it. It answers from material the model never learned.
In short
Find it, read it, answer
A language model answers from what it learned. It does not know the staff handbook, last month's contract or your own product manual, because none of that was public.
RAG adds a lookup step in between. When a question arrives, the relevant passage is found in your material first and handed to the model together with the question. The model reads that passage and writes the answer.
That is what makes it possible to show which document and which passage the answer came from, next to the answer itself. Whoever receives it can check.
What runs
From loading the material to getting an answer
The first two steps run once when material is loaded. The last two run on every question.
Split it
Documents are cut into passages. Too large and unrelated content gets mixed in; too small and the thread is lost.
Turn it into numbers
Each passage is stored as an embedding, a block of numbers. Text with a similar meaning ends up with similar numbers.
Find it
The question is turned into numbers the same way and the closest passages are pulled out, then narrowed and reordered once more.
Write the answer
The chosen passages and the question go to the model together. The passages it read are shown with the answer.
Side by side
How this differs from retraining the model
They are often used together. RAG fits the work where the material keeps changing.
When the material changes
Retraining means running the training again. With RAG the changed document is simply loaded again.
When you need the source
A retrained model cannot say where an answer came from. RAG points at the passage it read.
Limits
Where it falls down
Adding RAG does not settle everything. Three places do the damage.
- A wrong lookup gives a wrong answer. Pick the wrong passage and the model will faithfully write a wrong answer from it.
- How the material is split changes the result a lot. In a document full of tables and figures, cutting out only the text throws the meaning away.
- A source next to the answer still needs a person. Leaving the final check with a person is still the right call.
Common questions
Read next
What WebAR is
Augmented reality opened in a browser with no install. The kinds, and what happens after the link opens.
How GLB and USDZ differ
The format the web reads and the format the iPhone AR viewer reads, side by side.
AR support by browser
Which way opens in which browser. Checked September 2026.
How 3D runs in a browser
WebGL and WebGPU, the order of work, and what makes it slow.
Try it on your own material
With LabRAG you load the material, describe what you need in plain words, and the service that does that work gets built.