agents.rag.agentic_router.agent¶
Agentic RAG Router with ReAct Pattern Agents.
from typing import Any Implementation of autonomous RAG routing using ReAct (Reason + Act) patterns. Provides intelligent agent selection, strategy planning, and execution coordination.
Classes¶
Complete Agentic RAG Router with ReAct patterns and autonomous decision-making. |
|
Complete result from agentic RAG routing. |
|
Result from strategy execution. |
|
Available RAG strategies for routing. |
|
Complete ReAct planning result. |
|
Individual reasoning step in ReAct pattern. |
Functions¶
|
Create an Agentic RAG Router agent. |
Get I/O schema for Agentic RAG Router agents. |
Module Contents¶
- class agents.rag.agentic_router.agent.AgenticRAGRouterAgent¶
Bases:
haive.agents.base.agent.Agent
Complete Agentic RAG Router with ReAct patterns and autonomous decision-making.
This agent uses conditional edges to route between different RAG strategies based on query analysis and planning.
- build_graph()¶
Build the agentic RAG router graph with conditional edges.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- execute_flare_strategy(state)¶
Execute FLARE RAG strategy.
- execute_fusion_strategy(state)¶
Execute fusion RAG strategy.
- execute_hyde_strategy(state)¶
Execute HyDE RAG strategy.
- execute_multi_query_strategy(state)¶
Execute multi-query RAG strategy.
- execute_simple_strategy(state)¶
Execute simple RAG strategy.
- classmethod from_documents(documents, llm_config=None, autonomy_level='high', **kwargs)¶
Create Agentic RAG Router from documents.
- Parameters:
- Returns:
AgenticRAGRouterAgent instance
- plan_react_strategy(state)¶
Plan RAG strategy using ReAct reasoning.
- setup_agent()¶
Initialize engines and strategy agents.
- Return type:
None
- strategy_router(state)¶
Route to the appropriate strategy execution node based on the selected strategy.
- Parameters:
state (haive.core.schema.prebuilt.rag_state.RAGState)
- Return type:
- class agents.rag.agentic_router.agent.AgenticRouterResult(/, **data)¶
Bases:
pydantic.BaseModel
Complete result from agentic RAG routing.
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.agentic_router.agent.ExecutionResult(/, **data)¶
Bases:
pydantic.BaseModel
Result from strategy execution.
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.agentic_router.agent.RAGStrategy¶
-
Available RAG strategies for routing.
Initialize self. See help(type(self)) for accurate signature.
- class agents.rag.agentic_router.agent.ReActPlan(/, **data)¶
Bases:
pydantic.BaseModel
Complete ReAct planning result.
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.agentic_router.agent.ReasoningStep(/, **data)¶
Bases:
pydantic.BaseModel
Individual reasoning step in ReAct pattern.
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.agentic_router.agent.create_agentic_rag_router_agent(documents, llm_config=None, routing_mode='autonomous', **kwargs)¶
Create an Agentic RAG Router agent.
- Parameters:
- Returns:
Configured Agentic RAG Router agent
- Return type: