groundlens_check
Check if an LLM response is hallucinated or grounded. Uses context if provided; otherwise analyzes response patterns.
Instructions
Check whether an LLM response is hallucinated or grounded.
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 used the source material.
If no context: uses DGI (Directional Grounding Index) to check whether the response follows patterns typical of grounded answers.
Both methods are deterministic — same inputs always produce the same score. No second LLM is used. Scoring is based on embedding geometry.
Args: params (CheckInput): The question, response, and optional context.
Returns: str: JSON with a plain-language CHECK (Supported / Not supported by the document, or Looks grounded / Not grounded), score, level, method, message, and the raw components.
Examples: - "Check if this ChatGPT answer about our policy is accurate" → provide question + response + the policy document as context - "Is this response hallucinated?" → provide question + response (no context needed)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |