Build a groundedness validator that determines whether a RAG agent's response is grounded in the provided context documents. The validator uses a citation-based approach, leveraging the Citation Generation LoRA adapter to link spans of the response back to spans in the source passages.
The validator pipeline should have four stages:
- Citation Generation -- Use the citation generation intrinsic to produce citations mapping response spans to supporting passages in the source documents.
- Citation Necessity -- Classify each response span as needing or not needing a citation (e.g., conversational filler like "I'm happy to help" does not need one).
- Citation Support -- For spans that need citations, evaluate whether the generated citations fully support, partially support, or do not support the claim.
- Groundedness Output -- Produce a final boolean (grounded / not grounded) and a reason string explaining any unsupported spans. The reason should be usable by a downstream repair strategy.
The multi-stage pipeline should be encapsulated behind a simple interface so that integrating it into an existing agent requires minimal code, ideally one or two lines to add groundedness validation to a flow.
The validator should be tested end-to-end within an IVR (Introspective Validation and Repair) loop, not just in isolation.
Build a groundedness validator that determines whether a RAG agent's response is grounded in the provided context documents. The validator uses a citation-based approach, leveraging the Citation Generation LoRA adapter to link spans of the response back to spans in the source passages.
The validator pipeline should have four stages:
The multi-stage pipeline should be encapsulated behind a simple interface so that integrating it into an existing agent requires minimal code, ideally one or two lines to add groundedness validation to a flow.
The validator should be tested end-to-end within an IVR (Introspective Validation and Repair) loop, not just in isolation.