agents.memory_reorganized.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. |
Module ContentsΒΆ
- class agents.memory_reorganized.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.