agents.memory.search.pro_search.agent¶
Pro Search Agent implementation.
Provides deep, contextual search with user preferences and advanced reasoning. Similar to Perplexity’s Pro Search feature that goes deeper and considers user context.
Classes¶
Agent for deep, contextual search with user preferences. |
Functions¶
|
Extract contextual insights from search content. |
|
Generate follow-up questions based on insights. |
|
Generate reasoning steps for complex queries. |
Get the response model for pro search operations. |
|
Get specific search instructions for pro search operations. |
|
Get the system prompt for pro search operations. |
|
|
Refine a query based on context and preferences. |
Module Contents¶
- class agents.memory.search.pro_search.agent.ProSearchAgent(name='pro_search_agent', engine=None, search_tools=None, **kwargs)¶
Bases:
haive.agents.memory.search.base.BaseSearchAgent
Agent for deep, contextual search with user preferences.
Provides comprehensive search responses that consider user context, preferences, and search history. Performs query refinement and multi-step reasoning for more accurate results.
Features: - Query refinement and expansion - User preference integration - Contextual insights from memory - Multi-step reasoning process - Follow-up question generation - Depth-based search levels
Examples
Basic usage:
agent = ProSearchAgent( name="pro_search", engine=AugLLMConfig(temperature=0.3) ) response = await agent.process_search( "How can I improve my productivity?", context={"domain": "software_development"} )
With custom depth level:
response = await agent.process_pro_search( "What are the best practices for ML deployment?", depth_level=4, use_preferences=True )
Initialize the Pro Search Agent.
- Parameters:
- extract_contextual_insights(query, context)¶
Extract contextual insights from available context.
- generate_follow_up_questions(query, response, context)¶
Generate relevant follow-up questions.
- generate_reasoning_steps(query, context)¶
Generate reasoning steps for the search process.
- get_response_model()¶
Get the response model for pro search.
- Return type:
type[haive.agents.memory.search.base.SearchResponse]
- async process_pro_search(query, context=None, depth_level=3, use_preferences=True, generate_follow_ups=True, include_reasoning=True, save_to_memory=True)¶
Process a pro search query with advanced features.
- Parameters:
query (str) – Search query
depth_level (int) – Search depth (1-5)
use_preferences (bool) – Whether to use user preferences
generate_follow_ups (bool) – Whether to generate follow-up questions
include_reasoning (bool) – Whether to include reasoning steps
save_to_memory (bool) – Whether to save to memory
- Returns:
Pro search response
- Return type:
haive.agents.memory.search.pro_search.models.ProSearchResponse
- async process_search(query, context=None, save_to_memory=True)¶
Process a search query with default pro search settings.
- refine_query(query, context)¶
Refine the search query based on context and preferences.
- agents.memory.search.pro_search.agent.extract_contextual_insights(content, context)¶
Extract contextual insights from search content.
- agents.memory.search.pro_search.agent.generate_follow_up_questions(query, insights)¶
Generate follow-up questions based on insights.
- agents.memory.search.pro_search.agent.generate_reasoning_steps(query, refinement)¶
Generate reasoning steps for complex queries.
- agents.memory.search.pro_search.agent.get_response_model()¶
Get the response model for pro search operations.
- Return type:
type[haive.agents.memory.search.base.SearchResponse]
- agents.memory.search.pro_search.agent.get_search_instructions()¶
Get specific search instructions for pro search operations.
- Return type:
- agents.memory.search.pro_search.agent.get_system_prompt()¶
Get the system prompt for pro search operations.
- Return type: