A Streamlit lab for comparing chunking, retrieval, and reranking strategies side by side, scored with standard IR metrics on a built-in labelled set.
Role
Designed and built
Where
Independent project
When
Jul 2026
Access
Public repo · live demo
Problem
RAG quality is decided before the model sees anything: by how text is chunked, embedded, retrieved, and reranked. Those choices are usually made by habit, and the effect of changing one is rarely measured.
SystemStep 01 / 06
× n parallel fan-out
▭ store / memory
- - - conditional path
01
A registry per stage
Every strategy registers itself with a decorator, and a duplicate name raises an error. Adding a technique is one new file, and it shows up in every comparison for its stage.
02
Messy files to clean text
Uploads are converted to Markdown with LiteParse, or cleaned with Chonkie's text, Markdown, and table preprocessors.
03
Eleven ways to cut a document
Character, recursive, token, semantic, embedding-semantic, Markdown, table, and tree-sitter code splitting, plus three Chonkie chunkers, each with its boundaries drawn on the text.
04
Seven retrievers on the same documents
Keyword, boolean, TF-IDF, BM25, dense, hybrid, and MMR rank the same pasted documents. Hybrid fuses BM25 and dense results with reciprocal rank fusion.
05
Rerank, then prove it helped
Six rerankers run on the candidates, and MRR and NDCG are compared before and after reranking on the built-in labelled set.
06
One yardstick per stage
Embeddings get intrinsic evals (Spearman correlation, analogies, clustering ARI); retrieval gets P@k, R@k, MRR, MAP, and NDCG. The Metrics Explorer names the best strategy per metric, and every run is logged with its latency.
Measured
Chunking strategies
11
Retrieval strategies
7
Reranking strategies
6
Evaluators across stages
5
pytest tests
95
How it's verified
Harness
A self-registering plugin registry per stage, with every run logged by stage, strategy, and latency.
Evals
Standard IR metrics (P@k, R@k, MRR, MAP, NDCG) and intrinsic embedding evals on a built-in labelled set, including rerank impact before and after.
Testing
95 tests.
In depth
What is real and what is simulated
The lab runs with no model downloads, which means two components are approximations, said plainly:
·The 'dense' retriever uses a 64-dimension hash embedding, not a neural model
·The cross-encoder reranker is simulated
·IR metrics run on a built-in set of 6 documents and 3 queries, not on your own documents
Comparisons within a stage
Each page compares strategies for one stage at a time. Retrieval works on pasted documents rather than the chunker's output, so the lab answers 'which retriever is best here', not 'which full pipeline is best'.
Decisions
01Self-registering plugins with a duplicate-name check, so the registry stays the single list of strategies.
02Deterministic, model-free approximations for speed and reproducibility, disclosed rather than hidden.