> For the complete documentation index, see [llms.txt](https://klaralabs.gitbook.io/klara-labs-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://klaralabs.gitbook.io/klara-labs-docs/introduction/rag-hallucination-detector-overview.md).

# RAG Hallucination Detector Overview

### What is a RAG Hallucination Detector?

We built a specialized model designed to identify when an AI system generates information that isn't grounded in the provided context. Even when responses appear correct, our system analyzes whether the reasoning is actually supported by the reference materials given by the user.

### How It Works

Our lightweight detection model evaluates the relationship between:

* User-provided context
* Model response
* User question

The system produces:

* A hallucination confidence score (higher scores indicate greater likelihood of hallucination)
* Token-level analysis highlighting specific parts of the response contributing to potential hallucinations
* Relative confidence scores for each identified token

### Why It Matters

* **Increased Reliability**: Ensure your RAG systems produce trustworthy, context-grounded responses
* **Improved Transparency**: Understand exactly which parts of a response may create problems
* **Enhanced Trust**: Provide confidence metrics that help users appropriately calibrate their trust in AI outputs

### Key Features

* **Real-time Detection**: Analyze responses as they're generated
* **Token-level Granularity**: Pinpoint exactly where hallucinations occur
* **Confidence Scoring**: Quantify the degree of hallucination risk
* **Contextual Awareness**: Evaluate responses specifically against the provided reference material

### Integration Options

Our RAG Hallucination Detector API integrates seamlessly with existing RAG pipelines, allowing for:

* Pre-deployment validation
* Runtime monitoring
* Feedback mechanisms for model improvement


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://klaralabs.gitbook.io/klara-labs-docs/introduction/rag-hallucination-detector-overview.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
