haive.agents.rag.agentic_router.agent ===================================== .. py:module:: haive.agents.rag.agentic_router.agent .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: haive.agents.rag.agentic_router.agent.AgenticRAGRouterAgent haive.agents.rag.agentic_router.agent.AgenticRouterResult haive.agents.rag.agentic_router.agent.ExecutionResult haive.agents.rag.agentic_router.agent.RAGStrategy haive.agents.rag.agentic_router.agent.ReActPlan haive.agents.rag.agentic_router.agent.ReasoningStep Functions --------- .. autoapisummary:: haive.agents.rag.agentic_router.agent.create_agentic_rag_router_agent haive.agents.rag.agentic_router.agent.get_agentic_rag_router_io_schema Module Contents --------------- .. py:class:: AgenticRAGRouterAgent Bases: :py:obj:`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. .. py:method:: build_graph() Build the agentic RAG router graph with conditional edges. .. py:method:: execute_flare_strategy(state) Execute FLARE RAG strategy. .. py:method:: execute_fusion_strategy(state) Execute fusion RAG strategy. .. py:method:: execute_hyde_strategy(state) Execute HyDE RAG strategy. .. py:method:: execute_multi_query_strategy(state) Execute multi-query RAG strategy. .. py:method:: execute_simple_strategy(state) Execute simple RAG strategy. .. py:method:: from_documents(documents, llm_config = None, autonomy_level = 'high', **kwargs) :classmethod: Create Agentic RAG Router from documents. :param documents: Documents to index for RAG strategies :param llm_config: LLM configuration :param autonomy_level: Autonomy level ("low", "medium", "high") :param \*\*kwargs: Additional arguments :returns: AgenticRAGRouterAgent instance .. py:method:: plan_react_strategy(state) Plan RAG strategy using ReAct reasoning. .. py:method:: setup_agent() Initialize engines and strategy agents. .. py:method:: strategy_router(state) Route to the appropriate strategy execution node based on the selected strategy. .. py:method:: synthesize_agentic_result(state) Synthesize final agentic routing result. .. py:class:: AgenticRouterResult(/, **data) Bases: :py:obj:`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. .. py:class:: ExecutionResult(/, **data) Bases: :py:obj:`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. .. py:class:: RAGStrategy Bases: :py:obj:`str`, :py:obj:`enum.Enum` Available RAG strategies for routing. Initialize self. See help(type(self)) for accurate signature. .. py:class:: ReActPlan(/, **data) Bases: :py:obj:`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. .. py:class:: ReasoningStep(/, **data) Bases: :py:obj:`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. .. py:function:: create_agentic_rag_router_agent(documents, llm_config = None, routing_mode = 'autonomous', **kwargs) Create an Agentic RAG Router agent. :param documents: Documents for RAG strategies :param llm_config: LLM configuration :param routing_mode: Routing mode ("conservative", "balanced", "autonomous") :param \*\*kwargs: Additional arguments :returns: Configured Agentic RAG Router agent .. py:function:: get_agentic_rag_router_io_schema() Get I/O schema for Agentic RAG Router agents.