In a live demonstration, a retrieval-augmented generation (RAG) system's own monitoring dashboard detected a hallucination within seconds of the robot's statement. The setup integrates RAGAS-style evaluation directly into the production pipeline, using a three-tier architecture: a logging hook, an independent scorer, and a live dashboard.
The pipeline decouples inference from evaluation via a JSONL log file, allowing asynchronous scoring without imposing latency on user interactions. Only faithfulness and answer relevancy metrics run on live traffic, as they require no ground truth labels. More comprehensive metrics are reserved for nightly golden dataset runs.
The dashboard displays rolling averages and alerts when scores drop below calibrated thresholds. Notably, an honest refusal to answer scored 0.5 and triggered no alert, while a confident fabrication scored 0.0 and triggered an alert. However, alerts fire only after the answer is delivered, limiting their preventive value.
This approach separates lying, declining, and dodging behaviors through metric design. The full code is available on GitHub, and the demonstration uses models from Hugging Face.