SShortSingh.
Back to feed

How a RAGAs Evaluation Framework Caught a Vietnamese Bank AI Hallucinating Compliance Rules

0
·1 views

A compliance AI assistant built for a Vietnamese bank spent roughly a month generating confident but fabricated regulatory answers before a client-side domain expert — not the engineering team — raised the alarm. The system's retrieval layer was functioning correctly, but the generation layer was hallucinating penalty thresholds and approval conditions that contradicted source documents. The team had relied on manual spot-checks and a basic Notion tracker, missing a structured evaluation process entirely. RAGAs (Retrieval Augmented Generation Assessment) addresses this by scoring three distinct pipeline layers — faithfulness, context recall, and answer relevance — each diagnosing a different failure mode. Using an LLM-as-judge approach with a small model like GPT-4o-mini, a 100-question weekly evaluation run costs under five dollars and can be paired with a real-time faithfulness gate to block low-confidence answers before they reach users.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

AI Task Model Switching Needs Concurrency Contracts to Prevent Race Conditions

Switching an AI model mid-task is a multi-step distributed operation, not a simple settings change, making it vulnerable to race conditions when two switch requests overlap. If two requests complete out of order, a later-arriving response can silently overwrite the user's most recent intent, leaving the wrong model active. A generation-based guard addresses this by assigning an incrementing generation number to each switch request and only applying a completion when its generation matches the task's latest requested generation. MonkeyCode's commit c58bcd4 logs switch attempts with metadata including request IDs and timestamps, but no explicit compare-and-swap or per-task serialization contract has been identified in the reviewed code. Developers are advised to define clear contracts for duplicate requests, competing requests, late successes, and crash recovery, and to back them with targeted concurrency tests.

0
ProgrammingDEV Community ·

How to Evaluate LLM Outputs in Production Using Rubrics and Guardrails

Developers building production AI systems cannot rely on HTTP status codes alone to confirm output quality, as a successful server response may still contain hallucinated or harmful content. The Air Canada chatbot case illustrates this risk: the system returned valid responses while fabricating a bereavement discount policy, ultimately resulting in a tribunal ruling against the airline. A practical evaluation framework combines system prompts that define quality criteria, scored rubrics assessed by a second LLM acting as a judge, and runtime guardrails that block or flag unsafe outputs. This LLM-as-a-judge approach scores responses on dimensions such as factual accuracy, relevance, and harmlessness, scaling more efficiently than manual human review. Running evaluations asynchronously, logging all decisions, and updating rubrics via prompt changes allows teams to maintain continuous output quality monitoring in live environments.

0
ProgrammingDEV Community ·

Why AI Agent Decision Logs Should Record Rejected Options, Not Just Actions

A software developer has proposed expanding AI agent decision logs to include not only actions taken but also the options that were considered and discarded. The argument is that logging only chosen actions creates a misleadingly clean record, omitting the reasoning behind rejected alternatives and the conditions under which they might be reconsidered. The proposal introduces a structured log format featuring a 'revisit_when' field, signalling that a rejected option was unsuitable in a specific context rather than permanently inferior. A companion validator tool is also proposed to enforce completeness, flagging any rejection entry that lacks a reason or revisit condition. The author further recommends a user study to measure whether decision-plus-rejection logs help operators explain, challenge, and recover from agent actions more effectively than execution-only histories.

0
ProgrammingDEV Community ·

Framework Proposes Rigorous Method to Compare Cloud vs On-Device AI Costs

A technical review of MonkeyCode mobile code found that its speech-to-text and task features rely on server-side streaming, meaning it does not currently serve as evidence for on-device AI inference. The author argues that cloud and on-device AI cost comparisons must track four separate budgets — user latency, network transfer, provider spend, and device energy — rather than collapsing them into a single vague figure. A CSV template with fields covering device, model, token counts, network conditions, and energy in joules is proposed to standardize fair measurements. The framework warns against using battery percentage as a proxy for energy, recommending platform profilers or external power meters instead, and requires failures to be recorded rather than discarded. A release decision, the author concludes, should be driven by measurable thresholds across latency, bytes, cost, energy, privacy, and quality evaluated on identical task sets.