systemdesign.academyAI EngineeringFree lessonsSign inGet the course
  1. Home

Where this shows up in interviews

This idea carries a full system design question on its own. Each walks through the full answer.

  • →Design an AI Agent for Customer Support
Previous lessonQuery Transformation and Routing: Fixing Retrieval Before It RunsNext lessonRAG Caching and Cost: Semantic Cache, Embedding Reuse, and the Bill

System Design

  • Foundation
  • Intermediate
  • Advanced
  • Capstone

AI Engineering

  • Foundation
  • Data, RAG and Agents
  • Evaluation, LLM Ops and Security

systemdesign.academy

  • Home
  • Glossary
  • Interview prep
  • Reviews
  • About
  • Pricing
  • Privacy
  • Terms
  • Refunds
  • Delivery
  • Contact
AI Engineering: Data, RAG and Agents
  • Retrieval and RAG in Production
  • RAG Evaluation: Localizing Failure Between Retrieval and Generation
  • AI Engineering · Retrieval Rag

    RAG Evaluation: Localizing Failure Between Retrieval and Generation

    Free preview: the first part of this 13-part lesson.

    Already bought the course? Sign in to read the whole lesson.

    this lesson is part of

    AI Engineering

    Unlock this lesson and the 199 other paid lessons

    • 210 lessons in 16 chapters
    • 118 lessons built on a lab that really ran
    • An AI tutor beside every lesson that answers and draws
    • Lifetime access, every new lesson included

    $49 once, by PayPal

    See the AI Engineering course

    The rest of this lesson

    1. Every Metric Attaches at One Boundary
    2. You Cannot Diagnose What You Did Not Label
    3. Recall@k: Was the Answer Ever in the Room
    4. Context Precision: Rank Order Is Part of Retrieval Quality
    5. Faithfulness: Claims Against Context, Not Against the World
    6. Answer Relevance: Grounded Is Not the Same as Useful
    7. The Diagnostic Order, Then the Code
    8. The 2x2 That Names the Fix
    9. Is Your System Retrieval-Bound or Generation-Bound
    10. Building the Eval Set That Makes This Possible
    11. RAGAS, Judges, and What the Scores Cost
    12. Knowledge Check

    read the rest of this lesson in

    AI Engineering

    Unlock this lesson and the 199 other paid lessons

    • 210 lessons in 16 chapters
    • 118 lessons built on a lab that really ran
    • An AI tutor beside every lesson that answers and draws
    • Lifetime access, every new lesson included

    $49 once, by PayPal

    See the AI Engineering course

    Continue this lesson

    in Retrieval Rag

    This lesson is part of the AI Engineering course. Unlock the full course, a separate one-time payment, for lifetime access.

    One-time payment. Lifetime access. No subscription.
    Global
    $49/lifetime

    One-time payment by card or PayPal

    Get Lifetime Access
    Foundation lessons free, try before you buy
    India Special
    India
    ₹999/lifetime

    One-time payment: UPI, card or netbanking

    Get Lifetime Access
    Foundation lessons free, try before you buy
    Every ML Platform lesson, Foundation to Advanced
    Real architecture diagrams with real tool logos
    MLOps, LLMOps, and data engineering in depth
    Quizzes with instant feedback
    Built and reviewed by senior engineers
    Lifetime access, all future content included

    Foundation lessons of this course are free, no payment needed. Try them now

    One Wrong Answer, Two Possible Culprits

    Your support bot just told a customer the refund window is 30 days. The policy document says 14, and it is sitting right there in the corpus, indexed and searchable, an ordinary chunk among a few hundred thousand others.

    There are exactly two stories that produce this answer. In the first, the retriever never surfaced the chunk that states the deadline, so the model filled the gap from its training memory, where some other company's 30 day policy lives. In the second, the retriever delivered the right chunk and the model talked past it anyway. The user sees the same wrong number either way. The fixes have nothing in common. The first story is repaired in the index: chunking, , reranking, the query transform. The second is repaired in the prompt or the model. Pick the wrong story and you can spend a sprint tuning grounding instructions while the actual bug sits in a chunk boundary that split the deadline sentence in half.

    One wrong answer forking into two suspects: a red banner reading the bot says the refund window is 30 days, splitting into a blue retriever card whose story is that the deadline chunk never made the top-k so the model filled the gap from training memory, and a violet generator card whose story is that the right chunk arrived and the model talked past it, each card listing its symptom, its metric signature (low recall@k versus low faithfulness), and its disjoint fix set

    This is why a single answer-quality score is useless for debugging. It can tell you the system got worse. It cannot tell you which of the two stages to open, and only has two. That constraint is a gift: with just two suspects and a metric attached to each, every wrong answer becomes a case you can actually prosecute, not a mystery you argue about in a retro. The Evaluating RAG and Agents lesson in the ml-advanced Evals chapter makes the general argument, extending the decomposition to tool calls, trajectories, and task rollups for agents. This lesson stays inside the two RAG stages and works them at the practitioner level: the exact metrics, the diagnostic order, the 2x2 that assigns every failure to a cell with a named fix, and the labeled eval set that makes any of it computable. By the end you should never again look at a wrong RAG answer and shrug.