Retrieval-Augmented Generation (RAG)
You now have the two halves of Pedal Point's assistant. The model writes fluent answers but invents facts it was not given. Embeddings can find the right help page for any question. Put them together and you get the most common pattern in AI engineering: retrieval-augmented generation, or RAG.
The rule
Retrieve the right facts first, then let the model write.
RAG has two phases.
Before any question (indexing):
- Chunk. Split each document into pieces small enough to be specific, often a few paragraphs.
- Embed. Turn each chunk into a vector.
- Store. Save vectors, text and labels (page, country, date) in a vector database.
When a question arrives (answering):
- Embed the question with the same model.
- Retrieve the few nearest chunks.
- Generate. Put those chunks into the prompt with an instruction like "Answer using only the reference text below. If it does not contain the answer, say so."
Reference text:
[Returns policy] Unused items can be returned within 30 days...
[Helmets] For hygiene reasons, helmets can only be returned sealed...
Question: Can I return a helmet I've worn once?RAG gives the model facts that are private, fresh, or too specific to be in its training. Updating knowledge means editing documents, not retraining. The model can also cite which chunk it used.
Dynamic filters make retrieval sharper. Before comparing meanings, restrict the search by labels: only chunks for the customer's country, or only pages for their bike model. Similar meaning is not enough if the page is about another region's rules.
RAG lowers the rate of invented answers but does not remove it. The model can still misread a chunk or blend it with what it learned in training. That is why the instruction to admit gaps matters, and why you check answers against their sources.
The shortcut
Say the pipeline as two lines: "Chunk, embed, store" once; "embed, retrieve, generate" per question. When an answer is wrong, walk the steps and find where it broke.
Check retrieval first
Did the helmet chunk come back? It did not: only the general returns chunk did.
The trap is blaming the model for a retrieval miss. If the right text never reached the prompt, no model can use it. Test retrieval on its own.
Drills
Answer fast — trust the rule.
In RAG, which step happens once, ahead of time, rather than for every question?
A Canadian customer gets the US shipping policy. Which fix targets the cause?
The right chunk was never retrieved, and the answer was wrong. What should you fix first?
The returns window changes to 45 days. With RAG, what is the update?
Why tell the model "if the reference text does not contain the answer, say so"?
Remember
- Retrieve the right facts first, then let the model write.
- Chunk, embed, store once; embed, retrieve, generate per question.
- Wrong answer? Check retrieval before blaming the model.
