agents.rag.adaptive_tools.agent¶
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¶
Complete Adaptive RAG agent with tools integration and ReAct patterns. |
|
Complete result from adaptive tools RAG. |
|
Query need categories for tool selection. |
|
Agent that integrates external search tools. |
|
Results from search tools. |
|
Tool selection analysis and recommendations. |
|
Agent that selects optimal tools based on query analysis. |
|
Available tool types for adaptive RAG. |
Functions¶
|
Create callable function for adaptive synthesis. |
|
Create an Adaptive Tools RAG agent. |
|
Create callable function for Google search integration. |
|
Create callable function for tool selection. |
Get I/O schema for Adaptive Tools RAG agents. |
Module Contents¶
- class agents.rag.adaptive_tools.agent.AdaptiveToolsRAGAgent(config)¶
Bases:
haive.agents.multi.base.SequentialAgent
Complete Adaptive RAG agent with tools integration and ReAct patterns.
Init .
- Parameters:
config (SequentialAgentConfig) – [TODO: Add description]
- classmethod from_documents(documents, llm_config=None, enable_google_search=True, enable_local_retrieval=True, **kwargs)¶
Create Adaptive Tools RAG agent from documents.
- Parameters:
documents (list[langchain_core.documents.Document]) – Documents to index for local retrieval
llm_config (haive.core.models.llm.base.LLMConfig | None) – LLM configuration
enable_google_search (bool) – Whether to enable Google Search integration
enable_local_retrieval (bool) – Whether to enable local document retrieval
**kwargs – Additional arguments
- Returns:
AdaptiveToolsRAGAgent instance
- class agents.rag.adaptive_tools.agent.AdaptiveToolsResult(/, **data)¶
Bases:
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.
- Parameters:
data (Any)
- class agents.rag.adaptive_tools.agent.QueryNeed¶
-
Query need categories for tool selection.
Initialize self. See help(type(self)) for accurate signature.
- class agents.rag.adaptive_tools.agent.SearchIntegrationAgent¶
Bases:
haive.agents.base.agent.Agent
Agent that integrates external search tools.
- build_graph()¶
Build search integration graph.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- class agents.rag.adaptive_tools.agent.SearchResult(/, **data)¶
Bases:
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.
- Parameters:
data (Any)
- class agents.rag.adaptive_tools.agent.ToolSelection(/, **data)¶
Bases:
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.
- Parameters:
data (Any)
- class agents.rag.adaptive_tools.agent.ToolSelectionAgent¶
Bases:
haive.agents.base.agent.Agent
Agent that selects optimal tools based on query analysis.
- build_graph()¶
Build tool selection graph.
- Return type:
haive.core.graph.state_graph.base_graph2.BaseGraph
- class agents.rag.adaptive_tools.agent.ToolType¶
-
Available tool types for adaptive RAG.
Initialize self. See help(type(self)) for accurate signature.
- agents.rag.adaptive_tools.agent.create_adaptive_synthesis_callable(llm_config)¶
Create callable function for adaptive synthesis.
- Parameters:
llm_config (haive.core.models.llm.base.LLMConfig)
- agents.rag.adaptive_tools.agent.create_adaptive_tools_rag_agent(documents, llm_config=None, tools_mode='full', **kwargs)¶
Create an Adaptive Tools RAG agent.
- Parameters:
- Returns:
Configured Adaptive Tools RAG agent
- Return type:
- agents.rag.adaptive_tools.agent.create_google_search_callable(llm_config)¶
Create callable function for Google search integration.
- Parameters:
llm_config (haive.core.models.llm.base.LLMConfig)
- agents.rag.adaptive_tools.agent.create_tool_selector_callable(llm_config)¶
Create callable function for tool selection.
- Parameters:
llm_config (haive.core.models.llm.base.LLMConfig)