What is RAG?
Retrieval-augmented generation is an architecture that retrieves external information at query time and supplies it as context to a generative model before or during response generation.
Why is this important?
RAG grounds model output in current, private, or domain-specific knowledge without placing every fact in model weights. It can improve factuality and sourceability, but only when retrieval quality and context use are reliable.
How it works
The system transforms a query, retrieves relevant documents or records, selects and formats context, sends that context with the request to the model, and returns an answer that may include citations.
Technical example
A support assistant retrieves the current refund policy and the customer's plan before drafting an answer, rather than relying on the model's general memory.
Implementation notes
Measure retrieval recall separately from answer quality, preserve permissions and provenance, control chunking and context size, mitigate prompt injection in retrieved content, and require the model to acknowledge insufficient evidence.


