Why RAG Demos Well and Audits Badly

The appeal of retrieval augmented generation is easy to understand. You take a question, convert it into a numeric representation, search a vector index for passages that are close to it in meaning, hand those passages to a language model along with the question, and ask the model to answer using only what it was given. The output looks like a knowledgeable colleague answering from the file cabinet rather than from memory. Compared with a general purpose chatbot, the improvement in accuracy on company-specific questions is large and immediate.

That first demo takes a competent engineer a few days. It is the reason RAG spread through pharma IT faster than almost any other pattern in the last three years. It is also the reason so many of these systems are now sitting in a gray zone, used daily by quality and regulatory staff, never formally validated, and unable to answer basic questions about their own behavior.

The research literature has been unusually blunt about this gap. An experience report drawing on three separate production RAG builds identified seven distinct failure points and concluded that validation of a RAG system is only feasible during operation, and that reliability evolves through use rather than being designed in at the start.1 That is an uncomfortable finding for a regulated environment, where the expectation runs the other way: you establish that a system is fit for its intended use before you rely on it, and you keep evidence.

The core tension. A RAG system is a search system and a generation system wired together, and it fails in ways that neither component fails on its own. Retrieval can return the right passage and the model can still answer wrongly. The model can answer correctly and cite a passage that does not support the claim. Both components can behave perfectly and the underlying document can be six months out of date. Testing the parts separately does not tell you the system works.

None of this argues against the pattern. It argues for treating the pattern as a system that has to be designed for auditability from the beginning, in the same way you would design a laboratory data system for data integrity rather than adding audit trails later. The five sections that follow are the choices that actually determine whether that is possible.

What “audit ready” means in this context

We use the phrase narrowly. An audit ready RAG system is one where you can answer four questions about any specific answer the system produced, at any time, without engineering effort:

  • What content produced this answer? Not the document title. The document, the version, the effective date, and the specific passage.
  • Was that content current at the time the answer was given? And if it has since been superseded, can you identify every answer that was based on the old version?
  • Was the person who asked entitled to see that content? Enforced by the system, not by policy.
  • How do you know the system works? A defined test set, measured performance, a threshold, and a record of what happened when performance moved.

Most implementations can answer the first question partially and none of the other three. The rest of this article is about closing that gap.

Design Choice 1: Document Versioning and Index Currency

This is the one that matters most and gets the least attention, so we are putting it first.

Here is the failure in plain terms. Your document control system holds SOP-QA-014 at version 6, effective March. Someone runs an ingestion job that pulls the effective version of every controlled SOP, splits each one into passages, converts those passages into vectors, and loads them into an index. The system works well. In July, SOP-QA-014 goes to version 7 through change control, with a meaningful change to a hold time limit. Nothing in the retrieval pipeline notices. The index still holds version 6 passages. The system keeps answering the hold time question with the superseded limit, confidently, with a citation to SOP-QA-014, which is a real and current document number. Every part of that answer looks right except the part that matters.

Why this is worse than an ordinary stale document problem. A stale PDF on a shared drive announces itself. It has a version number on the cover page and a date, and a trained person notices. A stale vector index does not announce itself. The passage has been stripped of its cover page, the citation resolves to a document that genuinely exists, and the answer is delivered in the present tense. The system has no mechanism for doubt because nothing told it anything changed.

What has to exist in the architecture

Three things, and they are separable.

Version-aware chunks. Every passage in the index carries the document identifier, the version, the effective date, the status (effective, superseded, retired, draft), and the section or clause it came from. This metadata travels with the passage into the model context and out into the answer. It is not stored in a side table that a developer can join to later. It is attached to the unit of retrieval, because the unit of retrieval is what ends up in front of the user. A system that stores only a document title and a file path has already lost the ability to answer the auditor’s first question.

Index rebuild triggered by document control, not by a schedule. This is the design decision that separates the serious implementations from the rest. A nightly or weekly reindex job is a schedule. It means that between the moment a new version becomes effective and the moment the job next runs, the system is knowingly answering from superseded content. In a regulated setting that window is a finding waiting to happen, and the length of the window is arbitrary rather than justified. The alternative is an event-driven pipeline: the document management system emits an event when a document changes state, and that event drives the reindex for that document. The state change is the trigger. The schedule becomes a safety net that catches missed events, not the primary mechanism.

This has a practical consequence that people underestimate. It means the RAG index becomes a downstream consumer of document control, with all that implies: an interface that has to be specified, tested, and monitored; a defined behavior when the interface fails; and a reconciliation process that periodically compares what document control says is effective against what the index actually holds. That reconciliation report is one of the most useful artifacts you can hand an auditor, and almost nobody builds it.

The ability to state which version produced a given answer. Not “the system uses current SOPs”. The specific version, recorded at answer time, in a log you can query. The reason this has to be recorded rather than reconstructed is that the index changes. If you try to reconstruct which version was retrieved by asking the index today, you will get today’s answer, not the answer that was given in March. The retrieval event has to be logged with the version identifiers of the passages that were returned, alongside the question, the answer, the user, and the timestamp.

DO

Treat the index as a controlled derivative

The index is derived from controlled documents, so it inherits their control requirements. Changes to the effective content have to propagate. Changes to how the index is built (chunk size, embedding model, metadata schema) are changes to a validated system and go through change control.

DO

Keep superseded versions retrievable, but marked

Deleting old versions from the index looks tidy and destroys your ability to investigate. Keep them, mark them superseded, and exclude them from default retrieval. A question about what the procedure said last year is a legitimate question.

DO NOT

Rely on a nightly job as the control

A schedule guarantees a known period of answering from superseded content. If a schedule is genuinely the only option, the window has to be risk assessed and documented, and the system should say when its content was last refreshed.

DO NOT

Store version data only at the document level

If the passage does not carry the version, the answer cannot carry it either. Document-level metadata that is joined in afterward breaks the moment a document is reindexed with different boundaries.

The change impact question

Once versioning is in place, a second capability becomes possible and is worth building deliberately. When a document version changes, you can identify the questions that were previously answered from the superseded passages and flag them. In practice this supports two things. It lets quality assess whether anyone acted on guidance that has since changed. And it gives you a targeted regression test set: the questions most affected by this change are exactly the questions to rerun after reindexing.

Regulatory documents are not static, and the research community has noticed the same thing. Work on regulatory question answering has specifically called out the length, complexity, and frequent updates of regulatory text as the defining difficulty of the domain, and built dedicated datasets to study it.11 The currency problem is not a pharma quirk. It is the central problem of putting a model over any regulated corpus.

Design Choice 2: Citation Fidelity, Not Citation Presence

Every RAG product screenshot shows citations. Small numbered markers, a source panel, a link back to the document. The presence of a citation is what makes the output feel trustworthy, which is precisely the problem, because a citation is easy to produce and hard to verify.

There are two distinct failure modes here and they are usually confused with each other.

Citation correctness asks whether the cited passage actually supports the claim. A system can generate a fluent, reasonable answer and attach a citation to a passage that is topically related but does not state what the answer says. The user checks that a citation exists, sees a real document number, and moves on.

Citation faithfulness asks something harder: whether the model actually used the cited passage to produce the answer, or answered from its own training and then attached a citation that happened to fit. Researchers call the second behavior post-rationalization. In a study that separated these two properties for the first time, the authors found that up to 57 percent of citations in attributed answers lacked faithfulness.2 The citation can be correct and unfaithful at the same time. The answer came from somewhere else, and the reference was attached afterward.

57% Upper bound of citations found to lack faithfulness, meaning the model did not actually rely on the source it cited2
4 Distinct abilities a RAG benchmark tests: noise handling, refusing to answer, combining evidence, and resisting false information6
3 of 4 Of those abilities, the ones on which evaluated models still struggled significantly6

For a regulated use, the practical implication is direct. Telling the model to cite its sources is not a control. A prompt instruction produces citations. It does not produce evidence that the citations are load bearing. If the only thing standing between your quality organization and a wrong answer is an instruction in a prompt template, you do not have a control, you have a preference.

What an actual verification step looks like

Verifying that a retrieved passage genuinely supports a generated claim is a real engineering problem with real approaches, none of which are free.

1

Decompose the answer into claims

Break the generated answer into individual factual statements. An answer that says “hold time is limited to 24 hours and requires QA approval to extend” contains two claims, and they may come from different passages or from only one.

2

Check each claim against the retrieved passage

This is a textual entailment problem: does the passage support the claim, contradict it, or say nothing about it? It can be run with a separate model acting as a checker, with a trained classifier, or with a mix. The important part is that it is a separate step evaluating a specific pair, not the same generation call being asked to grade itself.

3

Act on unsupported claims before the user sees them

The options are to remove the unsupported sentence, to mark it visibly as unsupported, or to refuse the answer and say what was searched and not found. All three are acceptable. Silently passing it through is not.

4

Log the verification outcome with the answer

The record of the check is the evidence. An answer log that stores question, answer, sources, and support status for each claim is what turns “we verify citations” from an assertion into something you can show.

Several public frameworks formalize the measurement side of this. RAGAS defines faithfulness and answer relevance alongside separate retrieval measures and evaluates them without needing hand-written reference answers.4 ARES takes a similar path with trained lightweight judges and confidence intervals.5 Earlier work established automatic metrics for citation quality in generated text and showed that models frequently produce citations that do not fully support their statements.3 There is also a purpose-built corpus of annotated hallucinations in retrieval augmented responses, which is useful if you want to train or calibrate a checker rather than assemble one from scratch.12

The design principle worth stating plainly

A system that returns a plausible answer with an unsupported citation is worse than a system that returns nothing. Nothing is a visible failure that sends the user to the document. A wrong answer with a real document number is an invisible failure that ends the search. In a quality context, the second one is the expensive one.

This makes refusal a feature rather than a shortcoming. Benchmark work on RAG has treated the ability to decline when the retrieved evidence does not contain the answer as one of the four core abilities, and found it to be one of the weakest in practice.6 Approaches that train models to decide when to retrieve and to critique their own output have been proposed partly to address this.15

Design Choice 3: Access Control Enforced During Retrieval

A regulated document set is never uniformly readable. It spans products at different stages, sites with different scopes, partner content under confidentiality terms, unblinded clinical material, and human resources or legal documents that got swept into the same repository. The permission structure that governs it in the document management system is real and enforced. The permission structure in a RAG pipeline is frequently an afterthought.

The failure looks like this. Retrieval runs against the whole index, unfiltered, because filtering is harder and hurts relevance. Passages come back. They are placed in the model’s context. Then, at the end, something checks whether the user is allowed to see the sources and hides the ones they are not entitled to.

By that point the content has already been used. The model read the restricted passage, reasoned over it, and the answer it produced reflects it. Hiding the citation hides the pointer, not the information. A user with no rights to a partner’s process description can receive an answer that is materially shaped by it, correctly, and never know a boundary existed. This is not a theoretical concern: it is the specific reason enterprise RAG security work has argued that authorization has to be evaluated before content reaches the model rather than after.9

The rule. A model that has already seen restricted content in its context has already leaked it. Post-generation filtering redacts the receipt, not the disclosure. Access control has to constrain the candidate set before retrieval returns, which means the permission model has to be part of the query, not part of the response handling.

What this requires structurally

Filtering at retrieval time is straightforward in principle and fiddly in practice. Each passage carries the access attributes of its source document. The query carries the identity and attributes of the requesting user. The retrieval engine applies the filter as part of the search rather than after it. The standard vocabulary for this is attribute based access control, where decisions are made by evaluating attributes of the subject, the object, and the context against a policy, rather than by assigning users to fixed roles.10 That model fits regulated document sets well, because entitlement in pharma is rarely a simple role. It is a combination of study, site, product, partner agreement, blinding status, and often a time boundary.

Three implementation details decide whether this holds up.

Permissions have to be current, not copied. If access attributes are copied into the index at ingestion time and never refreshed, then a permission revoked in the document management system stays effective in the retrieval layer until the next reindex. That is the same currency problem as document versions, applied to entitlement, and it fails the same way. Either the filter resolves permissions live against the source of truth, or permission changes trigger an update the same way version changes do.

The filter has to be enforced server side. A permission filter constructed in application code that a client can influence is not a control. This sounds obvious and is violated constantly, usually because the retrieval service was built as an internal component and later exposed through an interface that accepts a filter parameter.

Denied results should be counted, not silenced. When a query would have returned content the user cannot see, that fact is worth logging and worth surfacing in aggregate. Not the content, and not per query in a way that lets someone probe the boundary, but as a monitored signal. A sharp rise in filtered results for a particular user or team is a useful thing to notice.

Enforcement pointWhat it actually protectsVerdict for regulated content
Filter applied inside the retrieval queryRestricted passages never enter the model contextThe only defensible option
Filter applied to retrieval results before the model callRestricted passages are dropped before generationAcceptable if the drop is server side and logged
Citations hidden after generationThe pointer to the source, not the contentNot a control
Prompt instruction not to use restricted contentNothing. The model has already read itNot a control
Separate index per entitlement groupContent, cleanly, at the price of duplication and driftWorkable for a small number of hard boundaries

That last row deserves a note. Separate indexes for genuinely hard boundaries, for example unblinded study content or a single partner’s material under a confidentiality agreement, are often the right answer even though they duplicate infrastructure. The boundary becomes physical rather than logical, and physical boundaries are much easier to demonstrate to an auditor than policy logic. The trade-off is that you now have several indexes to keep current, which multiplies the versioning work described in the previous section.

Design Choice 4: Chunking Regulatory Text Without Breaking It

Chunking is the step where a document is split into retrievable pieces. It is treated as a tuning parameter, something you set to 512 tokens with 50 tokens of overlap and revisit if results are poor. For regulatory text it is a correctness decision, because the way procedural and regulatory language is written makes certain splits actively dangerous.

The four splits that produce confidently wrong answers

A requirement separated from its exception. Regulatory and procedural text is full of constructions like “Samples shall be tested within 24 hours of collection” followed two sentences later by “except for stability samples held under the conditions in Section 7.3, which shall be tested within 72 hours.” Split between those two statements and you have created a passage that states an unconditional rule the source document never stated. Retrieval returns it. The model answers with it. Every downstream check passes, because the passage genuinely says what the answer says. The document does not.

A table separated from its header. Tables carry meaning in two dimensions and most chunkers flatten them into one. Split a table across chunk boundaries and the rows in the second chunk lose their column names. A row that reads “Grade 2 | 15 | 30” is meaningless without the header that says what those columns are, and worse than meaningless if the model guesses. Regulatory content is dense with tables: acceptance criteria, sampling plans, stability schedules, dose modification rules.

A clause separated from its scope statement. Procedures often establish scope once at the top and then write the body in the imperative. A passage from the middle of a site-specific SOP reads as a universal requirement because the sentence limiting it to one site or one product family sits on page one and is nowhere near the chunk that was retrieved.

A definition separated from its use. When a document defines a term narrowly and then uses it throughout, a chunk containing the usage carries the ordinary meaning of the word rather than the defined one. “Critical” and “significant” do a lot of load-bearing work in quality documents, and their local definitions rarely travel with the passage.

The pattern behind all four. Regulatory documents are written as coherent wholes with internal cross-references, and the meaning of any given sentence depends on context that may sit hundreds of words away. Splitting on a fixed character count treats the document as a stream of interchangeable text. It is not. It is a structured argument, and the structure is what makes it enforceable.

What to do instead

Split on document structure, not character count. Use the section and clause hierarchy the document already has. Regulatory and procedural documents are heavily numbered for exactly this reason. A chunk that maps to a numbered clause is a chunk whose boundaries were chosen by the author.

Attach the ancestry to every chunk. Each passage carries the document title, the section path above it, and the scope statement. This is sometimes called contextual retrieval: prepending explanatory context to each chunk before it is converted into a vector, so that the chunk is interpretable on its own. Published measurements of this approach reported a 35 percent reduction in the top-20 retrieval failure rate from contextual embeddings alone, 49 percent when combined with a keyword search method, and 67 percent when a reranking step was added.8 The numbers come from a general corpus rather than a regulatory one, but the mechanism is the same and the mechanism is what transfers.

Handle tables as tables. Keep a table whole where possible. Where a table is too large, repeat the header row in every fragment and label the fragment. A chunker that treats a table the same as a paragraph has a known defect, not a tuning opportunity.

Carry exceptions with their requirements. Where structural splitting would separate a rule from a proviso, extend the chunk. Overlapping chunks are cheap. A missing exception is not.

Retrieve the neighborhood, not just the hit. When a passage matches, pull the adjacent passages and the parent section summary along with it. This uses up context length and buys correctness. Be aware that context length is not free in a different way: language models attend unevenly across long inputs, with performance highest when relevant information sits near the beginning or end of the context and degrading noticeably when it sits in the middle.7 Stuffing thirty passages into the context to be safe can make the answer worse, not better.

A practical test for your chunking strategy. Take twenty requirements from your own SOPs that have exceptions, provisos, or scope limits. For each one, ask the system the naive question a new employee would ask. If the system answers with the unconditional rule and omits the exception, your chunking is producing confidently wrong answers, and no amount of prompt engineering downstream will fix it. This test takes an afternoon and is the single highest-value thing to run before anyone relies on the system.

Design Choice 5: Evaluation and Monitoring You Can Show Someone

Ask most teams how they know their RAG system works and you will hear that the users like it and there have not been complaints. That is not an answer a quality organization can use, and it is not an answer the underlying technology makes hard to improve on.

The held-out question set

The foundation is a set of questions with known correct answers, written by the people who own the source content, and held separate from the people building the system. Two hundred questions is a reasonable target for a departmental system. The properties that matter:

  • Each question has a documented correct answer and a documented correct source, identified by document, version, and section. This lets you measure retrieval and generation separately.
  • The set includes questions the system should refuse. Questions whose answers are genuinely not in the corpus. If every question in your test set is answerable, you have no measurement of whether the system knows its own limits.
  • The set includes the hard cases deliberately: requirements with exceptions, near-duplicate procedures across sites, terms that mean different things in different documents, and questions that require combining two documents.
  • The set is versioned and maintained. When source documents change, the expected answers change. A test set that silently goes stale is worse than no test set, because it reports success.

Measure retrieval and generation separately

This is the part teams most often get wrong, and it has a practical consequence: if you only measure end-to-end answer quality, you cannot tell whether a regression came from the retriever or the generator, and you will spend weeks tuning the wrong component.

LayerWhat to measureWhat a drop tells you
RetrievalRecall at k: does the correct passage appear in the top k results at allThe index, the chunking, or the embedding model. Nothing downstream can fix a passage that was never retrieved.
RetrievalPrecision and ranking: how much irrelevant material comes with it, and where the correct passage ranksReranking, filtering, or query handling. Also a warning that the model is being asked to sift noise.
GenerationFaithfulness: is every claim in the answer supported by the retrieved passagesThe generation step or the prompt. The evidence was there and was not used properly.
GenerationAnswer correctness against the known answerCombined effect. Only interpretable alongside the two above.
BehaviorRefusal rate on unanswerable questions, and false refusal on answerable onesCalibration. Both directions matter: a system that never refuses and one that refuses constantly are both unusable.
ProvenanceVersion accuracy: did the answer cite the version that was effective at the timeThe ingestion pipeline or the document control interface. This is the regulated-environment measure that general frameworks do not include.

Separating retrieval quality from answer quality is standard practice in the evaluation literature, and the public frameworks are built around exactly this split.45 Retrieval performance itself has a long measurement tradition, and benchmark suites exist specifically to test how retrieval models generalize to domains they were not trained on, which is directly relevant when you point a general purpose embedding model at pharmaceutical quality documents.13 The same applies to the choice of embedding model itself, where public comparisons across many tasks are available and worth consulting before defaulting to whatever the platform ships with.14

Detecting degradation when the corpus moves

A RAG system does not degrade the way a piece of software degrades. The code does not change. The corpus changes underneath it, and performance moves without anyone deploying anything. Four signals are worth monitoring continuously.

SIGNAL 1

Scheduled reruns of the held-out set

Run the full question set on a fixed cadence and after every material corpus change or model update. Track each measure over time, not just the latest value. A slow decline across three runs is more informative than any single number.

SIGNAL 2

Index and document control reconciliation

Compare the set of effective documents and versions in document control against what the index holds. Any difference is either a missed event or a failed ingestion. This report is cheap to build and directly answers an auditor’s currency question.

SIGNAL 3

Live faithfulness sampling

Run the claim verification step on a sample of real production answers, not just test questions. Real questions are messier than test questions and will surface failure patterns your test set does not contain.

SIGNAL 4

Query and refusal drift

Watch the distribution of questions and the refusal rate. A rising refusal rate often means the corpus lost coverage of a topic. A shifting question mix means the system is being used for something it was not evaluated for, which is a scope question, not a technical one.

The re-embedding trap

Changing the embedding model requires rebuilding the entire index, and the new index will behave differently. Passages that ranked first may not. Every measurement you have taken is invalid until you rerun the test set. Teams treat an embedding model upgrade as a routine dependency update because that is what it looks like in the code. In a validated system it is a change that alters retrieval behavior across the whole corpus, and it belongs in change control with a documented before-and-after comparison on the held-out set.

Where This Is Genuinely Worth Doing in Pharma

All of the above is real work. It is worth being specific about where the return justifies it, because the pattern is being applied indiscriminately and some applications do not need this much machinery while others need more.

SOP and policy question answering

This is the highest-volume use and the one with the clearest value. A manufacturing supervisor, a QA reviewer, or a new analyst has a procedural question and the answer exists in a controlled document that takes fifteen minutes to find. Multiply by a few thousand questions a month across a site.

It is also the use with the sharpest failure consequences, because the answers drive actions on product. This is where every one of the five design choices earns its place, and where the versioning requirement is non-negotiable. If you build only one audit-ready RAG system, build this one, and accept that it is a validated system with the documentation that implies.

Regulatory intelligence across authority guidance

Regulatory affairs teams track guidance across FDA, EMA, MHRA, ICH, and national authorities, in several languages, updated continuously. The corpus is external, large, and genuinely hard to keep current manually. RAG fits well here.

The design emphasis shifts. Access control matters less, because the source content is public. Versioning matters differently: you are tracking draft versus final, comment periods, transition dates, and superseding documents, and the currency question becomes “which version of this guidance was in force on the date in question.” Citation fidelity matters enormously, because the output feeds regulatory strategy decisions and a mis-attributed requirement can send a submission in the wrong direction. Published work in this area has built dedicated datasets and metrics precisely because generic evaluation does not capture whether an answer covers all applicable obligations without contradicting itself.11

Submission content reuse

Protocols, clinical study reports, statistical analysis plans, and module summaries share large amounts of methodology and safety language. Finding the right precedent text across a submission archive is slow, and inconsistency between documents that should agree is a real review risk.

Here the retrieval requirement is different again: you are usually looking for a passage to reuse rather than an answer to a question, which means recall and provenance matter more than generation quality. The system should be very good at finding candidate text and identifying exactly which document and version it came from, and comparatively conservative about rewriting it. Applied research on extracting structured product information from regulatory source documents using retrieval augmented approaches has shown the pattern works for this kind of targeted extraction, while also being clear that it is a preliminary result rather than a solved problem.17

Deviation and CAPA precedent search

When an investigator opens a deviation, the most useful question is whether anything similar has happened before, what the root cause was, and whether the corrective action worked. That information exists in the quality system and is nearly unsearchable, because deviation records are written in free text by many authors with inconsistent terminology.

This is the use where RAG adds the most and the risk profile is most manageable, because the output supports human investigation rather than replacing a decision. The design emphasis is on recall and on access control, since deviation records often carry product and site restrictions. Versioning is less central because quality records are point-in-time rather than versioned. The realistic goal is a shortlist of relevant prior events with links, not a generated root cause.

Where we would not start. Anything where the model’s output is the decision rather than support for a decision. Anything touching content that has not been through document control, because you inherit an uncontrolled corpus and no version story. And anything where the questions are genuinely analytical rather than retrieval-shaped, for example trending across hundreds of records, where a structured query against structured data will beat retrieval every time and be far easier to defend.

What the applied evidence shows so far

Peer-reviewed evaluation of RAG on pharmaceutical regulatory content is starting to appear and is worth reading carefully rather than quoting selectively. One 2026 study evaluated RAG systems against FDA guidance for drug information and clinical trial protocols. On protocol summarization it reported 100 percent answer relevancy and 95 percent faithfulness. On evaluating a statistical analysis plan against statistical guidance it reported 85.7 percent accuracy and 100 percent faithfulness, with a lower domain-specific score that the authors attributed to omissions of minor details in the statistical methodology.16

Two things are worth drawing from that. The first is that the technology performs respectably on well-scoped regulatory tasks. The second is the shape of the residual error: omissions rather than fabrications. For a system supporting a regulatory reviewer, a quiet omission is the harder failure to catch, because there is nothing wrong on the page. That is an argument for designing the human review step around completeness rather than around checking whether what is written is true.

The Questions an Auditor Will Ask

This is the section to take into a design review. These are the questions we would expect an inspector or an internal auditor to ask about a RAG system used in a GxP context, and the artifact that answers each one. If you cannot produce the artifact, the design is not finished.

The questionWhat answers it
What is this system’s intended use, and what is it not used for?A defined scope statement with in-scope and out-of-scope question types, and a control that keeps use inside it. Regulatory expectations for written procedures governing production activities are long established and apply to the systems supporting them.18
Show me an answer this system gave in March and tell me which document version produced it.The answer log, with question, answer, retrieved passage identifiers, document versions, user, and timestamp. Retained for the applicable record period.
SOP-QA-014 went from version 6 to version 7 on 12 March. When did the system stop answering from version 6?The ingestion log tied to the document control event, plus the reconciliation report showing index contents against effective documents.
How do you know the answers are supported by the sources cited?The claim verification design, plus measured faithfulness on the held-out set and on sampled production answers.
Can a user retrieve content they are not entitled to see?Retrieval-time filtering design, evidence of server-side enforcement, and a negative test showing a restricted query returning nothing.
How do you know the system still performs as it did at validation?The held-out question set, the trend of measures over time, defined thresholds, and the record of investigations when a threshold was crossed.
What happens when the system does not know?The refusal behavior, the measured refusal rate on unanswerable questions, and what the user is shown.
Who reviewed this answer before it was acted on?The human review step in the process, defined by risk. For higher-risk questions this has to be a documented review, not an assumption that someone checked.
What changed since the last review?Change control records covering the corpus, the chunking configuration, the embedding model, the retrieval parameters, and the prompt templates. All five are configuration, and all five change behavior.
What did you do the last time it was wrong?The incident record. A system with no recorded failures after a year of production use is a system with no detection, not a perfect one.

The one that catches people

The prompt template is configuration. It changes system behavior as surely as a parameter change in a manufacturing execution system, and in most organizations it lives in a code repository that developers change freely without a change record. Deciding early that prompt templates are controlled configuration avoids an awkward conversation later, and it is a small amount of process to add at the start compared with reconstructing a year of undocumented changes.

Conclusion

Retrieval augmented generation is a good pattern and it is going to be widespread in pharma and biotech regardless of what anyone writes about it. The question is not whether to use it but whether the version you build can answer for itself. The five choices in this article are the ones that decide that, and they are all architectural. Versioning, citation verification, access control placement, chunking, and evaluation design are decided in the first two weeks of a build and are expensive to retrofit in month nine, which is exactly when someone asks the first hard question about it.

Our consistent observation is that the gap between a demo and a defensible system is not model quality. It is provenance and evidence. The teams that get this right treat the retrieval index as a controlled derivative of document control, treat the prompt template and the embedding model as controlled configuration, and build the held-out question set before they build the interface. That sequence feels slower for about a month and then stops being slower, because they are not rebuilding.

Sakara Digital works with pharma and biotech organizations designing this kind of system for regulated content. If you are standing up a RAG capability over SOPs, guidance, or quality records and want an independent read on where the architecture will be challenged, we are happy to have that conversation.

For Further Reading