Conversation Hallucination

Checks whether an agent fabricated facts, user attributions, or self-contradictions across a conversation.

Conversation Hallucination checks whether an agent’s turns introduce claims that aren’t backed by the conversation history or, when supplied, the context. Run it to catch fabricated user attributions, self-contradictions, and invented facts in multi-turn agent conversations.

What it does

Conversation Hallucination is an LLM-as-Judge eval. It reads the full conversation and, if provided, the context, then checks every agent turn for three failure modes: claiming the user said something they didn’t, contradicting or misquoting its own earlier turns, and asserting external facts (names, dates, numbers, policies) with no basis in either source.

Input

Required InputTypeDescription
conversationstringThe full conversation (user and agent turns) to be evaluated for hallucinations in the agent’s responses
contextstringOptional external grounding (e.g., retrieved documents, knowledge base) against which agent factual claims should also be validated (optional)

Output

FieldTypeDescription
ResultPass / FailPass means every claim in every agent turn is supported by the conversation history or the provided context; Fail means the agent fabricated a user attribution, contradicted or misquoted itself, or asserted an unsupported external fact
ReasonstringA plain-language explanation of the hallucination 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(
    "conversation_hallucination",
    conversation="User: Hi, I'm trying to reset my password.\nAgent: Sure, I can help with that. As I mentioned earlier, I've already sent a reset link to your email.\nUser: You didn't mention that before, this is the first time we're talking.\nAgent: You're right, let me send that link now.",
    context="",
    model="turing_flash",
)

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

const result = await evaluate(
  "conversation_hallucination",
  {
    conversation: "User: Hi, I'm trying to reset my password.\nAgent: Sure, I can help with that. As I mentioned earlier, I've already sent a reset link to your email.\nUser: You didn't mention that before, this is the first time we're talking.\nAgent: You're right, let me send that link now.",
    context: "",
  },
  { modelName: "turing_flash" }
);

console.log(result);

When to use

Run Conversation Hallucination wherever an agent carries state across multiple turns and could misremember or invent something along the way.

  • Multi-turn support or sales conversations, to catch the agent claiming the user said something they didn’t
  • Long-running agent sessions, to catch self-contradictions or false self-quotations across turns
  • Conversations grounded in retrieved documents or a knowledge base, to check external facts the agent states are actually supported

What to do when Conversation Hallucination fails

Check the reason for which failure mode triggered: a false user attribution, a self-contradiction, or an unsupported external fact. For user-attribution and self-contradiction failures, review how conversation history is passed to the agent, truncated or reordered history is a common cause of the model losing track of what was actually said.

For unsupported external facts, tighten grounding: make sure retrieved context actually covers the claims the agent is allowed to make, and prompt the agent to hedge or say it doesn’t know rather than fill gaps with invented specifics.

Was this page helpful?

Questions & Discussion