Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Nine chapters, one running handbook, a lot of techniques: word-overlap retrieval, embeddings, chunking, grounded generation, citations, approximate indexing, hybrid search, re-ranking, and a real evaluation that found stacking techniques doesn’t automatically help.

This chapter turns the whole series into one interactive test battery. Seven tests, each tied to a specific chapter’s lesson. A handful of settings to toggle. Flip them on and off and watch which tests pass, which fail, and why. Spoiler, verified below, not asserted: no single combination of everything built in this series passes all seven.

Chapter 10 of 10 · Evaluation & integration

Where we left off: Nine chapters, one running handbook, and a real evaluation (Chapter 9) that found stacking techniques doesn’t automatically help.

What we fix now: Turn the whole series into one interactive test battery. Flip five settings on and off and watch, with your own hands, which of seven tests pass, which fail, and why.

By the end, you can:

  • assemble every technique in this series into one configurable pipeline

  • verify, by running it yourself, that no single configuration passes every test

  • explain precisely why the ceiling exists, and what specifically, not built here, could plausibly break through it

Source

The settings

Five toggles, each one straight out of a specific chapter:

  • METHOD: "word_overlap" (Ch1), "embeddings" (Ch2), "hybrid" (Ch7), or "hybrid_rerank" (Ch7+8), controls how a question gets matched to a chunk.

  • CHUNKING: whether the handbook is split into 7 sections (Ch3) or treated as one giant blob.

  • REFUSE_INSTRUCTION: whether the generation prompt tells the model to say “I don’t know” when the context doesn’t answer the question (Ch4).

  • SHOW_CITATIONS: whether the final answer is shown with its source (Ch5).

  • NPROBE: how many clusters an approximate index searches per query (Ch6).

The seven tests

Each test is a real, computable check, not a vibe.

Almost everything fails, which is honest: nothing from this series has been turned on yet. Start flipping settings, one at a time.

Hybrid search alone fixes the exact-token test on top of chunking. The near-miss test (sick days vs. vacation) is still failing though, hybrid didn’t fix that one, Chapter 8’s re-ranker did. Try it.

Notice: the near-miss test now passes, but the exact-token test that "hybrid" alone got right just broke. This isn’t a bug, it’s Chapter 9’s finding again, in interactive form: re-ranking doesn’t purely add accuracy on top of hybrid search, it changes which questions get answered correctly, and not always in the direction you’d hope. There is no METHOD setting in this battery that passes both the exact-token test and the near-miss test at the same time. Try all four values of METHOD yourself if you want to confirm that firsthand.

Bonus (Colab only): bring your own documents

Everything above runs on the toy embedding model built from scratch across this series, which only knows about 200 words, whatever showed up in the training sentences. It will not generalize to a document you bring yourself. To actually run this pipeline on your own text, swap in a real pretrained embedding model (the same sentence-transformers model from Chapter 2’s bonus), replace DOCUMENTS below with your own paragraphs, and re-run. There’s no fixed expected output here, since the text is yours, judge the results the way this series has judged everything else: does the retrieved chunk actually contain the answer, and does the citation point somewhere real?

Open In Colab

What’s still missing

This series covered word-overlap and semantic retrieval, chunking, grounded generation, citations, approximate search at scale, hybrid search, re-ranking, and real evaluation. That’s a genuine, working core of RAG. Left untouched, honestly: conversations that span multiple turns (a follow-up question needs to remember what was just asked), documents that aren’t plain text (tables, images, scanned PDFs), monitoring a live system once real users start asking real questions, and security concerns like a retrieved document containing text designed to hijack the model’s instructions. None of that was covered here, and all of it is real.

Quick check

Before you close this notebook (no peeking ahead):

  1. Why is 6/7 the ceiling for this specific battery of methods and settings, and not a bug or an oversight? Name one change, not built anywhere in this series, that might plausibly break through it.

Check your reasoning ▸

The ceiling exists because tests 1, 2, and 4 each require a different METHOD to pass, and this battery only allows one METHOD active at a time, so no single choice can satisfy all three simultaneously. A plausible fix not built here: a query classifier that detects whether a question is mostly an exact code or number versus natural language, and routes it to keyword search or hybrid_rerank accordingly, effectively making METHOD dynamic per question instead of fixed.

  1. If you had to pick one METHOD to ship in a real system, and you could only fix one of the exact-token or near-miss failures by adding a completely new technique later, which would you leave broken for now, and why?

Check your reasoning ▸

There’s no single correct choice, but a strong answer reasons about real-world cost: if exact-token questions (like extension numbers) are rare in your actual traffic, leaving that one broken and shipping hybrid_rerank, which fixes the more common near-miss confusion, may cost less than the reverse. The key is justifying the choice with an assumption about real usage, not just picking one arbitrarily.

  1. Test 3 (chunking) and test 7 (scale) don’t depend on METHOD at all. Why not, what makes those two toggles independent of which retrieval technique is active?

Check your reasoning ▸

Both toggles operate at a different layer than retrieval method: CHUNKING controls how the document gets split before any scoring method ever runs, and NPROBE controls how the approximate index searches, independent of which scoring function is used once candidates are found. Both are structural properties of the pipeline, not properties of how documents get ranked.

  1. Of everything in “what’s still missing,” which one would you tackle first if this series kept going, and what’s the first concrete example you’d want to build to prove it’s a real problem, the way every chapter in this series did?

Check your reasoning ▸

Answers will vary, but a strong one picks a specific gap and immediately proposes a concrete, testable example in the same style this series used throughout. For multi-turn conversations, for instance: a follow-up question like “what about sick leave?” right after asking about vacation days, and checking whether the system correctly interprets it using the prior turn’s context.

  1. Across all ten chapters, which single fix do you think delivered the most value for the least added complexity, and which delivered the least value for the complexity it added? Defend both choices using something you actually measured or observed, not just intuition.

Check your reasoning ▸

There’s no single right answer, this question is meant to force a genuine trade-off judgment using real evidence from the series. A strong answer cites something specific and measured: for example, citations (Chapter 5) cost almost nothing to add and directly fixed the invisible-wrong-answer problem from Chapter 1, while re-ranking (Chapter 8) added real complexity and, per Chapter 9’s actual measurement, sometimes made recall worse rather than better. What matters is grounding the claim in something demonstrated in the series, not just asserting a preference.


You can now: build, measure, and knowingly trade off a complete RAG pipeline from scratch, and you’ve confirmed with your own hands that no single combination of what’s in this series clears every test at once.

This is the end of the core series. Nothing stops you from going further, see “what’s still missing” above for a genuine, honest list of where to look next.

← Back to the series overview