Ch 17: Advanced RAG & Knowledge Systems - Advanced¶
Track: Advanced | Try code in Playground | Back to chapter overview
Read online or run locally
You can read this content here on the web. To run the code interactively, either use the Playground or clone the repo and open chapters/chapter-17-advanced-rag-and-knowledge-systems/notebooks/03_chunking_and_evaluation.ipynb in Jupyter.
Chapter 17: Advanced RAG — Notebook 03 (Chunking & Evaluation)¶
Retrieval quality is decided before the query: by chunking and metadata. We finish by measuring the pipeline with Recall@k, MRR, and nDCG.
What you'll learn¶
| Topic | Section |
|---|---|
| Chunk size and overlap trade-offs | §1 |
| Metadata for filtering | §2 |
| Recall@k, MRR, nDCG | §3 |
Time estimate: 2.5 hours
Key concepts¶
- Chunking — too big dilutes relevance, too small loses context.
- Overlap — preserves context across chunk boundaries.
- nDCG — rewards putting relevant results higher, not just including them.
Chunking and metadata shape what retrieval can even find; Recall@k, MRR, and nDCG turn 'seems better' into a number you can optimize.
Run the full notebook in the chapter folder for code and outputs.
Generated by Berta AI