Skip to main content

adaptive_vector_weight

Function adaptive_vector_weight 

Source
pub fn adaptive_vector_weight(kind: QueryKind) -> f32
Expand description

Return an adaptive vector_weight (0.0–1.0) for a HybridSearcher based on the inferred [QueryKind].

QueryKindvector_weightRationale
Keyword0.25Exact-term signals dominate
Hybrid0.50Balanced blend
Semantic0.75Embedding captures intent better
Temporal0.00Pure BM25 — any vector weight degrades temporal

CE-19: Temporal weight reduced from 0.20 to 0.00. LoCoMo CE-18 data showed Hybrid(80/20) scored 40.6% vs pure BM25 43.8% (−3.2pp). Date-prefixed memories have near-zero cosine similarity to “when did X happen?” queries; even 20% vector weight consistently pulls wrong candidates into the MinMax score. vector_weight=0.0 makes the Hybrid path mathematically equivalent to pure BM25 scoring.