query_with_search dumped the entire wiki index into the LLM selector
prompt; at 10k+ articles this exceeded upstream context windows
(observed: 11,625-article KB ≈ 160k tokens). Deep-ask and promote
were hard-blocked at scale.
Prefilter the index with the existing tools.search tokenizer +
TF-IDF scoring, keeping only top_k candidates for the LLM selector.
Threshold (500) and top_k (200) are configurable via
config.yaml::query. Below threshold: behaviour is unchanged.
Downstream consulted bookkeeping and promote_to_concept still see
the full index; only the selector prompt is narrowed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>