Skip to main content

Module query

Module query 

Source
Expand description

Local lookups that answer with references — URL + anchor + snippet — inside a token budget, never with document bodies. The recipe:

  1. IDF-weighted tiered lexical scoring over node/segment labels (exact ×1000, prefix ×100, substring ×1), scaled by squared term-coverage so partial matches of many terms beat a lucky exact match of one.
  2. Seed selection with a per-term guarantee (every query term seats its best node) capped at a few seeds.
  3. Bounded BFS expansion that refuses to expand through hub nodes (≥ p99 degree), decaying by hop, edge weight, and confidence.
  4. Fusion with persisted importance, then deterministic seeds-first rendering that stops before the token budget is exceeded.

Structs§

Anchor
A sub-document anchor attached to a hit: fetch url and slice by the byte range (or resolve the heading) instead of re-reading the whole page.
Hit
One lookup answer entry. Borrowed from the snapshot; cheap to produce.
QueryOpts
Query options.
TokenBudget
Token allowance for a rendered answer (~4 bytes/token estimate).