Skip to content
Eval Suites50

The RAG triad: context relevance, groundedness and answer relevance

Sources checked 3 min read · By the Eval Suites editors

In brief

The RAG triad checks context relevance, groundedness and answer relevance. It asks whether retrieval found useful evidence, whether the answer’s claims follow that evidence, and whether the answer addresses the question. A good score on one dimension does not establish the others.[1]

Context relevance
Question → retrieved evidence
Groundedness
Retrieved evidence → answer claims
Answer relevance
Question → final answer

What are the three components of the RAG triad?

TruLens defines the RAG triad as context relevance, groundedness and answer relevance. Keep them separate so a failure points to retrieval, unsupported generation or an off-target response.[1]

Three diagnostic questions in the RAG triad
ComponentQuestionExample failure
Context relevanceDoes the retrieved material help answer this question?A refund question retrieves shipping instructions
GroundednessDoes the retrieved material support the answer’s claims?The answer invents a refund deadline
Answer relevanceDoes the response address what the user asked?The answer describes returns without giving the deadline

A response can be grounded in a stale policy and still be wrong for today’s customer. These scores are evidence-based diagnostics, not a guarantee that the knowledge base or answer is true. Add document freshness checks and an explicit expected outcome for consequential tasks.

How do I measure context relevance vs groundedness in RAG?

Measure context relevance against the question and groundedness against the retrieved evidence. Ragas faithfulness decomposes a response into claims and checks which claims the context supports; retrieval metrics operate on a different relationship.[1][2][3]

For a proposed ID-labeled retrieval test, let R be the unique retrieved chunk IDs and G the gold relevant IDs. Precision = |R ∩ G| / |R|; recall = |R ∩ G| / |G|. Ragas documents an ID-based precision metric using this set relationship. Its rank-sensitive context precision is a different metric, weighting precision at relevant ranks rather than simply counting the intersection.[3]

Illustrative set-based retrieval check, not a Ragas metric adapter
def retrieval_scores(retrieved_ids, relevant_ids):
    retrieved, relevant = set(retrieved_ids), set(relevant_ids)
    hits = len(retrieved & relevant)
    return {
        "precision": hits / len(retrieved) if retrieved else None,
        "recall": hits / len(relevant) if relevant else None,
    }

assert retrieval_scores(["a", "b", "x"], ["a", "b", "c"]) == {
    "precision": 2 / 3, "recall": 2 / 3
}

None marks an undefined denominator in this example; it isn’t a passing score. Decide separately how to grade unanswerable questions and empty retrieval. A reference set must identify all relevant IDs before recall has meaning.

What is the difference between Ragas faithfulness and TruLens groundedness?

Both examine whether answer claims have support in retrieved context, but their implementations and score scales should not be assumed interchangeable. Ragas specifies supported claims divided by total claims; TruLens describes decomposing an answer and searching its context for supporting evidence.[2][1]

If an answer contains four claims and three are supported, the illustrative Ragas-style claim ratio is 3/4 = 0.75. The claim segmentation and support judge determine those counts. Pin their configuration and inspect disagreements against reviewed labels rather than treating 0.75 from two libraries as the same result.[2]

Don’t set one universal “safe” threshold. A missed citation in a casual summary and an unsupported medical instruction have different consequences. Choose tolerances from your own labeled examples and risk policy.

Why can relevant retrieval still produce an ungrounded answer?

Relevant context is only an input; the generator can still add claims that the context never made. That is why TruLens evaluates groundedness after retrieval rather than substituting context relevance for it.[1]

  1. Save the question, retrieved chunk IDs, full retrieved text and actual response for a failed case.
  2. Identify each unsupported claim and check whether the required evidence was retrieved at all.
  3. If evidence was missing, inspect retrieval coverage and rank. If it was present, inspect how the prompt and generator used it.
  4. Include unanswerable and conflicting-document cases, then verify the answer abstains or states the uncertainty instead of completing missing facts.

Related suites

Related reading

Sources

  1. 1. The RAG triad · TruLens · Official docs · Sources checked
  2. 2. Faithfulness · Ragas · Official docs · Sources checked
  3. 3. Context precision · Ragas · Official docs · Sources checked