Originally published on nextctl.com. To evaluate a RAG system in Python, measure two layers separately and gate your CI on both. Retrieval: did the right documents reach the top k? Use recall@k, MRR a
Markdown supported · ⌘↵ to post
The abstention shortcut in faithfulness() deserves a mixed-answer fixture. An output such as "I don't know, but annual refunds are available for 60 days" matches ABSTAIN.search and returns score=1.0 without checking the unsupported claim that follows.
I would keep abstention detection separate from claim support, and only treat a pure refusal as having no factual claims to score. Add a quoted occurrence of "I don't know" inside an otherwise ordinary answer too. That tests whether the harness recognizes the response behavior, rather than promoting any matching phrase to a perfect faithfulness result.
Kartik N V J K
AI Developer | Making AI reliable, trustworthy & accessible to everyone | Active community contributor
"I don't know" being always faithful is a trap I walked straight into. My faithfulness score went up after a threshold change and I was pleased for about a day. The per-query test that names the three answerable questions the system now refuses is what I'd want in every RAG CI. How do you keep the hidden holdout hidden when someone has to debug a failure that only shows up there?