Retrieval-augmented generation, beyond the demo
The demo-to-production gap
A retrieval-augmented generation demo is easy to make compelling. Load a set of documents, create embeddings, ask a question, and show a fluent answer with a source link. Production introduces a different standard. Users ask vague questions, content changes, permissions differ, documents conflict, and the correct answer may require evidence from several systems. The application must decide what to retrieve, how much context to supply, when to decline, and how to show its work. It also needs to respond within an acceptable time and cost. The gap between demo and production is therefore not a final polish phase. It is the distance between a model interaction and a dependable information product.
The demo often hides the operating environment. Test documents are clean, the questions are known, and the person presenting already understands the expected answer. Real users do not provide ideal wording, and they may interpret a polished response as more certain than it is. Production content contains duplicates, obsolete versions, scanned pages, tables, acronyms, and exceptions. Some answers are governed by the most recent policy, while others depend on a historical record. A useful RAG system must handle these distinctions and make its uncertainty visible. It should help users reach evidence, not simply generate language that resembles an answer.

What actually breaks
Retrieval quality is usually the first breaking point. Generic chunk sizes can split a definition from its conditions, lose table structure, or combine unrelated topics. Vector similarity can miss exact identifiers and specialised terms, while keyword search can miss paraphrased intent. Strong systems often use hybrid retrieval, metadata filters, query rewriting, and re-ranking, but each technique should be justified through evaluation. Source preparation matters just as much. Teams need deduplication, version handling, metadata enrichment, access control, and refresh pipelines. If obsolete or unauthorised content enters the candidate set, a capable model can still produce the wrong outcome.
The second breaking point is evaluation. A few hand-picked questions cannot reveal whether the system is dependable. Build a representative set that covers common tasks, difficult wording, conflicting sources, permission boundaries, missing evidence, and questions that should not be answered. Evaluate retrieval separately from generation so the team can identify whether the right evidence was found and whether the answer used it correctly. Include domain experts because semantic correctness often depends on policy or operational context. Automated scoring can support iteration, but it should be calibrated against human judgement. Production feedback then expands the set with actual failures, creating a loop between use, diagnosis, and improvement.
Building for trust
Trust begins with provenance. Responses should cite the specific source passages used, preserve links to the original material, and distinguish quoted evidence from generated explanation. If sources conflict or are incomplete, the interface should say so and guide the user toward the next step. Permissions must be enforced during retrieval, not filtered after generation, because unauthorised context should never enter the model prompt. Logs should capture the query, retrieved items, model configuration, output, and relevant user feedback while respecting privacy and retention requirements. This evidence makes incidents diagnosable and allows teams to compare changes over time.
Guardrails should reflect the use case rather than rely on a generic safety layer. A policy assistant may need strict source grounding and a refusal when no approved evidence is found. A research assistant may be allowed to synthesise across sources but must label assumptions. A service tool may draft a response while requiring approval before it reaches a customer. The design should define consequence, authority, and escalation for each action. Models and prompts will change, so these rules belong in the surrounding product and workflow. Trust grows when behaviour is predictable, limitations are visible, and users know how to verify or challenge the result.
Where this lands for you
A production RAG programme should start with a narrow information domain and a clear user task. Identify authoritative sources, owners, permissions, refresh expectations, and the decisions the application will support. Build the ingestion and retrieval path with traceability, then create an evaluation set before optimising prompts. Release to a controlled group and observe where users reformulate questions, ignore citations, or leave the tool to complete the task elsewhere. These behaviours reveal product gaps that accuracy scores alone cannot show. Improve retrieval, response design, and workflow integration together rather than treating the model as the only variable.
The long-term goal is a reusable retrieval capability without forcing every use case into one index or one response style. Shared services can provide source onboarding, access enforcement, metadata standards, evaluation tooling, observability, and model gateways. Product teams can then adapt retrieval and interaction patterns to their domain. This balance prevents duplicated infrastructure while preserving the context that makes each application useful. Beyond the demo, success is not measured by how often the system produces an answer. It is measured by how reliably people reach the right evidence, how safely uncertainty is handled, and whether the capability improves the decision or workflow it was built to support.
Before expanding access, run a production readiness review that covers content ownership, refresh failures, permission changes, evaluation thresholds, incident response, and user support. Inspect traces from both successful and failed questions. Confirm that the team can distinguish a retrieval problem from a generation problem and can roll back a model, prompt, or index change independently. Test the behaviour when no source qualifies, when sources conflict, and when the model provider is unavailable. Include load, latency, and cost tests that reflect expected usage peaks. Verify that support teams can reproduce an incident without requesting sensitive content from a user. These scenarios are not edge decoration. They determine whether users can rely on the system during ordinary operational pressure. A RAG product is ready when its failures are as intentionally designed as its best answers.


