Module 10 · RAG · Lesson 22 of 34
Making RAG work well
Hybrid search, re-ranking, metadata filters, freshness, and evaluating retrieval and answers separately.
In this lesson · about 18 minutes
- Name four techniques that improve retrieval
- Evaluate retrieval and generation separately
- Diagnose a bad RAG answer to its root cause
Better retrieval
- Hybrid search: combine embedding search (meaning) with keyword search (exact terms, codes, names).
- Re-ranking: retrieve 20–50 candidates cheaply, then use a stronger model to re-order them and keep the best 3–5.
- Metadata filters: only this customer's documents, only current policies, only the user's language. Enforce access rights here, in code.
- Query rewriting: turn "what about Sundays?" in a conversation into "Do you deliver on Sundays?" before searching.
- Freshness: re-index when sources change; store a last-updated date; remove outdated versions.
Evaluate the two halves separately
- Retrieval: for each test question, did the right chunk appear in the top k? (recall@k)
- Generation: given the right chunks, is the answer correct, complete and faithful (every claim supported by a source)?
When an answer is wrong, this split tells you where to look.
Sorting drill
Diagnose the failure
Where is each problem most likely?
- The right policy chunk was never in the top 5
- The right chunk was retrieved, but the answer added a refund promise not in it
- The answer quoted last year's delivery prices correctly from the index
- A search for part code “BX-220” returned chunks about boxes
- The answer is correct but ignores the second half of the question
0 of 5 sorted
Decision scenario
The confident wrong answer
You own a company's internal HR assistant built with RAG.
An employee asks how many days of parental leave they get. The assistant answers “12 weeks” with a citation. The current policy says 16 weeks; 12 weeks was the old policy, still in the index.
What do you recommend?
0 of 3 options explored. Try the others to see how each would play out.
Check your understanding0 of 2 correct
Design your project's RAG setup.
Consider these questions and write down your thoughts. What you write stays on this device.
Quiz score: 0 of 2
Written by Noviq Academy in its own words. The simulators are small teaching models that keep the real idea and leave out the scale; their numbers (prices, speeds, scores) are illustrative. Model names, prices and features change quickly, so check your provider's current documentation before you build. Read-aloud uses your device's built-in voices.