Practical guides · Practical guide

Validating a retrieval-augmented assistant for GxP use

A knowledge assistant cites an internal source and sounds confident. It can still overlook an exception, retrieve an obsolete revision or add something the document never says. Retrieval-augmented generation improves access to sources. Each answer still needs to be checked for accuracy and suitability for use.

Table of contents

At a glance

How do you test a RAG assistant against approved sources?

Test the chain from the approved document set, preparation and indexing through access control, retrieval and the generated answer. Set expected answers and reference sources independently before testing. Include superseded documents, conflicting sources, restricted content and questions the assistant should decline. Check whether each cited passage supports the answer the user sees.

What the RAG architecture tells you about use

Retrieval-augmented generation (RAG) retrieves material from a source collection and uses it to generate an answer. Microsoft describes this as a way to ground language models in additional content. Implementations vary. This guide covers an internal knowledge assistant. Autonomous quality decisions and automatic record release are outside its scope. Identify the product, components and actual use separately.

Start with the question users may ask and what they may do with the answer. Finding a relevant SOP passage has different implications from assessing a deviation. If people stop checking the original document, an assistant described as a reference aid can become the effective authority for a regulated decision. Include that effect in the risk assessment and define the permitted use.

Sources: [1] [2]

Further reading:

Define the source collection and the rules for using each version

Decide which documents to include and who is accountable for their suitability. Record each document's identity, revision, status, scope and any historical context needed. Indexing every accessible file often introduces drafts, duplicates and withdrawn instructions. A larger collection does not necessarily improve the answers. Define when a source may be used for a particular question.

Distinguish current work from historical enquiries. A user investigating a previous event may need the version effective at the time. Someone carrying out today's task usually needs the version that applies now. The assistant must distinguish these uses as defined in its approved design. Removing all historical versions can prevent legitimate enquiries. Mixing them without control can produce wrong instructions. Provide context beyond the filename.

Sources: [2] [3]

Check document preparation and indexing as data processing

Many systems extract documents and split the text into passages. Tables, footnotes, page references or exceptions can be lost in the process. Test representative formats and complex structures. An intact source document does not establish that its search index contains all the required information. Check conditions that only make sense alongside a neighbouring paragraph or table heading.

Define which metadata stay with each passage and how revisions reach the retrieval system. A new revision must take effect according to the intended procedure, and a withdrawn document must not silently remain current. Test errors and delayed updates. Verify how the particular system handles retrieval and freshness. A general RAG diagram cannot give a service-level assurance.

Sources: [1] [2]

Measure retrieval separately from whether the answer reflects the source

Retrieval asks whether the system found the passage needed. Faithfulness asks whether the answer conveys its information correctly and completely. The right passage can be summarised badly, and a fluent answer may come from the wrong document. Assess both levels. An average score can hide a critical failure.

Prepare reference questions with independently established sources, required statements and additions that would be unacceptable. Include questions for which the sources are insufficient. A clear refusal to answer can be correct. Set criteria before testing and assess relevant variation in generated answers. One successful run cannot establish suitability across all phrasings and contexts.

Sources: [1]

Worked example of an exception in an SOP

The example SOP has a standard rule and an exception for one site. The assistant should help an authorised user find the right passage and identify where the exception applies. A second document describes an earlier version. An independently prepared reference answer names the current rule and the exception. It grants no new process approval.

Test a clear question, a question that omits the site, a conflicting source and a question suggesting an unsupported exception. The answer must remain faithful to the document. Also assess how the assistant handles instructions embedded in a source document. Retrieved material supplies information. It confers no authority to change system rules or disclose additional confidential data.

Test cases for the exception in the sample SOP
Test caseExpected outcomeWhat to assess separately
Unambiguous question The correct current passage Retrieval and answer content
Exception Preserve the site-specific condition Completeness and context
Earlier revision Identify the historical version Rule for determining validity
No relevant source State the limitation clearly No unsupported additions
Passage containing manipulative instructions System rules continue to apply Handling instructions found in retrieved material
Conflicting information Identify the need for clarification No invented resolution

Sources: [2]

Preserve access controls throughout the retrieval chain

Source access, the index, retrieval, answers and logs must follow the access model. Indexing documents under a shared technical identity must not give a user access to otherwise confidential content. Microsoft's secure RAG examples describe deliberately separating and enforcing access boundaries. Verify the features and controls available in your implementation.

Test permitted and denied access for representative roles. Consider indirect questions, quotations, summaries and reused intermediate results. Verify that revoking access to a source takes effect as designed, including caches and stored answers where relevant. Logs must not expose confidential material to a wider audience. Checking only the source document leaves later steps untested.

Sources: [4] [2]

Define expert review and the regulatory boundary

The 2025 Annex 22 consultation draft excludes generative AI and large language models from its proposed model scope. It does not envisage their use in critical GMP applications. For non-critical use, it proposes that suitably qualified and trained people remain responsible for the suitability of outputs. The draft is not in force. Applicable requirements, including Annex 11 where relevant, remain in effect. Connecting a language model to internal sources does not make it deterministic. Adding a reviewer alone does not make a critical application non-critical.

Design a review people can perform in practice. The user must be able to check the source, its validity, exceptions and permitted use. Test the review with deliberately incorrect outputs. A routine confirmation click gives no evidence that the review detects errors. Training and clear limits on use are necessary alongside a suitable technical architecture. Resolve open questions before relying on an answer for a relevant task.

Sources: [2] [5]

Monitor changes and decide whether to extend use

The assessed configuration includes the source rules, preprocessing, retrieval settings, prompt, model or service, and how the answer is used. Changes to any one of them can affect results. Define change triggers and responsibilities. Maintain reference questions for targeted retesting and add new failure cases as they arise. A fixed test set can miss new document types and patterns of use.

Weigh the benefit against error types, access rights, review effort and remaining limitations. Measure selection of the right sources, completeness of answers and appropriate abstention alongside speed or satisfaction. Give a pilot a defined dataset and permitted tasks. Decide whether to extend use only after reviewing the results and identifying which work still needs expert clarification.

Sources: [2]

Project experience and collaboration

Test the knowledge assistant against known questions and sources

We start with a defined task and a source collection with known effective versions and access permissions. For selected questions, process owners identify the source and statement needed for a usable answer. With IT, we trace what the assistant retrieves and produces, including cases involving a superseded SOP or a user lacking permission. A small suitable use may be examined in a limited pilot. Where an incorrect answer has critical consequences or an effective control is missing, the task must be narrowed or handled another way.

Frequently asked questions about Validating a RAG knowledge assistant

Does RAG eliminate hallucinations?

No. Additional sources can improve grounding, but the system can still select the wrong material or omit important information. Test retrieval and answer faithfulness separately. Include unsupported additions, missing exceptions and incorrect revisions. A citation alone does not establish that the cited source supports the statement.

Is RAG the same as model training?

No. RAG retrieves relevant content at runtime and supplies it with a request. Retrieval does not retrain the language model. Training or fine-tuning changes its parameters. A system may combine RAG with a previously fine-tuned model. Describe the actual architecture and assess sources, processing, outputs and use.

Sources: [1]

Must we include every SOP in the assistant?

Not automatically. Start with a defined use case and suitable sources. An uncontrolled collection may include duplicates, drafts and conflicting rules. Specify how validity, ownership and access rights are established. Expand the collection as the permitted use warrants and verify each extension.

How should the assistant respond when the sources cannot answer a question?

It should state the limitation and explain which information or expert clarification is needed. A plausible unsupported answer can mislead users in a regulated process. Define the expected response before testing. Evidence of appropriate abstention is part of the quality assessment.

Are one hundred routine questions enough to test the assistant?

The count alone cannot establish quality. Check coverage of tasks, source types, roles, errors and boundaries. Include unusual cases, conflicting sources and unauthorised access. Justify the selection and the expected answer. Many similar routine questions can leave critical weaknesses undiscovered.

When should we reassess a RAG assistant?

Assess changes to source rules, document formats, the index, retrieval, model, prompt, permissions and permitted use. Let the potential impact determine which claims to retest. An unchanged interface does not establish that processing is unchanged. Maintain reference cases and follow up new failure patterns in operation.

Sources and review date

Sources were checked on 14 October 2026. Separate sources support the regulatory interpretation and the supplier functionality. Adapt our examples, test matrices and templates to the intended use. On 18 October 2026, lines 20–25 of the scope of the 2025 Annex 22 consultation draft were checked against the EudraLex index. It did not list the draft as an annex in force. The other sources retain their original review dates.

  1. Microsoft, retrieval-augmented generation in Azure AI SearchRetrieval, grounding and indexing. A source reference alone establishes neither correctness nor suitability for GxP use. Checked on 14 October 2026.
  2. European Commission, EU GMP Annex 11, Computerised Systems (2011)EudraLex listed this version as current on 14 October 2026. It covers application, risk, operation and the data lifecycle. The proposed tests are our own.
  3. European Commission, EU GMP Chapter 4, Documentation (2011)Document control and records. The chapter sets no general page count for an SOP.
  4. Microsoft, Design a secure multitenant RAG inferencing solutionAn architecture example for access control and separation across retrieval and generation. Other suitable architectures are possible. Checked on 14 October 2026.
  5. European Commission, draft Annex 22 consultation text (2025), section 1, ScopeDraft checked on 14 October 2026. Generative AI and LLMs fall outside its proposed model scope. Its position on critical GMP use does not establish a newly binding prohibition.

Sources checked: .

Daniel Herrmann, Daniel Herrmann Consulting

Daniel Herrmann Consulting

How we can help

Daniel Herrmann Consulting combines assessment of the process with work on the actual system. Tell us the intended use, the evidence you have and the decision you need to make.

  • AI system validation →

    Bring your AI system into GxP use with traceable evidence and keep it under control in operation. Once the system and intended GxP use are defined, we validate according to risk, addressing data, supplier, tests, release and change control.

Send a project enquiry Customer testimonials →