Project: RAG Reranker
Put a relevance pass between retrieval and the model, and find out whether it actually helps.
Embedding retrieval gives you passages that are close to the query in vector space. That is not the same as passages that answer it. Ask about a refund policy and you will reliably get back the shipping policy, the cancellation policy, and the terms of service, because they all live in the same neighbourhood.
So put a relevance pass in between. Retrieve twenty by embedding, ask one Noul per passage whether it actually contains an answer, keep what survives, and hand only those to the generating model.
retrieve top 20 by embedding
↓
one noul per passage: "does this answer the question"
↓
keep passages above threshold (typically 4-8 survive)
↓
generate with the survivors as contextThis is the direct countermeasure to context rot, which the Jagged Edges course covers in its own lesson. Sixteen irrelevant passages in a context window are not neutral padding. They are distractors that pull the generation around, and they make a bad answer nearly impossible to debug because you cannot tell which passage caused it.
Full lesson
Keep reading Project: RAG Reranker
The rest of this lesson — including the interactive exercises and the worked project — is part of Patterns in Production.
- ✓Every lesson in all three courses
- ✓Interactive builders, graders, and playgrounds
- ✓1,000 live Jev credits, for the courses and the playground
- ✓Project source you can run yourself
- ✓Free updates as Jev ships new versions
Already bought them? Sign in to unlock — no need to buy twice.