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 2026 shift: TREC RAG goes agent-first

The TREC RAG home page opens with one line: “The first Agent-first track at TREC!” This page explains what changed, because it changes how you should read the rest of the book.

Two words first

Coding agent
A language model that can act: it reads files, runs commands, calls services and checks its own output, over many steps, toward a goal a person gave it.
Skill
A folder of instructions, reference files and scripts that an agent loads when it needs them. A skill is documentation written to be used by an agent as well as read by a person.

What the track did

In earlier years a track published its rules as a web page for people. In 2026 the RAG track published its rules as a skill. The track's skill repository holds three skills: the 2026 track guidelines, the search service (the Pyserini REST API), and how the ClimbMix corpus was created. The guidelines skill calls itself the canonical 2026 reference for agent and workspace use.

The home page even speaks to agents directly. It tells an agent that was sent there for guidelines to keep its context small and to stay inside the guidelines skill. The skill repeats the idea as a rule: “Load only the reference files needed for the request.”

Then and now

How it used to beAgent-first, 2026
Who reads the rulesA person reads a web pageA person and a coding agent. The rules ship as a skill with small reference files, one per topic.
The corpusMS MARCO V2.1. Teams worked with their own copy and their own index.ClimbMix-400b replaces it. It is served through a hosted search service that a team, or its agent, calls with a token.
The tasksRetrieval, augmented generation only, and full RAG (2025)Retrieval and RAG. The generation-only task is gone.
How many documentsA ranked list cut at a fixed depth“All and only” the relevant documents. The system chooses the depth for each narrative, and padding is discouraged.
Building a runHand-written scripts, one stage at a timeAn agent can plan, write and run the pipeline. The person sets the question and checks the work.
Checking a runThe team runs a validator before uploadThe skill lists the checks: every narrative covered, IDs kept exactly, the right format, no secrets in the output. An agent can run them and fix what fails.
The scarce skillCoding the pipelineAsking a clear question, designing a clean experiment, and verifying what the agent did
New risksBugs in code you wrote and readDefaults nobody chose, changes nobody logged, and cost
Scoring RAG answersHuman assessors and nuggetsAnonymized system-against-system battles, nugget rubric scoring in the AutoNuggetizer style, and citation precision and recall

Sources: the track home page and the guidelines skill, read on 14 November 2026. The “how it used to be” column for building and checking runs describes common practice, not a rule of earlier tracks.

How we used it

  • The search skill set our pace. Our deep-retrieval script follows the request-pacing rule in the track's Pyserini skill: one request in flight per worker and a modest pool of workers.
  • Agents did part of the writing work. In RAGTIME, one of our nugget runs was produced by Claude Code agents that turned each report request into 25 ranked nugget questions.
  • People kept the decisions. Which runs to send, which one is primary, and what counts as a fair comparison were decided by a person and written down before the results came back.

What went wrong

A default nobody chose. Our two main RAG runs were meant to differ in one thing only: how much of each document the writer sees. After the results, we found a second difference. A default setting in a script had given the two runs different document orders, on all 119 narratives. Two things changed at once, so the scores cannot say which one mattered. Chapter 22 uses this as its main example. When an agent or a script does more of the work, checking what actually ran becomes the main job.

How to read the rest of the book

The chapters still teach each step by hand: BM25, fusion, reranking, prompts, nuggets. You need that knowledge more in an agent-first world, because you are the one who checks the agent. Each chapter's lab can be done by hand or given to an agent. If you give it to an agent, the exercise is to audit what it did.

Watch and read