ContentsRAG from Scratch to TRECAdisak Sukul · Iowa State University

Start here

Part 1 · Foundations

Part 2 · Finding the evidence

Part 3 · Writing the answer

Part 4 · Judging RAG

Part 5 · TREC and the 2026 tracks

Part 6 · Case studies: our submissions

Part 7 · Beyond text: video

Part 8 · Streams and advanced RAG

Back matter

Part 0 · Start here

The big picture on one page

A RAG system answers a question in two moves. First it looks things up. Then it writes, using only what it found. Everything else in this book is a detail of one of these steps.

RAG in one sentence

Retrieval-augmented generation (RAG) means: before a language model answers, a search system fetches documents about the question, and the model writes its answer from those documents and says which ones it used.

Think of an open-book exam. A language model on its own takes the exam from memory. A RAG system is allowed to open the book, and it must write the page number next to each claim.

The pipeline

Here is the pipeline we ran in the TREC 2026 RAG track. Most RAG systems have the same seven steps, with different choices in each one.

  1. 1AskThe user's need, written out. In TREC RAG 2026 it is a long paragraph called a narrative.Ch 7, 24
  2. 2FindSearch the collection for candidate documents. We used BM25 on seven versions of the query.Ch 5, 6, 7
  3. 3CombineMerge the seven result lists into one. We used Reciprocal Rank Fusion.Ch 8
  4. 4OrderA slower, smarter model re-sorts the top 100 documents.Ch 9
  5. 5CutDecide how much of each document the writer sees: 500 characters, or up to 1,000 words.Ch 10, 13
  6. 6Write and citeA language model writes the answer. Each sentence names up to three documents that support it.Ch 12 to 15
  7. 7JudgePeople and automatic judges score the answer: does it contain the key facts, and do the citations hold?Ch 17 to 22

What can go wrong at each step

StepTypical failureWhat it looks like in the answer
FindThe right document is never retrievedA key fact is missing, and no later step can add it
CombineScores from different searches are added although they are on different scalesOne search method silently decides everything
OrderGood documents sit low in the listThe writer leans on weaker documents it read first
CutThe evidence is cut before the useful partThe answer is vague where the source was specific
Write and citeThe model adds a claim from memoryA sentence with a citation that does not support it
JudgeThe judge prefers fluent text to correct textThe wrong system wins the comparison

Three questions to keep asking

  1. Did we find it? Retrieval sets the ceiling. A writer cannot cite a document it never saw.
  2. Did we use it faithfully? Every claim should trace back to a retrieved document.
  3. How do we know? A result is only as good as the experiment and the judge behind it.

Watch and read