Skip to main content

agrag.eval.answer

Answer-quality metrics for agrag, scored from questions and reference answers.

answer_case turns one agent run into a DeepEval test case. The four factories build DeepEval metrics that run the judge once. CitationAccuracyMetric checks each cited sentence against the evidence its citation keys point to.

All metrics judge against the evidence text the agent saw, as Ledger.render shows it. A chunk shows in full, whatever its size.

Classes:

Functions:

  • answer_case – Build the test case that every answer-quality metric scores.
  • context_precision – Build the metric for useful evidence ranked before noise.
  • context_recall – Build the metric for reference facts that the evidence covers.
  • correctness – Build the answer correctness metric against the reference.
  • faithfulness – Build the metric for claims that the evidence the agent saw does not contradict.
  • final_answer – Return the text of the last assistant message in an agent run.

Attributes: