groundlens_check
Verify whether an LLM response is grounded in its provided source document. Returns a verdict (supported/partially supported/not supported) and an escalate flag when further verification is needed.
Instructions
Check whether an LLM response was drawn from its source. Grounding, not truth.
This is the main tool. It automatically selects the right method:
If context is provided: uses SGI (Semantic Grounding Index) to check whether the response actually engaged the source material.
If no context: uses DGI (Directional Grounding Index), a coarse signal with a known ceiling.
Both are deterministic — same inputs always produce the same score. No model in the scoring path. Scoring is embedding geometry.
IMPORTANT — how to report the result. A passing check means the response
ENGAGED ITS SOURCE. It does NOT mean the facts are correct. A plausible wrong
fact stated in the right frame (right topic, right terminology, one wrong
number or date) will pass. Do not tell the user a passing check means the
answer is "verified", "accurate" or "not hallucinated". Always surface the
handoff field, and when escalate is true, say so: the case needs a
second stage (an entailment check, a lookup against the source, or a judge).
Args: params (CheckInput): The question, response, and optional context.
Returns:
str: JSON with a plain-language CHECK (Supported / Partly supported / Not
supported by the document, or Looks grounded / Partly grounded / Not
grounded), score, level, method, message, escalate, handoff,
and the raw components.
Examples: - "Did this ChatGPT answer actually come from our policy document?" → provide question + response + the policy document as context - "Did this answer engage its source at all?" → provide question + response (no context needed)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |