agents.memory.search.base¶
Base classes for search agents.
This module provides the foundation for all search agents in the memory system, with common functionality for memory integration, tool management, and structured outputs.
Classes¶
Abstract base class for all search agents. |
|
Base response model for all search agents. |
Functions¶
|
Extract memory items from memory data structure. |
|
Format search context for agents (module-level utility function). |
Get the response model for search agents. |
|
Get generic search instructions. |
|
Get generic system prompt for search agents. |
Module Contents¶
- class agents.memory.search.base.BaseSearchAgent(name, engine, search_tools=None, **kwargs)¶
Bases:
haive.agents.react.agent.ReactAgent
,abc.ABC
Abstract base class for all search agents.
Provides common functionality for memory integration, tool management, and structured output formatting for search operations.
Initialize the search agent.
- Parameters:
- extract_memory_items(query, response)¶
Extract memory items from search interaction.
- format_search_context(query, context)¶
Format search context for the agent.
- abstractmethod get_response_model()¶
Get the structured response model for this search agent.
- Return type:
- abstractmethod get_search_instructions()¶
Get specific search instructions for this agent type.
- Return type:
- abstractmethod get_system_prompt()¶
Get the system prompt template for this search agent.
- Return type:
- async process_search(query, context=None, save_to_memory=True)¶
Process a search query with memory integration.
- Parameters:
- Returns:
Structured search response
- Return type:
- class agents.memory.search.base.SearchResponse(/, **data)¶
Bases:
pydantic.BaseModel
Base response model for all search agents.
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)
- agents.memory.search.base.extract_memory_items(memory_data)¶
Extract memory items from memory data structure.
- agents.memory.search.base.format_search_context(query, context)¶
Format search context for agents (module-level utility function).
- agents.memory.search.base.get_response_model()¶
Get the response model for search agents.
- Return type:
- agents.memory.search.base.get_search_instructions()¶
Get generic search instructions.
- Return type: