agents.rag.multi_agent_rag.graded_rag_workflows

Graded RAG Workflows - RAG with comprehensive grading and evaluation.

from typing import Any This module implements RAG workflows with integrated document grading, answer quality assessment, and hallucination detection.

Classes

AdaptiveGradedRAGAgent

Adaptive Graded RAG - adjusts grading thresholds based on query complexity.

FullyGradedRAGAgent

Fully Graded RAG - comprehensive grading at every step of the RAG pipeline.

GradedRAGState

RAG state with grading information.

MultiCriteriaGradedRAGAgent

Multi-Criteria Graded RAG - uses multiple grading criteria and perspectives.

ReflexiveGradedRAGAgent

Reflexive Graded RAG - uses grading feedback to improve its own performance.

Functions

build_custom_graph()

Build custom graph for graded RAG workflows.

Module Contents

class agents.rag.multi_agent_rag.graded_rag_workflows.AdaptiveGradedRAGAgent(**kwargs)

Bases: haive.agents.multi.base.MultiAgent

Adaptive Graded RAG - adjusts grading thresholds based on query complexity. and document availability.

build_custom_graph()

Build the custom graph for adaptive graded RAG.

Return type:

Any

class agents.rag.multi_agent_rag.graded_rag_workflows.FullyGradedRAGAgent(relevance_threshold=0.5, **kwargs)

Bases: haive.agents.multi.base.MultiAgent

Fully Graded RAG - comprehensive grading at every step of the RAG pipeline. Includes query analysis, document grading, prioritization, answer quality, and hallucination detection.

Parameters:

relevance_threshold (float)

build_custom_graph()

Build the custom graph for graded RAG workflow.

Return type:

Any

class agents.rag.multi_agent_rag.graded_rag_workflows.GradedRAGState(/, **data)

Bases: haive.core.schema.prebuilt.rag_state.RAGState

RAG state with grading information.

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 agents.rag.multi_agent_rag.graded_rag_workflows.MultiCriteriaGradedRAGAgent(grading_criteria=None, **kwargs)

Bases: haive.agents.multi.base.MultiAgent

Multi-Criteria Graded RAG - uses multiple grading criteria and perspectives. to evaluate documents and answers.

Parameters:

grading_criteria (list[str] | None)

build_custom_graph()

Build the custom graph for multi-criteria graded RAG.

Return type:

Any

class agents.rag.multi_agent_rag.graded_rag_workflows.ReflexiveGradedRAGAgent(**kwargs)

Bases: haive.agents.multi.base.MultiAgent

Reflexive Graded RAG - uses grading feedback to improve its own performance. through self-reflection and strategy adjustment.

build_custom_graph()

Build the custom graph for reflexive graded RAG.

Return type:

Any

agents.rag.multi_agent_rag.graded_rag_workflows.build_custom_graph()

Build custom graph for graded RAG workflows.

This is a utility function for creating custom graphs for graded RAG workflows in this module.

Returns:

Graph configuration or None for default behavior

Return type:

Any