Groundedness

Checks whether a response is strictly grounded in the provided context, flagging any information the context doesn't support.

Groundedness checks whether a response is strictly based on the provided context, with no outside information introduced. Run it wherever an answer must be traceable back to a source.

What it does

Groundedness is an LLM-as-Judge eval. It reads the context and the generated output (and optionally the input), then returns a pass/fail on whether the response is fully supported by that context.

Input

Required InputTypeDescription
outputstringThe output generated by the model
contextstringThe context provided to the model
Optional InputTypeDescription
inputstringThe input provided to the model

Output

FieldTypeDescription
ResultPass / FailPassed means the response is fully grounded in the provided context, Failed means the response introduces unsupported information
ReasonstringA plain-language explanation of the groundedness assessment

Run it from code

Call evaluate() with the template name and the eval’s required inputs. It returns the score and the reason.

Note

Before running: install the SDK and set FI_API_KEY / FI_SECRET_KEY. The model argument in the snippets is the evaluator model Future AGI uses to run the eval; turing_flash is a fast default.

from fi.evals import evaluate

result = evaluate(
    "groundedness",
    input="The Earth orbits around the Sun in how many days?",
    context="The Earth completes one orbit around the Sun every 365.25 days",
    output="365.25 days",
    model="turing_flash",
)

print(result.score)
print(result.reason)
import { evaluate } from "@future-agi/ai-evaluation";

const result = await evaluate(
  "groundedness",
  {
    input: "The Earth orbits around the Sun in how many days?",
    context: "The Earth completes one orbit around the Sun every 365.25 days",
    output: "365.25 days"
  },
  { modelName: "turing_flash" }
);

console.log(result);

When to use

Run Groundedness wherever an answer needs to be traceable to a source document and any unsupported addition is a problem.

  • Text, audio, and chat outputs generated from a fixed context
  • RAG and retrieval pipelines, to confirm answers don’t extend past the retrieved material
  • Hallucination checks, alongside Context Adherence and Detect Hallucination, for a stricter Pass/Fail read on grounding

What to do when Groundedness fails

Reassess the provided context for completeness and clarity, ensuring it includes all necessary information to support the response.

Examine the response for any elements not supported by the context, and adjust it to improve alignment with the given information.

Was this page helpful?

Questions & Discussion