Retrieval relevance
Your code exposes retrieval evaluation routines alongside precision or recall routines. These metrics quantify matches against reference relevance labels.
Identified in calculate_precision_recall, evaluate_response_for_ir.
Failures
The returned score is recall although precision is also computed. Retrieving the expected documents alongside unrelated documents does not reduce that returned metric; extra context can still distract a document-answering assistant.
Code focus: tests/evals/eval.py:428 (evaluate_response_for_ir). The returned score: preserve precision alongside recall so irrelevant retrieved documents remain visible in the result.