Regulated AI
DeepWhat Should a Regulated Organisation Validate Before Relying on a RAG System to Answer GxP Questions?
Retrieval-augmented generation, RAG, answers a question by first retrieving passages from a defined document corpus and then generating a response grounded in those passages, rather than answering purely from the model's own training. Veeva now ships AI agents that can use Vault document and object data as context, making this assurance problem directly relevant to Vault customers. Veeva's public documentation does not, by itself, establish that every Vault AI Agent implements retrieval-augmented generation, so the RAG-specific controls in this reference apply where the deployed architecture actually uses retrieval over a governed corpus rather than being inferred from the product label.
A non-RAG AI capability can still have multiple independently failable layers, including preprocessing, the model itself, post-processing and surrounding workflow controls. RAG adds a particularly important set of assurance objects on top: the corpus the system retrieves from, the retrieval step that decides which passages are relevant, and the generation step that turns those passages into an answer. Validating only the model, or only that the tool "seems to work" on a handful of test questions, leaves the corpus and retrieval layers unexamined, and those are usually where a RAG system actually fails in production.
Control the grounding corpus before anything else
The corpus is the ceiling on what the system can correctly answer. If the corpus contains a superseded SOP alongside its replacement, the retrieval step has no reliable way to know which one is current unless the corpus itself encodes that state. Define, before go-live, what documents are in scope for the corpus, at what granularity they are split into retrievable chunks, and how the corpus is kept synchronised with the controlled document set it draws from. A RAG index built from an export that is refreshed only occasionally will silently drift behind the live, controlled document population; the reader asking a question has no way to know the index is stale.
Explicitly define how the corpus handles document lifecycle state. Superseded, obsolete, withdrawn or in-review documents should either be excluded from the retrievable corpus or tagged with their status in a way the retrieval step can act on, so a superseded procedure cannot be retrieved and presented as though it were current guidance. Where a RAG tool is built over Vault content directly, the corpus-currency question becomes a question about how frequently the underlying index synchronises with Vault's own document lifecycle states, not a separate copy-management problem.
Evaluate retrieval and grounding accuracy before go-live
Testing a RAG system by asking it a few questions and reading the answers is not evidence; it is a demonstration. Retrieval-augmented generation controls in GxP settings should extend existing frameworks such as GAMP 5 and ICH Q9(R1) risk thinking across the full RAG life cycle: data ingestion, preprocessing, embedding, retrieval, model versioning, user interaction, audit trails and operational monitoring, rather than treating the model's fluency as a proxy for correctness.
Build a defined evaluation set of representative questions with known, source-traceable correct answers before deployment, covering the query patterns the intended users will actually ask, including edge cases where the correct answer is "this is not covered" or "two documents disagree." Score two things separately: retrieval accuracy, whether the system retrieved the passages that actually contain the answer, and grounding accuracy, whether the generated answer is actually supported by the retrieved passages rather than the model filling a gap from its general training. These fail independently: a system can retrieve the correct passage and still generate an answer that goes beyond what that passage supports, or generate a well-grounded answer built on the wrong passage. One possible evaluation technique for the second failure is to compare the generated answer against the retrieved context directly, for example with a natural-language-inference style entailment check. That can support the evaluation, but it is not itself a GxP requirement or a substitute for a defined grounding-accuracy method appropriate to the intended use. Define a proportionate pass threshold and a documented decision for what happens when the system cannot ground an answer: it should say so, not answer anyway.
Preserve traceability from every answer back to its source
A GxP reader relying on an AI-generated answer needs to be able to check it, and checking requires knowing exactly what the answer was based on. Require every RAG-generated answer that could inform a GxP decision to carry a visible citation to the specific source document and version, not merely a document title, so the reader can open the actual passage relied upon and confirm it says what the answer claims. A citation to "the current SOP" without a version reference is not traceability; document versions change, and an answer generated against last month's index may cite a version that has since been superseded.
Where the retrieval index and the controlled document system are not perfectly synchronised in real time, the citation should also carry, or be checkable against, the index's own currency, so a reviewer can tell whether the cited version was actually current at the time of the answer. Decide and document how the system behaves when it cannot find adequate support for a question in the corpus: a fabricated-sounding but unsupported answer is a materially worse failure than a visible "not found," and the two should not be indistinguishable to the reader.
Monitor corpus currency and retrieval quality after go-live
Validation at deployment answers whether the system worked on the day it was tested. A RAG system's accuracy depends on a corpus that keeps changing as controlled documents are revised, approved, superseded and retired, so the validated state at go-live degrades on its own schedule unless something actively monitors it. Define a monitoring cadence and method for confirming the retrieval index remains synchronised with the controlled document population, and treat a detected synchronisation gap as a data-integrity issue in the tool, not a minor operational lag.
Periodically re-run the pre-deployment evaluation set, or an equivalent refreshed set, against the live system, and treat a material drop in retrieval or grounding accuracy as a trigger for investigation before the tool continues answering GxP questions unsupervised. Where the underlying language model itself is updated by the supplier, for example a new model version behind a Vault AI Agent, treat that as a distinct trigger requiring its own re-evaluation, because a model change can alter grounding behaviour even when the corpus and retrieval configuration are unchanged.
Require human oversight and keep a record of what was checked
A RAG answer is a starting point for a GxP decision, not a substitute for one, until an organisation has deliberately decided otherwise for a specific, bounded, low-consequence use and can defend why. Define the human decision point explicitly: who reviews a RAG-generated answer before it is relied upon, what they are expected to check, the cited source and its version, not merely whether the answer reads plausibly, and what record shows that review happened. A reviewer who cannot see the cited source cannot meaningfully review the answer, which is why citation traceability and human oversight are dependent controls rather than independent ones.
Where a RAG tool is used at higher volume for lower-consequence questions, define the narrower band of question types eligible for reduced human review, and require any question that falls outside that defined band, ambiguous corpus coverage, conflicting sources, or a novel query pattern, to route to full review rather than being answered silently at the same reduced standard.
Distinguishing RAG validation from model validation
None of this replaces the general AI governance already established for GxP use cases. Define the RAG tool's intended use under the same discipline LIB-013 sets out, user, process, authorised inputs, permitted reliance and human decision point, and classify its GxP risk using the same consequence-and-authority method LIB-028 sets out. What RAG adds on top is that the corpus, retrieval and generation layers each need their own evidence, because each can fail while the others remain correct. A validated intended-use statement and risk classification tell you how much scrutiny the tool deserves; they do not, on their own, tell you whether the corpus is current or whether the retrieval step actually found the right passage.
Sources
- Veeva Systems, Vault AI.
- Veeva Systems, Veeva AI Agents Now Available to Increase Productivity and Customer Centricity.
- Pharmaceutical Online, Controls For Retrieval-Augmented Generation In GxP.
- U.S. Food and Drug Administration, Computer Software Assurance for Production and Quality Management System Software (February 2026). FDA states that this revision supersedes the September 2025 final guidance; its stated scope is medical-device production and quality management system software, not RAG-specific validation guidance.
- Ding et al., Grounding and Evaluation for Large Language Models: Practical Challenges and Lessons Learned (Survey).