By Abhijith N M · Reviewed 24 October 2026 · Editorial standards
Every RAG failure that reaches a customer can be summarised as: the answer contained something the documents do not say. Groundedness testing is the practice of checking that mechanically, per claim.
You do not need a framework to see how this works. Take an answer, split it into assertions, and mark each one:
CONTEXT
[returns-policy] Sale items may be returned within 14 days of delivery for
store credit. Worn items are excluded.
[shipping-faq] Standard delivery is 3-5 working days.
ANSWER
'Yes - you have 14 days from delivery. Sale items are refunded to store
credit, but only if unworn. Standard delivery of your replacement takes
3-5 working days.'
CLAIM CHECK
14 days from delivery -> supported [returns-policy]
refunded to store credit -> supported [returns-policy]
only if unworn -> supported [returns-policy]
replacement delivery 3-5 days -> NOT SUPPORTED (shipping-faq is about
first delivery, not replacements)
Groundedness = 3/4 = 0.75The unsupported claim is subtle and completely plausible. A human reviewer skimming would pass it. This is precisely the class of bug that automated groundedness catches and humans miss.
| Level | Check | Catches | Cost |
|---|---|---|---|
| Citation presence | Does the answer name a source document? | Answers with no provenance at all | Free (regex) |
| Citation correctness | Does the named document actually contain the claim? | Confidently wrong attributions | One judge call per claim |
| Full grounding | Is every claim supported by any retrieved chunk? | Unsourced additions and extrapolation | One judge call per answer |
Start at level 1 because it is free. Move to level 3 for the flows that involve money or policy.
Grounding fails in both directions and they need different fixes:
Before you pay for a judge, you can catch a large share of ungrounded answers with a cheap overlap heuristic. It is not a replacement, but it is free and instant, and it is a great smoke test in CI:
import re
STOP = set("a an the is are was were to of and or in on for with it this that you your".split())
def content_words(text: str) -> set[str]:
return {w for w in re.findall(r"[a-z0-9']+", text.lower()) if w not in STOP}
def overlap_ratio(answer: str, context: str) -> float:
a = content_words(answer)
if not a:
return 0.0
return round(len(a & content_words(context)) / len(a), 2)
ctx = "Sale items may be returned within 14 days for store credit."
print(overlap_ratio("Return sale items within 14 days for store credit.", ctx)) # high
print(overlap_ratio("Return anytime and get cash back in 3 days.", ctx)) # lowKey takeaways
Groundedness = every claim supported by retrieved context, checked claim by claim.
Plausible unsupported additions are the exact bug humans miss and automation catches.
Start with free citation checks, then judge-based claim support for high-risk flows.
Check both directions: invented claims and over-refusal when the answer was available.
Written and edited by the nexGenCoders team. Spotted a mistake? Tell us and we will fix it.
Don't lose this lesson
Create a free account to save your progress, keep your streak, and work toward a shareable certificate.