the short answer
Send the RAG agent's question, retrieved chunks, tool results and final answer to Failproof AI in the same session trace. Run separate evaluations for citation validity, groundedness, retrieval relevance and answer completeness. Then use audits to group failed sessions into recurring findings, such as stale documents, missing index coverage or a query rewrite that selects the wrong source. Query and dashboard the results by agent and environment, fix the retrieval or generation path, and keep the evaluations running to verify recovery.
- Groundedness
- Does the retrieved evidence support each answer claim?
- Relevance
- Did retrieval return evidence that addresses the question?
- Completeness
- Did the answer cover what the question and evidence allowed?
- Failure analysis
- Audits group recurring retrieval and answer failures with trace evidence.
1. Capture Retrieval Evidence in the Session Trace
Instrument the RAG agent so each Failproof session contains the user question, every retrieval call, the returned chunks or documents, and the final response. Preserve document IDs and useful chunk metadata. Groundedness cannot be evaluated reliably if the answer and its evidence live in separate systems.
Include evidence from every retrieval step in the session, not only the final search. An agent may search several times, read a file and call an API before answering. Its own earlier statements are not evidence, even when the final response repeats them.
2. Create Separate Evaluations for Each Failure
| Evaluation | Question | Likely owner when it fails |
|---|---|---|
| Citation validity | Did every cited document appear in the retrieved evidence, and do exact quotes exist? | Application or citation formatter |
| Groundedness | Does the retrieved evidence support the factual claims in the answer? | Prompt or generation model |
| Retrieval relevance | Do the retrieved chunks help answer the user's question? | Chunking, embeddings or query rewriting |
| Completeness | Did the answer cover the parts supported by the available evidence? | Prompt, retrieval depth or workflow |
Use a code-based evaluation for exact citation and quote checks. Use an LLM-based evaluation for claim support, relevance and completeness. Tell the groundedness evaluation to use only the retrieved evidence, even when it knows a claim is true from its own training.
Keep these as separate results. One blended quality score cannot tell the team whether to repair retrieval, generation, citation formatting or source coverage. Failproof AI runs the evaluations in the cloud and can also run your existing evaluation suite.
3. Test and Deploy the Evaluations
Test each evaluation against real sessions before deployment. Include a grounded answer, an unsupported claim, a wrong-document retrieval and a question the index cannot answer. Each evaluation should move only for the failure it is intended to measure.
Deploy an immutable evaluation version and keep the key stable. Re-evaluate individual sessions while refining the criterion, then backfill the accepted version across recent RAG sessions to establish the baseline.
fp evals --since 24h --aggregate
fp evals --agent-id support-rag --aggregate
fp --json evals --aggregate --env production4. Run Audits to Find Recurring RAG Failure Patterns
Create a Failproof audit over the RAG agent with a goal such as "find recurring causes of unsupported answers" or "find topics where retrieval returns no useful evidence". The audit analyzes the failed evaluations together with the underlying retrieval calls and answer traces.
Related failures become findings with affected sessions, severity, evidence queries and a recommended fix. Common patterns include one stale document cited repeatedly, a missing topic in the index, a query rewrite that selects the wrong source, and a prompt that encourages the model to answer when retrieval returns nothing.
fp audits list
fp audits findings --status open --limit 205. Query and Dashboard Groundedness Over Time
Use Analyze → Queries to break results down by agent, environment, document, topic or deployment window. Save queries for groundedness failures, empty retrievals, stale-source findings and sessions where relevance is low but the answer still claims completion.
Build a dashboard from those saved queries. Keep groundedness, relevance and completeness side by side. A refusal can be perfectly grounded and useless, while a complete answer can be unsupported. The dashboard should preserve that distinction.
fp agent ask "Which production RAG sessions failed groundedness in the last 7 days? Group the affected sessions by retrieved document and agent version."
fp query run <saved-query-id>6. Fix the RAG Failure and Verify It
Assign the finding to the owner of the retrieval or answer path. Fix the stale source, missing index coverage, chunking, query rewrite, prompt or model behavior identified by the trace evidence. Keep the evaluation versions unchanged while verifying the product change.
Alert on important groundedness, relevance or completeness changes through email, Slack, webhook or the dashboard. Continue the audit so a new variant does not hide behind a recovered average.
Failproof AI has already built the trace storage, cloud evaluation execution, versioning, re-evaluation, backfill, recurring-failure analysis, native queries, dashboards, alerts and issue workflow. Your team defines what groundedness means for the product and repairs the RAG system. You do not need to build a separate scoring and investigation service around it.
FAQ
What is the difference between groundedness and relevance?
Groundedness checks whether the retrieved evidence supports the answer. Relevance checks whether the retrieved evidence addresses the question. A RAG agent can retrieve irrelevant material and still write a grounded answer about the wrong thing, so measure both.
Can Failproof AI evaluate groundedness without a model?
Exact checks such as phantom document IDs and misquoted spans can run as code-based evaluations. Claim-level support usually needs an LLM-based evaluation that reads the answer against only the retrieved evidence.
How does Failproof AI find the cause of low groundedness?
Cloud audits analyze failed evaluations with the retrieval calls and answer traces across many sessions. They group related failures into findings, show affected sessions and evidence, and recommend whether the likely fix belongs in sources, retrieval or generation.
Can a Failproof AI policy block an ungrounded answer?
Hook policies act on supported tool calls and tool results, not the text of a final reply. If an answer must be checked before the user sees it, put that synchronous response check in the application. Keep Failproof evaluations and audits running to find recurring causes.
Get Started
Failproof AI is free to start. It finds recurring failure modes across agent sessions using code-based and LLM-based evaluations, groups the evidence into findings, and recommends fixes. Bring the eval suite you already have, alert the right owner when behavior drifts, and turn a tested fix into a policy that prevents the failure from recurring. See pricing for the tiers.
Sources
Products change; if a detail here is out of date, tell us at support@befailproof.ai.
- Failproof AI docs: Evaluations overview
- Failproof AI docs: Testing evaluations
- Failproof AI docs: Audits
- Failproof AI docs: Alerts
- Failproof AI: Query agent traces