agents.rag.multi_agent_rag.specialized_workflows

Specialized RAG Workflows - FLARE, Dynamic RAG, and Debate RAG.

This module implements advanced RAG architectures including Forward-Looking Active REtrieval (FLARE), Dynamic RAG with add/remove retrievers, and Debate-based RAG for multi-perspective reasoning.

Classes

AdaptiveThresholdRAGAgent

Adaptive Threshold RAG - dynamically adjusts retrieval thresholds.

DebateRAGAgent

Debate RAG - multiple agents with different perspectives debate.

DebateRAGState

RAG state for Debate-based RAG.

DynamicRAGAgent

Dynamic RAG with add/remove retrievers - adapts retrieval strategy.

DynamicRAGState

RAG state for Dynamic RAG with configurable retrievers.

FLAREAgent

Forward-Looking Active REtrieval (FLARE) - generates text while actively.

FLAREState

RAG state for Forward-Looking Active REtrieval.

Functions

build_custom_graph()

Build custom graph for specialized workflows.

Module Contents

class agents.rag.multi_agent_rag.specialized_workflows.AdaptiveThresholdRAGAgent(**kwargs)

Bases: haive.agents.multi.base.MultiAgent

Adaptive Threshold RAG - dynamically adjusts retrieval thresholds. based on query difficulty and answer confidence.

build_custom_graph()

Build the custom graph for Adaptive Threshold RAG workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows.DebateRAGAgent(debate_positions=None, **kwargs)

Bases: haive.agents.multi.base.MultiAgent

Debate RAG - multiple agents with different perspectives debate. to reach a comprehensive answer through dialectical reasoning.

Parameters:

debate_positions (list[str] | None)

build_custom_graph()

Build the custom graph for Debate RAG workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows.DebateRAGState(/, **data)

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

RAG state for Debate-based RAG.

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.specialized_workflows.DynamicRAGAgent(**kwargs)

Bases: haive.agents.multi.base.MultiAgent

Dynamic RAG with add/remove retrievers - adapts retrieval strategy. based on query characteristics and retriever performance.

build_custom_graph()

Build the custom graph for Dynamic RAG workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows.DynamicRAGState(/, **data)

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

RAG state for Dynamic RAG with configurable retrievers.

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.specialized_workflows.FLAREAgent(**kwargs)

Bases: haive.agents.multi.base.MultiAgent

Forward-Looking Active REtrieval (FLARE) - generates text while actively. predicting when retrieval would be beneficial.

build_custom_graph()

Build the custom graph for FLARE workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows.FLAREState(/, **data)

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

RAG state for Forward-Looking Active REtrieval.

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)

agents.rag.multi_agent_rag.specialized_workflows.build_custom_graph()

Build custom graph for specialized workflows.

Returns:

Graph configuration or None for default behavior

Return type:

Any