On this page
Retrieval-Augmented Generation (RAG) demos are seductive: point a model at your documents, ask a question, get a confident answer. Then you ship it, and reality arrives — stale answers, confident hallucinations, and the occasional leak of information a user shouldn't see. Moving RAG from prototype to production is mostly about the parts the demo skipped. This is the checklist our generative AI team works through.
Retrieval quality is the whole game
If retrieval surfaces the wrong context, no amount of prompt engineering saves you. Invest here first:
- Clean sources: remove duplicates and outdated versions, keep titles, dates and section headings as metadata.
- Thoughtful chunking that follows document structure rather than fixed character counts, with enough overlap to keep context.
- Hybrid search: combine keyword (BM25) and vector search — keyword search still wins on product codes, error messages and names.
- Re-ranking of the top candidates with a cross-encoder or re-ranking model before they reach the prompt.
- Metadata filters (product, region, date, permission) applied before similarity search.
Measure retrieval directly — is the passage that contains the answer in the top results? — before you even look at generation. That pipeline work is classic AI & data engineering.
Ground, then generate
Instruct the model to answer only from the retrieved context and to say it doesn't know when the context doesn't contain the answer. Return citations so users — and you — can verify each claim. A grounded "I'm not sure, here's who to ask" beats a fluent fabrication every time, especially in support, legal, finance or healthcare settings.
Evaluate like you mean it
You cannot improve what you don't measure. Build an evaluation set of real questions with known-good answers and source passages, then score for:
- Retrieval: did the right passages come back?
- Faithfulness / groundedness: is every statement supported by the sources?
- Answer relevance and completeness: did it actually answer the question?
Run the set on every change to prompts, models, chunking or retrieval settings, and treat drops as regressions that block release. Automated LLM-based judges speed this up, but calibrate them against human review, and keep humans in the loop for high-stakes domains.
Guardrails and access control
A RAG system inherits the access model of its data. Enforce permissions at retrieval time — filter by the user's entitlements before anything reaches the model — so a user can never be shown context they couldn't open themselves. On top of that:
- Defend against prompt injection, including instructions hidden inside retrieved documents. The OWASP Top 10 for LLM Applications lists prompt injection as its first risk, and it is a useful checklist for the rest.
- Filter inputs and outputs for sensitive data (PII, secrets) and off-topic or unsafe requests.
- Limit what tools and actions the model can trigger, and require confirmation for anything irreversible.
- Apply rate limits and cost limits per user.
We include LLM-specific testing in our VAPT services, and SemperWise offers AI red teaming for teams that want an independent attempt to break their assistant.
Keep the index fresh
Stale answers are often an ingestion problem, not a model problem. Re-index incrementally when source documents change, delete chunks when documents are removed, and record the source version and date with every chunk so answers can show how current they are.
Observe in production
Log queries, retrieved chunks, model versions and responses (with appropriate privacy controls and retention) so you can debug failures, collect user feedback and spot drift as your data and users evolve. Watch latency and cost per answer as closely as quality — they decide whether the assistant survives budget review.
The teams that succeed with RAG treat it as a retrieval and evaluation problem with a language model attached — not a language model with some search bolted on. Whether you're building an internal knowledge assistant or a customer-facing chatbot or virtual assistant, talk to us about taking your prototype to production.
Want help putting this into practice?
Talk to a senior engineer about your specific situation — no sales script.






Compliance-first delivery