Build and instrument a minimal RAG pipeline
CodingAdvanced⏱ 1 dayRAGragimplementationinstrumentationevaluation
Problem
Implement a minimal retrieval pipeline end to end and instrument it so that each stage's recall is measurable.
- Chunk a corpus, embed, index, retrieve top-, and construct a context.
- Measure chunk recall, index recall (against brute force) and truncation recall separately.
- Show the effect of normalisation on ranking, and of chunk size on chunk recall.
- Demonstrate the recall ceiling by computing end-to-end accuracy against the product of stage recalls.
Implement it, then check the implementation against something you can verify independently.
Write it
Solve it here10 tests · Python runs in your browser
⌘/Ctrl + ↵ to run · limit 60s · draft saved in this browser
10 tests will run against your code. The first run downloads the Python runtime — several megabytes, once per browser.
Solution
Opening this before you have a real attempt on paper is the fastest way to feel like you understand something you cannot reproduce.
Related problems
All problems| Solved | Problem | Field | Type | Difficulty | Time |
|---|---|---|---|---|---|
| End-to-end recall arithmetic for a RAG system | RAG | Numerical | 15 min | ||
| Perplexity is not comparable across tokenisers | LLMs | Numerical | 15 min | ||
| Implement backpropagation from scratch run | Deep Learning | Coding | 3 hours | ||
| Implement kernel ridge regression run | Classical ML | Coding | 1 hour | ||
| Implement multi-head attention from scratch run | Deep Learning | Coding | 3 hours |