Forward-deployed / Learning zone
Context engineeringa standalone module
Lesson 06

Evaluating context quality

TL;DR

Eval-driven development grades whether an AI feature's output is good. That's necessary and not sufficient: a failing output score doesn't tell you whether the model reasoned badly or was simply never shown what it needed. Context evals answer the narrower, faster question — did the pipeline supply the right instructions, the right retrieved facts, the right memory, the right live state — before you spend a debugging session blaming the model. Separating "was the context right?" from "was the answer right?" turns a vague quality regression into a five-minute check instead of a week of prompt archaeology.

🎯 For the product leader

Why it matters — Most AI debugging time is spent re-reading model output looking for a pattern, when the faster diagnostic is checking what the model was shown. A context eval turns that check into a repeatable score instead of a guess.

What it changes in your decisions — You ask "did retrieval find the right document?" as a separate, gradable question from "was the final answer good?" — and you fund whichever one is actually failing, instead of tuning the prompt for a retrieval problem.

Ask yourself — "The last time this feature failed, did we check whether the context was right before we started rewriting the prompt?"

Risk if ignored — Weeks spent tuning a prompt against a retrieval bug, because nobody separated the two questions before debugging started.

The mental model: two separate scores, not one

Evaluating context quality

Two separate scores, not one · was the RIGHT input assembled, vs. was the answer good

A failing output score with a passing context score points at the model. A failing context score points upstream.

Context eval:
was the right input assembled?
→
Model call
→
Output eval:
was the answer good?
Context fails
Fix retrieval, memory, or instructions

No amount of prompt tuning fixes an upstream miss.

Context passes, output fails
Fix the model, prompt, or reasoning

An isolated, provable model or prompt problem.

A failing output score with a passing context score points at the model and the prompt. A failing output score with a failing context score points upstream, at retrieval, memory, or instructions — and no amount of prompt tuning fixes an upstream miss.

Building a context eval set

Reuse the sourcing discipline from eval-driven development, aimed one layer earlier:

A feature that passes all four context checks but still fails its output eval has a model or prompt problem, isolated and provable. A feature that fails any of the four has found its actual bug, before a single line of the prompt gets touched.

The five-minute triage

When a specific answer is wrong, before touching the prompt:

  1. Pull the exact context the model was given for that call (see the pipeline audit).
  2. Ask: was the needed fact actually in there? If no — it's a retrieval or memory miss, not a model miss.
  3. Ask: was it in there, but the model ignored or misused it? Only then is it a model/prompt problem worth iterating on.

Skipping step 1 is the single most common reason prompt-tuning sessions run long without progress.

Failure modes

Practitioner checklist