haive.agents.rag.hallucination_grading.agent¶

Hallucination Grading Agents.

Modular agents for detecting and grading hallucinations in RAG responses. Can be plugged into any workflow with compatible I/O schemas.

Classes¶

AdvancedHallucinationGrade

Advanced hallucination assessment with detailed analysis.

AdvancedHallucinationGraderAgent

Advanced hallucination grading with detailed analysis.

HallucinationGrade

Single hallucination assessment.

HallucinationGraderAgent

Basic hallucination grading agent.

RealtimeHallucinationCheck

Quick hallucination check for real-time applications.

RealtimeHallucinationGraderAgent

Fast hallucination checker for real-time applications.

Functions¶

create_hallucination_grader([grader_type, llm_config])

Create a hallucination grader agent.

get_hallucination_grader_io_schema()

Get I/O schema for hallucination graders for compatibility checking.

Module Contents¶

class haive.agents.rag.hallucination_grading.agent.AdvancedHallucinationGrade(/, **data)¶

Bases: pydantic.BaseModel

Advanced hallucination assessment with detailed analysis.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.rag.hallucination_grading.agent.AdvancedHallucinationGraderAgent¶

Bases: haive.agents.base.agent.Agent

Advanced hallucination grading with detailed analysis.

build_graph()¶

Build advanced hallucination analysis graph.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

class haive.agents.rag.hallucination_grading.agent.HallucinationGrade(/, **data)¶

Bases: pydantic.BaseModel

Single hallucination assessment.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.rag.hallucination_grading.agent.HallucinationGraderAgent¶

Bases: haive.agents.base.agent.Agent

Basic hallucination grading agent.

build_graph()¶

Build hallucination grading graph.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

class haive.agents.rag.hallucination_grading.agent.RealtimeHallucinationCheck(/, **data)¶

Bases: pydantic.BaseModel

Quick hallucination check for real-time applications.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Parameters:

data (Any)

class haive.agents.rag.hallucination_grading.agent.RealtimeHallucinationGraderAgent¶

Bases: haive.agents.base.agent.Agent

Fast hallucination checker for real-time applications.

build_graph()¶

Build realtime hallucination check graph.

Return type:

haive.core.graph.state_graph.base_graph2.BaseGraph

haive.agents.rag.hallucination_grading.agent.create_hallucination_grader(grader_type='basic', llm_config=None, **kwargs)¶

Create a hallucination grader agent.

Parameters:
  • grader_type (Literal['basic', 'advanced', 'realtime']) – Type of grader to create

  • llm_config (haive.core.models.llm.base.LLMConfig | None) – LLM configuration

  • **kwargs – Additional arguments

Returns:

Configured hallucination grader agent

Return type:

haive.agents.base.agent.Agent

haive.agents.rag.hallucination_grading.agent.get_hallucination_grader_io_schema()¶

Get I/O schema for hallucination graders for compatibility checking.

Return type:

dict[str, list[str]]