Course contentsShow
← Machine Learning and Deep Learning
Lesson 2034 of 3,53843. Retrieval-Augmented Generation: Advanced TechniquesFree lesson

Handling Missing Information

Detect when retrieved context lacks answers and implement fallback strategies like wider search or abstention.

Handling Missing Information

What you'll learn: How to detect when your RAG system retrieves context that doesn't actually contain the answer, and what to do about it.

The Silent Failure Problem

Even with perfect retrieval mechanics, sometimes the knowledge base simply doesn't contain the information needed to answer a user's query. This is a common RAG failure pattern: the system retrieves documents, finds nothing useful, but confidently generates an answer anyway—often hallucinating plausible-sounding nonsense.

Think of it like asking a librarian for a book on quantum entanglement in a library that only has romance novels. A good librarian says "I don't have that." A bad one invents book titles and plot summaries.

Detection Strategies

Your RAG system needs to recognize absence of information:

  1. Semantic relevance threshold: After retrieval and reranking, check if the top-scoring chunks exceed a minimum similarity threshold. If all scores are suspiciously low, the context likely doesn't contain the answer.

  2. LLM-based verification: Before final generation, prompt the LLM: "Does the provided context contain information to answer this question? Yes/No/Uncertain." Use this as a gate.

  3. Confidence scoring: Ask the LLM to rate its answer confidence based solely on retrieved context (0-10 scale). Low scores trigger fallback behavior.

Fallback Strategies

When missing information is detected:

  • Widen the search: Increase top-K retrieval, try different query reformulations (using techniques from lessons 2011-2022), or switch to hybrid search
  • Abstention: Respond with "I don't have enough information in my knowledge base to answer that confidently"
  • Partial answers: "Based on available context, I can tell you X, but I cannot address Y"
  • Graceful degradation: Offer related information or suggest alternative queries

Key Takeaway: RAG systems must detect when retrieved context lacks answers—using relevance thresholds, LLM verification, or confidence scoring—and either widen search parameters or explicitly abstain rather than hallucinate responses.