haive.agents.rag.self_route.agent ================================= .. py:module:: haive.agents.rag.self_route.agent .. autoapi-nested-parse:: Self-Route RAG Agents. from typing import Any Implementation of self-routing RAG with dynamic strategy selection and iterative planning. Uses structured output models for complex routing decisions and preprocessing. Classes ------- .. autoapisummary:: haive.agents.rag.self_route.agent.IterativePlan haive.agents.rag.self_route.agent.IterativePlannerAgent haive.agents.rag.self_route.agent.QueryAnalysis haive.agents.rag.self_route.agent.QueryAnalyzerAgent haive.agents.rag.self_route.agent.QueryComplexity haive.agents.rag.self_route.agent.RoutingDecision haive.agents.rag.self_route.agent.RoutingDecisionAgent haive.agents.rag.self_route.agent.RoutingStrategy haive.agents.rag.self_route.agent.SelfRouteRAGAgent Functions --------- .. autoapisummary:: haive.agents.rag.self_route.agent.create_self_route_rag_agent haive.agents.rag.self_route.agent.get_self_route_rag_io_schema Module Contents --------------- .. py:class:: IterativePlan(/, **data) Bases: :py:obj:`pydantic.BaseModel` Iterative processing plan with loop structure. 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:: IterativePlannerAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that creates iterative processing plans. .. py:method:: build_graph() Build iterative planning graph. .. py:class:: QueryAnalysis(/, **data) Bases: :py:obj:`pydantic.BaseModel` Structured analysis of query for routing decisions. 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:: QueryAnalyzerAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that performs structured query analysis for routing. .. py:method:: build_graph() Build query analysis graph. .. py:class:: QueryComplexity Bases: :py:obj:`str`, :py:obj:`enum.Enum` Query complexity levels for routing decisions. Initialize self. See help(type(self)) for accurate signature. .. py:class:: RoutingDecision(/, **data) Bases: :py:obj:`pydantic.BaseModel` Final routing decision with execution plan. 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:: RoutingDecisionAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that makes final routing decisions. .. py:method:: build_graph() Build routing decision graph. .. py:class:: RoutingStrategy Bases: :py:obj:`str`, :py:obj:`enum.Enum` Available routing strategies. Initialize self. See help(type(self)) for accurate signature. .. py:class:: SelfRouteRAGAgent Bases: :py:obj:`haive.agents.multi.base.SequentialAgent` Complete Self-Route RAG agent with structured analysis and iterative planning. .. py:method:: from_documents(documents, llm_config = None, analysis_depth = 'comprehensive', max_iterations = 3, enable_fallback = True, **kwargs) :classmethod: Create Self-Route RAG agent from documents. :param documents: Documents to index :param llm_config: LLM configuration :param analysis_depth: Depth of query analysis :param max_iterations: Maximum iterations for planning :param enable_fallback: Whether to enable fallback routing :param \*\*kwargs: Additional arguments :returns: SelfRouteRAGAgent instance .. py:function:: create_self_route_rag_agent(documents, llm_config = None, routing_mode = 'adaptive', **kwargs) Create a Self-Route RAG agent. :param documents: Documents for retrieval :param llm_config: LLM configuration :param routing_mode: Routing mode ("conservative", "adaptive", "aggressive") :param \*\*kwargs: Additional arguments :returns: Configured Self-Route RAG agent .. py:function:: get_self_route_rag_io_schema() Get I/O schema for Self-Route RAG agents.