RAGBench


A modular RAG evaluation harness. Every part of the pipeline (chunker, embedder, retriever, reranker, LLM) is swappable from a config file, so you can change one piece and measure what it does to retrieval and answer quality.

Pipeline

Chunkfixed size, sentence, semantic
→
RetrieveBM25, dense, hybrid (RRF)
→
Reranknone or cross-encoder
→
Generatelocal HF, OpenAI, Anthropic
→
Evaluateretrieval metrics + LLM judge

Components are Strategies behind small interfaces and are built from plain config dicts by a Factory.

Measured results

20 documents, 20 labeled queries (with near-miss distractors), top_k = 3. Real runs, not illustrative numbers.

semantic_hybrid beat baseline on every quality metric here. The cost is a one-time ~36s indexing step to embed the corpus. Generation and judging used a small local model (Qwen2.5-0.5B-Instruct), so faithfulness numbers reflect that model's limits.

Retrieval metrics

MetricBaselineSemantic hybrid
Recall@31.0001.000
Precision@30.4830.750
MRR0.9751.000
nDCG@30.9740.980

Implemented from scratch, with no external metrics library. Ground truth is tracked at document level.

Run it yourself

pip install -r requirements.txt
python run_experiment.py --config experiments/configs/baseline.yaml

# interactive pipeline builder
uvicorn webapp.backend.main:app --reload

The interactive UI needs a Python backend, so this page is a static showcase and not the live app.