AI Hints
Home›RAG Tutorial›Evaluating Retrieval
RAG · Lesson 71 of 120

A Test Set

Questions with answers.

⏱ 2 min read▶ Video at 1:10:27🎓 Free
Watch this lesson in the RAG courseWatch on YouTube ↗Full RAG course

Every evaluation starts with a test set. Each item is a real question, the page that answers it, and a short fact the answer must contain. Ours has ten questions about Northwind.

A Test Set
From the video: A Test Set
  • Real questions
  • The right page
  • A key fact

Our test set

Each item has a question, the source page that answers it, and a fact that must appear in the right chunk. The questions use customers' own words. Some, like this one, we already know are hard.

eval_set.jsonjson
[
 {"question": "What does E03 mean?",
  "source": "ebike_errors.md", "fact": "speed sensor"},
 {"question": "What is the APR?",
  "source": "finance.md", "fact": "9.9"},
 {"question": "How many hours until my e-bike is full again?",
  "source": "ebike_battery.md", "fact": "4 hours"},
 {"question": "How much is a rental deposit?",
  "source": "rentals.md", "fact": "£150"},
 {"question": "When is the York shop open?",
  "source": "stores.md", "fact": "5:30pm"},
 ...
]

Good test sets

Use real customer questions where you can, from support emails or search logs. Include hard cases, like codes and odd wording. Start with twenty to fifty questions, and add every bug you find.

keyvalue
Sourcereal questions
Includehard cases
Start with20 to 50
Grow itadd every bug

Summary

A test set holds real questions, the right page, and a key fact. Next, measuring hit rate.

Key takeaways
  • Question
  • Source
  • Fact
Next up: Hit Rate — did we find it