Documentation
¶
Overview ¶
Package search provides intent-aware retrieval routing for yaad's graph. It classifies natural-language queries into intent categories, then returns edge-type weight maps that bias graph traversal toward the most relevant relationship types. Based on MAGMA (arxiv:2601.03236).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IntentWeights ¶
func IntentWeights(intent QueryIntent) map[string]float64
IntentWeights returns a map of edge-type to weight multiplier for the given intent. Higher weights bias graph traversal toward those edge types.
Types ¶
type QueryIntent ¶
type QueryIntent int
QueryIntent represents the classified intent of a user query.
const ( IntentFind QueryIntent = iota // locate a node: "find", "where is", "locate" IntentWhy // causal: "why", "reason", "cause" IntentWhen // temporal: "when", "before", "after" IntentWhat // definitional: "what is", "describe" IntentHow // procedural: "how to", "steps" IntentWho // entity/attribution: "who", "which" IntentGeneral // fallback: balanced weights )
func ClassifyIntent ¶
func ClassifyIntent(query string) QueryIntent
ClassifyIntent detects query intent from natural language using keyword heuristics. No LLM call required -- keyword matching is sufficient for the coding-assistant domain where queries are direct and unambiguous.
func (QueryIntent) String ¶
func (qi QueryIntent) String() string
String returns a human-readable label for the intent.