agents.memory.search.quick_search.agent

Quick Search Agent implementation.

Provides fast, basic search responses optimized for speed and concise answers. Similar to Perplexity’s Quick Search feature.

Classes

QuickSearchAgent

Agent for fast, basic search responses.

Functions

determine_answer_type(query)

Determine the type of answer needed for a query.

extract_keywords(query)

Extract keywords from a query.

get_response_model()

Get the response model for quick search operations.

get_search_instructions()

Get specific search instructions for quick search operations.

get_system_prompt()

Get the system prompt for quick search operations.

Module Contents

class agents.memory.search.quick_search.agent.QuickSearchAgent(name='quick_search_agent', engine=None, search_tools=None, **kwargs)

Bases: haive.agents.memory.search.base.BaseSearchAgent

Agent for fast, basic search responses.

Optimized for speed and concise answers. Provides quick factual responses without deep research or complex analysis.

Features: - Fast response times (< 2 seconds target) - Concise, direct answers - Basic source attribution - Memory integration for context - Keyword extraction

Examples

Basic usage:

agent = QuickSearchAgent(
    name="quick_search",
    engine=AugLLMConfig(temperature=0.1)
)

response = await agent.process_search("What is the capital of France?")
print(response.response)  # "The capital of France is Paris..."

With custom configuration:

agent = QuickSearchAgent(
    name="quick_search",
    engine=AugLLMConfig(
        temperature=0.0,  # Deterministic for facts
        max_tokens=150    # Keep responses short
    )
)

Initialize the Quick Search Agent.

Parameters:
  • name (str) – Agent identifier

  • engine (haive.core.engine.aug_llm.AugLLMConfig | None) – LLM configuration (defaults to optimized settings)

  • search_tools (list[langchain_core.tools.Tool] | None) – Optional search tools

  • **kwargs – Additional arguments passed to parent

Process multiple quick search queries efficiently.

Parameters:

queries (list[str]) – List of search queries

Returns:

List of quick search responses

Return type:

list[haive.agents.memory.search.quick_search.models.QuickSearchResponse]

determine_answer_type(query)

Determine the type of answer needed.

Parameters:

query (str) – The search query

Returns:

Answer type classification

Return type:

str

extract_keywords(query)

Extract key terms from the search query.

Parameters:

query (str) – The search query

Returns:

List of key terms

Return type:

list[str]

get_response_model()

Get the response model for quick search.

Return type:

type[haive.agents.memory.search.base.SearchResponse]

get_search_instructions()

Get specific search instructions for quick search.

Return type:

str

get_system_prompt()

Get the system prompt for quick search operations.

Return type:

str

Process a quick search query.

Parameters:
  • query (str) – The search query

  • context (dict[str, Any] | None) – Optional context

  • save_to_memory (bool) – Whether to save to memory

Returns:

Quick search response

Return type:

haive.agents.memory.search.quick_search.models.QuickSearchResponse

agents.memory.search.quick_search.agent.determine_answer_type(query)

Determine the type of answer needed for a query.

Parameters:

query (str)

Return type:

str

agents.memory.search.quick_search.agent.extract_keywords(query)

Extract keywords from a query.

Parameters:

query (str)

Return type:

list[str]

agents.memory.search.quick_search.agent.get_response_model()

Get the response model for quick search operations.

Return type:

type[haive.agents.memory.search.base.SearchResponse]

agents.memory.search.quick_search.agent.get_search_instructions()

Get specific search instructions for quick search operations.

Return type:

str

agents.memory.search.quick_search.agent.get_system_prompt()

Get the system prompt for quick search operations.

Return type:

str