Expand description
Evaluation harness: sweep a matrix of {chunk_size, overlap, retrieval mode}
over a labelled dataset and rank the configurations by retrieval quality.
Each (chunk_size, overlap) builds a fresh in-memory index (chunk → embed →
store) from the dataset’s Markdown documents; then every retrieval mode is run
against every query and scored with metrics. Runs fully offline with the
hashing embedder and no LLM (the LLM-backed modes are included only when a
ChatModel is supplied).
Modules§
- metrics
- Retrieval quality metrics: recall@k, MRR, and nDCG@k.
Structs§
- Eval
Dataset - A full evaluation dataset.
- EvalDoc
- A dataset document, supplied as already-converted Markdown for determinism.
- Eval
Report - The ranked results of a sweep.
- EvalRow
- One cell of the sweep: a chunking config paired with a retrieval mode.
- Harness
- Runs sweeps against a dataset using a fixed embedder (+ optional LLM).
- Query
Case - A labelled query. A retrieved chunk is relevant if it contains any
relevantsubstring (case-insensitive). - Question
- A question as loaded from an external questions file. Accepts this crate’s
{query, relevant}shape, the QA-benchmark{text, kind}shape, and the output of theanswerssubcommand ({question, answer, …}— extra fields are ignored, soanswers --jsonoutput round-trips as a questions file). Only entries with non-emptyrelevantlabels can score retrieval.
Functions§
- documents_
from_ md_ dir - Build eval documents from a directory tree of Markdown files — typically the
RAG_DOCUMENTS_OUTPUTmirror produced byingest. Non-.mdfiles are skipped;nameis the path relative todir. - load_
questions - Load a questions file (a JSON array of
Questions in either shape).