Index

Free, with Google

Keep going, free.

A free account opens lessons 2 and 3 of every track, 33 more lessons, and keeps your progress and review cards on every device.

Start free with Google

A chalk plan

Open everything on chalk.

Every lesson, board, video, lab and paper, and the full review decks. Yearly is $39/year.

See plansStart free instead

Module 01 · Portfolio Projects · Build It Yourself · about 20 min to read

Play it as a journeyTutor comes with a plan

P7: A RAG app with an eval set

S3 - Build a Redis Server
S3 - Build a Redis Server · Open board

: the board shows a client sending a command and a server looking the answer up in what it stores. A RAG app is the same shape. A question goes in, a store is searched, and an answer comes back. This project adds one more step: a score that says whether the answer was right.

Asha Rao (a made-up learner, so every number below is a teaching value unless it says it was measured) builds a help bot for a made-up train-ticket app called TicketKart. She types a question and the bot answers from the app’s help pages. It looks good in the demo. A friend asks, “Can I pay with cash?” The bot answers about UPI and says nothing about cash. A second friend asks, “Can I book a bus ticket?” The bot answers about train tickets, as if the question was about trains.

Asha cannot tell if the bot is getting better or worse when she changes it. She has only three questions she tried by hand. A hiring engineer who reads “built a RAG app” cannot check the claim either.

By the end of this lesson you will be able to build a small RAG app, write an eval set for it, change it one step at a time, and show before and after numbers that a stranger can rerun.

The history (optional)

Cyril Cleverdon ran the Cranfield experiments at the College of Aeronautics in Cranfield, England, in the 1960s. The test collection that came out of them holds about 1,400 papers on aerodynamics and 225 questions. A person had judged which papers answered which question. With one fixed set of questions, two search systems could be compared by a number. The Stanford book “Introduction to Information Retrieval” calls it the pioneering test collection. Nothing later in this lesson depends on these facts.

Before you start. RAG (Retrieval-Augmented Generation) showed the RAG pipeline: cut documents into chunks, find the chunks nearest the question, and paste them into the prompt. RAG Over Your Own Notes built that over real notes, scored chunks with BM25 (a word-matching score where a rare word counts for more), and graded it with a golden set. Retrieval that finds the right page: advanced RAG gave you hit@k and MRR, the numbers for how high the right chunk ranks. P6: A model you can defend gave you the habit of scoring on rows the model never learned from. A repo a stranger can judge in two minutes gave you the page a stranger reads in two minutes.

flowchart LR
  Q["question"] --> R["search 20 sections"]
  R -->|"top score"| G{"score above the threshold?"}
  G -->|"no"| N["Not in the help centre"]
  G -->|"yes"| A["quote the best sentences + [source]"]
  A --> E["eval set: right section? right fact? right refusal?"]
  N --> E

Lesson 14 of 19 in Portfolio Projects

The rest of this lesson is part of a plan.

A plan opens every lesson, board, video, lab and paper on chalk. Yearly is $39/year.

See plansAlready a member? Sign in

Or start free: a free account opens lessons 2 and 3 of every track.

In this lesson

  • An eval set is a list of questions with the right answers written first
  • Retrieval first: one chunk per section beat fixed-size chunks
  • A dev set to tune on and a test set to report
  • Generation: quote the source, and refuse when search is weak
  • The files
  • The prompt a real model would get
  • Limits and trade-offs

Terms it explains: eval set, hit@1, dev set, test set, refusal threshold, Common mistakes, bulk string, CRLF framing, RESP.

Review Portfolio Projects