humanflow

Retrieval-augmented generation

Also called RAG

Retrieval-augmented generation is the practice of searching a document collection for relevant material and placing that material in the model's prompt before it answers, so the response is grounded in retrieved text rather than in recollection alone.

Last reviewed 15 August 2026 · The HumanFlow team

In plain English

Instead of asking someone to answer from memory, you hand them the file first and ask them to answer from it.

The model still writes the answer. What changes is that the relevant source text is sitting in front of it while it does.

A worked example

The same question answered two ways.

Without retrieval:
  Q: What did Weber-Wulff et al. find about detection tools?
  A: [model recalls the general shape of the literature and may
     produce a plausible figure, a plausible journal and a
     plausible year, any of which can be wrong]

With retrieval:
  Q: same question
  → search the paper collection, paste the relevant passages
  → model answers from the passages and can quote them

The first path is where fabricated citations come from. Nothing checks recollection, and a confident wrong answer is as probable as a confident right one.

The second path can be checked, because the passages the answer came from are available to compare against.

It is not a guarantee. If retrieval returns the wrong passage, or the model summarises a correct passage incorrectly, you get a well-grounded wrong answer — which is harder to spot precisely because a real source is attached to it.

Why it matters for AI detection

It is the main reason some AI tools now cite sources you can click and others still invent them, and knowing which kind you are using tells you how much checking your output needs.

It is also relevant to detection research directly: retrieval over a corpus of previously generated text was proposed as a defence against paraphrase attacks, in the paper that demonstrated those attacks defeat detectors.

For a student, the practical point is unchanged by any of it. A citation produced by a retrieval system still has to be opened and read, because a source that exists is not the same as a source that says what the sentence claims.

Commonly confused with

Fine-tuning
Retrieval changes what the model can see right now. Fine-tuning changes how the model behaves in general. Facts belong to the first; style belongs to the second.
Web search
A model with web access is doing retrieval over the open internet. RAG usually refers to retrieval over a chosen collection, which is why an enterprise system can be grounded without being connected to anything public.

Read next

Part of the AI detection glossary.