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.