Skip to catalogue

165

retrieval-augmented generation

also RAG

Fetch passages, then let the model answer from those passages. The retrieve step is the product. The prompt is not.

What is retrieval-augmented generation?

RAG inserts retrieved documents into the context so the model answers from them instead of memory. Quality depends on chunking, the query, the ranker, and whether the answer is allowed to say “not in the sources.” A model that ignores the passages is just chat with extra tokens.

Why does retrieval-augmented generation matter when vibe coding?

Models stuff the top 20 chunks into a prompt and call it RAG. No citation, no refusal, no eval. Name the retrieve contract.

How do you do retrieval-augmented generation?

Retrieve few, relevant chunks. Require citations that point at them. If none are relevant, say so. Evaluate retrieval separately from the prose.

How do you ask a model for retrieval-augmented generation?

Answer only from the retrieved passages. Cite the passage ids. If they do not contain the answer, say you do not know. Do not use outside knowledge. Keep the retrieval filter (tenant) in the query, not only in the prompt.

What goes wrong with retrieval-augmented generation?

Evaluating RAG by whether the paragraph sounds confident. Evaluate whether the cited passage supports the sentence.

adjacent