Demonstration · synthetic data · hand-written test answers

Measuring RAG grounding claim by claim

A small, runnable version of the evaluation used in RAG Evaluation and Grounding: break an answer into claims, then test each claim against the records it cites.

Grounding checker screenshot: test answer 2 has one supported claim and one unsupported claim; the answer is marked not fully grounded.

Test answer 2: one claim is stated in the cited inspection report; the other names equipment that no record mentions.

Method

  1. Source records as named graphs. Each record — here a batch record and an inspection report from a synthetic PV production line — is stored as its own RDF graph using BFO and Relation Ontology terms.
  2. Answers as claims. Each answer is a set of claims (subject, predicate, object) with the records it cites.
  3. Structure check. A SHACL shape requires every claim to be complete and to cite at least one record.
  4. Support check. Each claim is looked up in the records it cites, then in all records.
  5. Report. One row per claim with a verdict and the reason, exportable as CSV.

Results on the four test answers

VerdictMeaningClaims
SupportedStated in a record it cites4
Mis-citedStated in the sources, but not in the record cited1
UnsupportedNo record states it1
InvalidFails the SHACL shape (no citation)1

One of four answers is fully grounded. Download the sample report (CSV).

In a client engagement

  • Questions and expected sources come from your users and records, not a synthetic plant.
  • Claims are extracted from the system's free-text answers as structured output, and a human-labelled sample calibrates the automated judging.
  • Retrieval is checked too: whether the records that should answer a question were retrieved at all.
  • The same test set is re-run after each change, so improvements are measured rather than assumed.

Limitations

  • The data is synthetic and the four answers were written by hand to show each verdict; they are not model output.
  • Claims are matched as exact triples. Paraphrases, inferences and partial matches need entailment checks or human review.
  • Claim extraction from free text is not shown here.
  • SHACL checks structure, not truth: a well-formed claim can still be wrong, which is what the support check is for.