What is RAG (retrieval-augmented generation)?
Also called: retrieval augmented generation · grounding
RAG is a pattern where relevant documents are retrieved first and pasted into the prompt, so the model answers from your data instead of from memory.
Models know what they were trained on and nothing about your files, your customers or last week. RAG fixes that without retraining: a search step finds the passages relevant to the question (usually with embeddings), and those passages go into the prompt with an instruction to answer from them.
The quality of a RAG system is mostly the quality of retrieval and of the instruction. Retrieve the wrong chunks and the answer is confidently wrong; forget to say "use only the provided text" and the model blends its memory in.
- Instruct: answer only from the provided passages; say when they don't contain the answer.
- Ask for citations to the passage used.
- Chunk documents so each piece makes sense on its own.
Use it right now
Ask our brain anything on the homepage — it remembers the whole conversation — or write a brief in the Studio and see the prompt it compiles to.