Cited answers
Ask the corpus
Every answer is stitched from retrieved passages, and every sentence keeps a pointer to the chunk it came from. No model is called.
loading corpus…
Answer
waiting for the corpus
Loading the 20-document corpus and building the index…
Retrieval scores
top 3 chunks
Providers
optional; this answer used none of them
Mechanics
Retrieval lab
The query goes through the same tokeniser as the documents. Each row shows the BM25 contribution of every matched term, not just a final number.
query tokens
Score formula
IDF is computed once per term from document frequency. The second factor rewards term frequency, damped by chunk length.
idf = ln(1 + (N - df + 0.5) / (df + 0.5)) score = Σ idf · tf·(k1+1) / (tf + k1·(1 - b + b·len/avgdl))
Chunk under the cursor
Select a row to read the full chunk text.
Measurement
Evaluation
36 hand-written questions over the 20 documents. Hit rate, MRR and recall are computed live in the browser and compared with the Python baseline.
Metrics by cutoff
live JavaScript vs committed Python baseline
What the labels contain
Misses at k=1
questions phrased in a reader's words instead of the documentation's words
Source data
Corpus
Twenty documents of product documentation for a fictional API platform. Each row is one file in corpus/documents.json.