haive.agents.rag.query_planning.agent ===================================== .. py:module:: haive.agents.rag.query_planning.agent .. autoapi-nested-parse:: Query Planning Agentic RAG Agent. from typing import Any Implementation of query planning RAG with structured decomposition and execution. Provides intelligent query analysis, planning, and multi-stage retrieval strategies. Classes ------- .. autoapisummary:: haive.agents.rag.query_planning.agent.QueryComplexity haive.agents.rag.query_planning.agent.QueryPlan haive.agents.rag.query_planning.agent.QueryPlanningRAGAgent haive.agents.rag.query_planning.agent.QueryPlanningResult haive.agents.rag.query_planning.agent.QueryType haive.agents.rag.query_planning.agent.SubQuery haive.agents.rag.query_planning.agent.SubQueryResult Functions --------- .. autoapisummary:: haive.agents.rag.query_planning.agent.create_query_planning_rag_agent haive.agents.rag.query_planning.agent.get_query_planning_rag_io_schema Module Contents --------------- .. py:class:: QueryComplexity Bases: :py:obj:`str`, :py:obj:`enum.Enum` Query complexity levels. Initialize self. See help(type(self)) for accurate signature. .. py:class:: QueryPlan(/, **data) Bases: :py:obj:`pydantic.BaseModel` Complete query 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:: QueryPlanningRAGAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Query Planning RAG agent with structured decomposition and execution. This agent uses conditional edges to execute sub-queries in a planned order. .. py:method:: build_graph() Build the query planning graph with conditional edges. .. py:method:: create_query_plan(state) Create a query execution plan. .. py:method:: execute_sub_query(state) Execute the current sub-query. .. py:method:: from_documents(documents, llm_config = None, planning_depth = 3, **kwargs) :classmethod: Create Query Planning RAG agent from documents. :param documents: Documents to index for retrieval :param llm_config: LLM configuration :param planning_depth: Maximum depth of query decomposition :param \*\*kwargs: Additional arguments :returns: QueryPlanningRAGAgent instance .. py:method:: setup_agent() Initialize engines. .. py:method:: should_continue_execution(state) Determine if more sub-queries should be executed. .. py:method:: synthesize_results(state) Synthesize sub-query results into final answer. .. py:class:: QueryPlanningResult(/, **data) Bases: :py:obj:`pydantic.BaseModel` Complete result from query planning 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:: QueryType Bases: :py:obj:`str`, :py:obj:`enum.Enum` Types of queries for planning. Initialize self. See help(type(self)) for accurate signature. .. py:class:: SubQuery(/, **data) Bases: :py:obj:`pydantic.BaseModel` Individual sub-query in a decomposed 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:: SubQueryResult(/, **data) Bases: :py:obj:`pydantic.BaseModel` Result from executing a sub-query. 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_query_planning_rag_agent(documents, llm_config = None, planning_mode = 'comprehensive', **kwargs) Create a Query Planning RAG agent. :param documents: Documents for retrieval :param llm_config: LLM configuration :param planning_mode: Planning mode ("simple", "moderate", "comprehensive") :param \*\*kwargs: Additional arguments :returns: Configured Query Planning RAG agent .. py:function:: get_query_planning_rag_io_schema() Get I/O schema for Query Planning RAG agents.