Documentation
¶
Overview ¶
Package intent classifies query intent to route graph traversal. Based on MAGMA (arxiv:2601.03236): intent-aware retrieval boosts the right edge types, improving LoCoMo score from 0.58 to 0.70.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EdgeWeights ¶
type EdgeWeights struct {
CausedBy float64
LedTo float64
Supersedes float64
LearnedIn float64
PartOf float64
RelatesTo float64
DependsOn float64
Touches float64
}
EdgeWeights maps edge types to boost multipliers for a given intent. Higher = more likely to traverse this edge type. Based on MAGMA's adaptive weight vector w_Tq.
func Weights ¶
func Weights(i Intent) EdgeWeights
Weights returns edge traversal weights for the given intent.
func (EdgeWeights) EdgeWeight ¶
func (w EdgeWeights) EdgeWeight(edgeType string) float64
EdgeWeight returns the boost for a specific edge type given intent weights.
type Intent ¶
type Intent int
Intent represents the detected query intent.
const ( IntentGeneral Intent = iota // default: balanced traversal IntentWhy // causal: "why", "reason", "cause", "because" IntentWhen // temporal: "when", "since", "before", "after", "timeline" IntentWho // entity: "who", "which library", "what tool" IntentHow // procedural: "how", "steps", "process", "workflow" IntentWhat // spec/fact: "what is", "describe", "explain" )
Click to show internal directories.
Click to hide internal directories.