How recall works
Each step is a pure function with its own tests.
- Tokenise. Lowercase, strip punctuation, drop stop words, matched on word boundaries, so
everyoneandmilestonesurvive and removingonenever corruptsDone. - Score. Sum weights across an inverted index: topic > router description > file name > content. No file is opened yet, and the cost grows with the question, not the corpus.
- Select. Keep the top five with a confidence margin. When two sources are close, both come back, marked as ambiguous. When nothing matches, it says no match.
- Read. Open only the winner.
- Slice. Keep the
##section whose heading matches, or a window around the densest lines. - Hop. Follow at most one pointer out of that slice. The cap of one is enforced by a test.
- Pack. Question, evidence and one instruction, capped at 9KB.
Why no model
Section titled “Why no model”Scoring takes well under a millisecond, so there’s no reason to spend tokens deciding where to look, and the result is the same every time for the same files. A model is only needed for what comes after: reading the evidence and answering.
The benchmarks, including the methodology mistakes found while producing them, are in
bench/RESULTS.md.