agents.rag.multi_agent_rag.specialized_workflows_v2

Specialized Workflows V2 - Using Enhanced State Schemas.

Updated versions of FLARE, Dynamic RAG, Debate RAG, etc. using state schemas with built-in configuration support.

Classes

AdaptiveThresholdRAGAgentV2

Adaptive Threshold RAG V2 - Configuration in AdaptiveThresholdRAGState.

DebateRAGAgentV2

Debate RAG V2 - Configuration in DebateRAGState.

DynamicRAGAgentV2

Dynamic RAG V2 - Configuration in DynamicRAGState.

FLAREAgentV2

FLARE V2 - Configuration stored in FLAREState.

Functions

build_custom_graph()

Build custom graph for specialized workflows v2.

Module Contents

class agents.rag.multi_agent_rag.specialized_workflows_v2.AdaptiveThresholdRAGAgentV2(initial_threshold=0.7, threshold_step=0.1, min_threshold=0.3, max_threshold=0.95, **kwargs)

Bases: haive.agents.multi.base.MultiAgent, haive.agents.rag.multi_agent_rag.enhanced_state_schemas.StateConfigMixin

Adaptive Threshold RAG V2 - Configuration in AdaptiveThresholdRAGState.

Init .

Parameters:
  • initial_threshold (float) – [TODO: Add description]

  • threshold_step (float) – [TODO: Add description]

  • min_threshold (float) – [TODO: Add description]

  • max_threshold (float) – [TODO: Add description]

async ainvoke(inputs)

Inject configuration.

Parameters:

inputs (dict[str, Any])

Return type:

dict[str, Any]

build_custom_graph()

Build the custom graph for this workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows_v2.DebateRAGAgentV2(position_names=None, max_debate_rounds=3, require_consensus=False, enable_judge=True, **kwargs)

Bases: haive.agents.multi.base.MultiAgent, haive.agents.rag.multi_agent_rag.enhanced_state_schemas.StateConfigMixin

Debate RAG V2 - Configuration in DebateRAGState.

Init .

Parameters:
  • position_names (list[str] | None) – [TODO: Add description]

  • max_debate_rounds (int) – [TODO: Add description]

  • require_consensus (bool) – [TODO: Add description]

  • enable_judge (bool) – [TODO: Add description]

async ainvoke(inputs)

Inject configuration and initialize debate positions.

Parameters:

inputs (dict[str, Any])

Return type:

dict[str, Any]

build_custom_graph()

Build the custom graph for this workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows_v2.DynamicRAGAgentV2(min_retrievers=1, max_retrievers=5, performance_threshold=0.6, **kwargs)

Bases: haive.agents.multi.base.MultiAgent, haive.agents.rag.multi_agent_rag.enhanced_state_schemas.StateConfigMixin

Dynamic RAG V2 - Configuration in DynamicRAGState.

Init .

Parameters:
  • min_retrievers (int) – [TODO: Add description]

  • max_retrievers (int) – [TODO: Add description]

  • performance_threshold (float) – [TODO: Add description]

async ainvoke(inputs)

Inject configuration.

Parameters:

inputs (dict[str, Any])

Return type:

dict[str, Any]

build_custom_graph()

Build the custom graph for this workflow.

Return type:

Any

class agents.rag.multi_agent_rag.specialized_workflows_v2.FLAREAgentV2(uncertainty_threshold=0.3, max_retrieval_rounds=3, **kwargs)

Bases: haive.agents.multi.base.MultiAgent, haive.agents.rag.multi_agent_rag.enhanced_state_schemas.StateConfigMixin

FLARE V2 - Configuration stored in FLAREState.

Init .

Parameters:
  • uncertainty_threshold (float) – [TODO: Add description]

  • max_retrieval_rounds (int) – [TODO: Add description]

async ainvoke(inputs)

Inject configuration into state.

Parameters:

inputs (dict[str, Any])

Return type:

dict[str, Any]

build_custom_graph()

Build the custom graph for this workflow.

Return type:

Any

agents.rag.multi_agent_rag.specialized_workflows_v2.build_custom_graph()

Build custom graph for specialized workflows v2.

Returns:

Graph configuration or None for default behavior

Return type:

Any