Skip to main content

detect_search_intent

Function detect_search_intent 

Source
pub fn detect_search_intent(prompt: &str) -> Option<SearchIntent>
Expand description

Detects search intent from a user prompt using keyword pattern matching.

Analyzes the prompt for search signals (e.g., “how do I”, “where is”) and extracts intent type, confidence, keywords, and topics.

§Arguments

  • prompt - The user prompt to analyze.

§Returns

A SearchIntent if search signals are detected, None otherwise.

§Performance

Typically completes in under 10ms.