Retrieval, filters, and re-ranking
On This Lesson 4 topics
This lesson is planned. The outline below lists the topics it will cover. The full lesson has not been published yet.
In this lesson
retrieve the right chunks using filters and optional re-ranking.
Planned topics
- Filter by metadata before or during the vector search: language, product, customer tier. A wrong-language chunk is a wrong answer.
- Fetch more candidates than needed (for example 20), then keep the best few.
- Re-ranking: a second model scores query-chunk pairs and reorders candidates; better quality, extra latency and cost.
- Set a minimum similarity threshold: weak matches should count as "nothing found".
- Hybrid search (MID-067) helps with exact terms such as order or policy codes.
Draft outline details
Demonstration
pipeline: filter lang = 'ar' AND audience = 'customer' → top 20 by vector/hybrid → optional re-rank → top 4 above threshold.
Check your understanding
Why a similarity threshold?
Show answer
So weak matches lead to "I don't know" instead of a made-up answer.
Practice
Apply this lesson with the module's lab, exercises and quiz.
Marking a lesson complete is optional and you can undo it any time. Your progress stays in this browser.