haive.agents.rag.adaptive_tools.agent ===================================== .. py:module:: haive.agents.rag.adaptive_tools.agent .. autoapi-nested-parse:: Adaptive RAG with Tools Integration Agents. from typing import Any Implementation of adaptive RAG with tool integration and ReAct patterns. Includes Google Search integration, tool selection, and dynamic routing based on query needs. Classes ------- .. autoapisummary:: haive.agents.rag.adaptive_tools.agent.AdaptiveToolsRAGAgent haive.agents.rag.adaptive_tools.agent.AdaptiveToolsResult haive.agents.rag.adaptive_tools.agent.QueryNeed haive.agents.rag.adaptive_tools.agent.SearchIntegrationAgent haive.agents.rag.adaptive_tools.agent.SearchResult haive.agents.rag.adaptive_tools.agent.ToolSelection haive.agents.rag.adaptive_tools.agent.ToolSelectionAgent haive.agents.rag.adaptive_tools.agent.ToolType Functions --------- .. autoapisummary:: haive.agents.rag.adaptive_tools.agent.create_adaptive_synthesis_callable haive.agents.rag.adaptive_tools.agent.create_adaptive_tools_rag_agent haive.agents.rag.adaptive_tools.agent.create_google_search_callable haive.agents.rag.adaptive_tools.agent.create_tool_selector_callable haive.agents.rag.adaptive_tools.agent.get_adaptive_tools_rag_io_schema Module Contents --------------- .. py:class:: AdaptiveToolsRAGAgent Bases: :py:obj:`haive.agents.multi.base.SequentialAgent` Complete Adaptive RAG agent with tools integration and ReAct patterns. .. py:method:: from_documents(documents, llm_config = None, enable_google_search = True, enable_local_retrieval = True, **kwargs) :classmethod: Create Adaptive Tools RAG agent from documents. :param documents: Documents to index for local retrieval :param llm_config: LLM configuration :param enable_google_search: Whether to enable Google Search integration :param enable_local_retrieval: Whether to enable local document retrieval :param \*\*kwargs: Additional arguments :returns: AdaptiveToolsRAGAgent instance .. py:class:: AdaptiveToolsResult(/, **data) Bases: :py:obj:`pydantic.BaseModel` Complete result from adaptive tools RAG. 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:: QueryNeed Bases: :py:obj:`str`, :py:obj:`enum.Enum` Query need categories for tool selection. Initialize self. See help(type(self)) for accurate signature. .. py:class:: SearchIntegrationAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that integrates external search tools. .. py:method:: build_graph() Build search integration graph. .. py:class:: SearchResult(/, **data) Bases: :py:obj:`pydantic.BaseModel` Results from search tools. 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:: ToolSelection(/, **data) Bases: :py:obj:`pydantic.BaseModel` Tool selection analysis and recommendations. 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:: ToolSelectionAgent Bases: :py:obj:`haive.agents.base.agent.Agent` Agent that selects optimal tools based on query analysis. .. py:method:: build_graph() Build tool selection graph. .. py:class:: ToolType Bases: :py:obj:`str`, :py:obj:`enum.Enum` Available tool types for adaptive RAG. Initialize self. See help(type(self)) for accurate signature. .. py:function:: create_adaptive_synthesis_callable(llm_config) Create callable function for adaptive synthesis. .. py:function:: create_adaptive_tools_rag_agent(documents, llm_config = None, tools_mode = 'full', **kwargs) Create an Adaptive Tools RAG agent. :param documents: Documents for local retrieval :param llm_config: LLM configuration :param tools_mode: Tools mode ("full", "search_only", "local_only") :param \*\*kwargs: Additional arguments :returns: Configured Adaptive Tools RAG agent .. py:function:: create_google_search_callable(llm_config) Create callable function for Google search integration. .. py:function:: create_tool_selector_callable(llm_config) Create callable function for tool selection. .. py:function:: get_adaptive_tools_rag_io_schema() Get I/O schema for Adaptive Tools RAG agents.