Retrieval that finds the right page: advanced RAG

The RAG board draws a question going out to a library before it reaches the model. This lesson works on the part inside that library: how the right page is found.
On 19 September 2024 Anthropic published a short article on a problem every RAG builder meets. Their example chunk, a piece of a company report, reads: “The company’s revenue grew by 3% over the previous quarter.” Read it alone. Which company? Which quarter? The chunk does not say, and the search engine cannot guess. Ask “What was Acme Foods’ revenue growth in Q2 2023?” and this chunk looks the same as the same sentence from any other company’s report.
The page was in the library. The search never brought it back. A better model cannot fix that, because the model only reads what search hands it.
By the end you will be able to find the weak step in a RAG search, fix it with one of five tools, and prove the fix worked with numbers.
Before you start. RAG (Retrieval-Augmented Generation) cut documents into chunks, turned each into a list of numbers, and pasted the nearest chunks into the prompt. RAG Over Your Own Notes built that over real notes, scored words with BM25 (a rare word counts for more), merged two ranked lists by reciprocal rank fusion, and graded retrieval with a golden set (questions whose right note you know). Context Engineering (what goes in the window, and who decides) showed a reranker, a slower model that reads the question and a chunk together, picking the best from twenty finalists. This lesson takes each of those further and adds three new tools.
The history (optional)
Anthropic’s article on this fix is dated 19 September 2024. The late interaction idea comes from Omar Khattab and Matei Zaharia, whose paper “ColBERT” was accepted at SIGIR 2020 (arXiv 2004.12832). The GraphRAG paper, “From Local to Global: A Graph RAG Approach to Query-Focused Summarization” by Darren Edge and colleagues at Microsoft, first appeared on arXiv on 24 April 2024 (2404.16130). Nothing later in this lesson depends on these dates.
Think of a thick file in a government office. Every page has a number, but nobody can read the whole file for each visitor. The office needs a way to pull out the one right page. That is all retrieval is, and each tool below is a better way to pull it.
