Skip to main content
AI & Agents

RAG (Retrieval-Augmented Generation)

RAG is a technique where an AI system retrieves relevant passages from your own documents at query time and generates an answer grounded in them, with citations. The model itself is unchanged — it is supplied with the right information at the moment it is needed, which is why updating knowledge means editing a document rather than retraining.

RAG is the standard approach whenever answers must be verifiable, the underlying information changes, or different users are permitted to see different documents. Because entitlements can be applied to the retrieval step, two users asking the same question can legitimately receive different answers — something a model with knowledge baked into its weights cannot do.

Most failed RAG projects fail at retrieval rather than generation. The pattern is consistent: a pilot works on twenty clean documents, then collapses against forty thousand real ones with scanned PDFs, superseded versions and tables that lost their structure during parsing. Chunking that ignores document structure and pure vector search on exact identifiers are the two most common defects, and both are fixable.

RAGFine-tuning
SolvesModel lacks informationModel responds in the wrong way
Updating knowledgeEdit a document — instantRetrain — slow and costly
CitationsYes — every claim traceableNo — knowledge is baked in
Permission filteringYes, at query timeNo

Codazz builds this in production — RAG Development.

FAQ

RAG (Retrieval-Augmented Generation)
FAQ.

Common questions about rag (retrieval-augmented generation).

Ask Us Anything

RAG changes what the model knows; fine-tuning changes how it behaves. If the problem is that the model lacks information, retrieval is the answer. If it has the information but responds in the wrong format, tone or structure, fine-tuning is. Using fine-tuning to teach facts is the most common and most expensive mistake, because updating one fact then requires retraining.

Yes. Retrieval happens outside the model — passages are fetched and included in the prompt — so it works with any model that accepts context, including self-hosted open-weight ones. That portability is a genuine advantage: retrieval work survives a model switch, whereas a fine-tune is tied to the model it was trained on.

By making the retrieved sources the authority rather than the model. A verification pass re-reads each source to confirm it actually supports the claim attributed to it, and anything failing that check is removed. Because every assertion carries a link, a hallucination becomes visible — a reader can click through and find the source does not say that.