Basics of NLP and RAG · Lesson 6
Advanced RAG Topics
Improve retrieval with hybrid search (BM25 + vectors), re-ranking (a cross-encoder reorders the top 20–50 results), query rewriting or expansion, and HyDE (embed a hypothetical answer instead of the question).
Structure-aware approaches include parent-document retrieval (search small chunks, return their larger parent), metadata filtering, and GraphRAG, which uses entity relationships for multi-hop questions.
Evaluate RAG with metrics such as context precision, context recall, faithfulness and answer relevance — tools like RAGAS automate this.
Key points
- Re-rankers sharply improve top results
- Query rewriting fixes vague questions
- Parent-document retrieval keeps context
- Measure faithfulness and context recall