Moosa Memon
← Index of work

A RAG accuracy audit in a box

rageval: point it at any retrieval or agent system through a thin adapter and get retrieval recall, faithfulness and hallucination rate as a report, plus a regression harness with a CI gate so it never silently degrades again.

Type
RAG
Stack
Python / LLM-as-judge / CLI / HTML reports
Status
Complete; pip-installable CLI with dashboard
Measured
Turns "it sometimes gives wrong answers" into recall@5, faithfulness per atomic claim, the specific fabricated sentences, and a baseline that fails the build on regression

Problem

A client says “the chatbot sometimes gives wrong answers.” That’s not actionable. What’s actionable is: retrieval recall@5 is 0.62, so the right document isn’t retrieved for 38% of questions and the generator is answering from whatever it got; faithfulness is 0.81, so 19% of answers contain at least one claim the context doesn’t support; here are the 14 cases and the exact sentences that were fabricated.

System

One interface, the adapter, is what makes the tool reusable. Anything that implements it can be audited: my own project, a client’s LangChain stack, or a REST endpoint I’ve never seen. rageval init writes a config, rageval run produces HTML and JSON, rageval calibrate checks the judge, and a baseline plus CI gate makes regressions a failing build.

Worth knowing

Four rules separate an audit tool from a scorecard generator, and each one is a design decision here:

This is the closest thing on this site to a productized Design Sprint deliverable: the audit that tells you what to fix before anyone builds anything.

Have a workflow that looks like this?

Most of these start as a messy, manual process someone got tired of. Twenty minutes is usually enough to sketch how I'd approach yours.