Retrieval Debugger
Paste a query and your chunks to see a BM25 ranking broken down term by term, including the query terms that appear nowhere at all.
BM25 score 1.686, ahead of chunk 1 at 1.263. To cancel a subscription, open Settings, choose Billing, and select End plan. Access conti…
| rank | chunk | score | length | terms matched |
|---|---|---|---|---|
| 1 | #2 To cancel a subscription, open Settings, choose Billing, and select En… | 1.686 | 21 | 2 of 8 |
| 2 | #1 Refunds are issued to the original payment method within 5 to 10 busin… | 1.263 | 16 | 1 of 8 |
| 3 | #4 If a charge appears twice, the duplicate is voided automatically withi… | 0.861 | 20 | 1 of 8 |
| 4 | #3 Our uptime commitment is 99.9% per calendar month, measured at the edg… | 0.000 | 20 | 0 of 8 |
| 5 | #5 Seats can be added at any time and are billed pro rata for the remaind… | 0.000 | 19 | 0 of 8 |
| chunk 1, term by term | in chunk | IDF | contribution |
|---|---|---|---|
| to | 2 | 0.875 | 1.263 |
| how | 0 | 2.485 | 0.000 |
| long | 0 | 2.485 | 0.000 |
| does | 0 | 2.485 | 0.000 |
| a | 0 | 0.875 | 0.000 |
| refund | 0 | 2.485 | 0.000 |
| take | 0 | 2.485 | 0.000 |
| arrive | 0 | 2.485 | 0.000 |
Score 1.263 = the sum of the contributions. Length 16 tokens against an average of 19.2, giving a normalisation factor of 0.875 — above 1 means this chunk is penalised for being long.
- Chunks parsed
- 5
- Distinct query terms
- 8
- Query terms found in no chunk at all
- 6
- Average chunk length
- 19.2 tokens
- Scoring
- BM25, k₁ 1.20, b 0.75
- errorquery term "how"does not appear in any chunk, so it contributes nothing to any score
Expected: the term, a stem of it, or a synonym present in the text — this is a vocabulary mismatch, and it is the single most common reason a lexical retriever misses an obviously relevant chunk
- errorquery term "long"does not appear in any chunk, so it contributes nothing to any score
Expected: the term, a stem of it, or a synonym present in the text — this is a vocabulary mismatch, and it is the single most common reason a lexical retriever misses an obviously relevant chunk
- errorquery term "does"does not appear in any chunk, so it contributes nothing to any score
Expected: the term, a stem of it, or a synonym present in the text — this is a vocabulary mismatch, and it is the single most common reason a lexical retriever misses an obviously relevant chunk
- errorquery term "refund"does not appear in any chunk, so it contributes nothing to any score
Expected: the term, a stem of it, or a synonym present in the text — this is a vocabulary mismatch, and it is the single most common reason a lexical retriever misses an obviously relevant chunk
- errorquery term "take"does not appear in any chunk, so it contributes nothing to any score
Expected: the term, a stem of it, or a synonym present in the text — this is a vocabulary mismatch, and it is the single most common reason a lexical retriever misses an obviously relevant chunk
- errorquery term "arrive"does not appear in any chunk, so it contributes nothing to any score
Expected: the term, a stem of it, or a synonym present in the text — this is a vocabulary mismatch, and it is the single most common reason a lexical retriever misses an obviously relevant chunk
- notechunk 1ranks 2 of 5, and contains none of: how, long, does, a, refund, take, arrive
Expected: if you expected this chunk first, the terms above are what it would need — or a retriever that is not lexical
Everything on this page runs in your browser. Nothing you paste is uploaded, logged, or put in the URL — only the settings above the input are, so a configured tool can be linked to.
Start every retrieval bug here
When a RAG system returns the wrong chunk, the instinct is to blame the embedding model and start shopping for a better one. Check the words first. Paste the query and the chunk you expected into this page: if a query term appears in no chunk at all, the fix is a synonym, a rewrite step or a hybrid index, and no amount of embedding quality will make up for a corpus that uses different vocabulary from your users.
The other frequent culprit is length. BM25 penalises long documents because a long document has more chances to contain any term by accident, and the normalisation factor in the table above shows exactly how much your chunk is being marked down. Vector retrievers have their own version of this: a long chunk's embedding is an average of everything in it, so a single relevant sentence gets diluted by the nine irrelevant ones around it. Different mechanism, same symptom, same fix — smaller chunks.
Why lexical scoring is still worth having
Embeddings are bad at exactly the things BM25 is good at: rare tokens, product codes, error strings, names, numbers. A query for ERR_MODULE_NOT_FOUND or an invoice number needs an exact match, and a dense retriever will happily return five chunks about errors in general. That is why hybrid retrieval — BM25 and vectors, fused — beats either alone on almost every real corpus. If the ranking on this page looks more sensible than the one your system produced, you have found your answer.