Guides

Building RAG applications for production: from demo to pilot to live

By Abdul Asim ·

The short answer

Building LLM applications for production with retrieval augmented generation (RAG) comes down to one discipline. To move a RAG system from pilot to production, treat demo, pilot and live as three stages with written exit criteria, and only promote the system when every criterion has evidence behind it. Demo to pilot is about data and measured retrieval quality. Pilot to live is about everything around the model: permissions, latency and cost budgets, monitoring, rollback and a route to a human.

Most stuck pilots I review are not stuck because the model is weak. They are stuck because nobody agreed what "good enough to ship" means, so every meeting reopens the same debate. Gates turn that debate into a list of checks.

Demo, pilot, live: what each stage has to prove

Each stage has a different audience and a different question. A demo answers "can this work at all?" A pilot answers "does it work on our real data, for real users, at a quality we can measure?" Live answers "can we run it every day without surprises?"

StageWho uses itDataMust be true to move on
DemoThe team, a sponsorA hand-picked folderAnswers look right on a few questions
PilotA small group of real usersThe real sources, ingested by a repeatable pipelineRetrieval and answer quality measured on a real test set, citations on every answer, known gaps written down
LiveEveryone it was built forAll in-scope sources, refreshed on a schedulePermissions enforced, budgets set and alerted, monitoring on, rollback tested, escalation path working

The demo exit bar is deliberately low. The pilot and live bars are where the work is, so the rest of this guide covers those two gates.

Gate 1: from demo to pilot

A demo usually runs on a few clean files somebody uploaded by hand. A pilot has to run on the messy real sources, so the first gate is about ingestion and measurement.

Ingestion becomes a pipeline, not a script. Every source needs an owner, a refresh schedule and a parser that handles its worst documents. On the Applied Optoelectronics RFP workflow, the useful knowledge sat in technical PDFs, scanned material and prior RFPs, so extraction and OCR, then normalization and chunking, had to work before retrieval could be judged at all. On Permit Signal, 3 million New Jersey permit records and 60,000 properties from Socrata and ArcGIS had to be normalized and geocoded into PostGIS before a single question could be answered with location context. If you cannot rerun ingestion from scratch and get the same index, you are not ready for a pilot.

Retrieval is measured on a real test set. Collect 50 to 100 questions that real users asked or will ask, write down which source passage should answer each, and score whether retrieval returns it. Score the answers separately. Without that baseline you cannot tell whether a chunking change, a new embedding model or a reranker helped or hurt. My LLM evaluation guide covers how to build the set and write pass rules.

Every answer carries its citations. Pilot users need to check the system, and a cited answer is checkable. Permit Signal returns source-linked answers with map pins and exportable results, so a user can see which records sit behind a claim. Citations also make the test set cheaper to grade, because a reviewer can compare the answer to the cited passage instead of searching for it.

Known gaps are written down. List the question types the pilot does not handle yet. Pilot users forgive a stated limit; they do not forgive a confident wrong answer, which is the pattern described in AI hallucination.

Exit criteria for this gate: ingestion runs end to end from a command, the test set exists and has a baseline score, and every answer cites its sources.

Gate 2: from pilot to live

Passing the pilot proves the answers are good. The second gate proves the system is safe and affordable to run for everyone. This is where most of the engineering in a RAG deploy to production goes, and very little of it touches the prompt.

Permissions are enforced at retrieval time. If different users may see different documents, filter the search by the user's access before any passage reaches the model. Filtering the answer afterwards is too late, because the model has already read the restricted text. OWASP's LLM08:2025 Vector and Embedding Weaknesses names unauthorized access to embeddings and leakage between users in multi-tenant setups as risks, and recommends fine-grained access controls with permission-aware vector stores. Test it: add test cases where a user without access asks a question only the restricted document can answer, and require a refusal. If the index holds external content, add prompt injection cases too.

Latency and cost have budgets. Decide the target time to first token, the time to a complete answer and the cost per conversation, then measure the pilot against them. On RUBI, the McKissock purchase advisor, the project record shows about 10 seconds to first token and about 11 seconds to a complete answer over a knowledge base of more than 100,000 structured rows. Numbers like those only mean something against a budget the business agreed to, so write the budget down before launch and alert when a stage drifts past it.

Monitoring exists before launch day. Log each request with the question, retrieved sources, model and prompt version, latency per stage and outcome. On the McKissock AI sales assistant, requests are sent to New Relic so the team can see what is happening outside the chat window. The field list I use is in the RAG pipeline guide, which also covers what breaks after launch.

Rollback is tested, not assumed. Version the index, the prompt template, the model and the retrieval settings together, so you can return to the last known good combination in minutes. Release changes to a slice of traffic first. The Google SRE workbook's chapter on canarying releases treats a canary as a partial, time-limited deployment of a change followed by an evaluation of whether to proceed; it applies to a new index or prompt as much as to new code.

There is a route to a human. When retrieval comes back weak or the request is out of scope, the system should hand off instead of guessing. The McKissock assistant has a ticket-creation tool: when a request stays unresolved it creates a HubSpot support ticket, so the learner still gets a next step. On the Applied Optoelectronics workflow the human step is a review and export gate, so no generated draft leaves the proposal process without a person reading it.

Exit criteria for this gate: permission tests pass, budgets are set and alerted, dashboards show live traffic, a rollback has been rehearsed, and escalation has been triggered end to end at least once.

How do you check RAG production readiness?

Before the go-live meeting, ask for evidence on each of these, not opinions: 1. Can ingestion rebuild the whole index from the original sources without manual steps? 2. What is the retrieval and answer score on the current test set, and what was it last week? 3. Does every answer cite a source a user can open? 4. What happens when a user asks about a document they are not allowed to see? 5. What are the latency and cost budgets, and where are the alerts? 6. How long does a rollback take, and when was it last done? 7. What does the system do when it cannot answer, and who receives the handoff? 8. Who owns the test set, the sources and the on-call response after launch?

If any answer is "we think so" or "we will add that later", the system is still a pilot. Ship it to the pilot group with that gap named, and fix the gap before widening access.

Scaling RAG after launch

Going live is not the final gate. Scaling RAG to more sources, more users or more question types reopens Gate 1 for the new scope. New sources need their own parsers and owners. New question types need new test cases. A larger user base surfaces the long tail of questions the pilot never saw.

Two habits keep this manageable. First, rerun the full test set on every change to ingestion, chunking, embeddings, retrieval settings, prompt or model, and block the release if the score drops. Second, feed production back into the test set. RUBI records what buyers ask and where answers fall short, and that data drives a tuning loop. A failed live question becomes a test case, so the same failure cannot ship twice.

Retrieval design often has to change with scale. Pure vector search that was fine on a pilot folder can struggle with exact identifiers, places and structured fields. Both RUBI and Permit Signal ended up with hybrid retrieval: RUBI combines metadata filters, vector search and structured lookups, and Permit Signal combines spatial lookup, semantic search, BM25 and SQL. My guide to building a RAG pipeline covers those choices, and vector databases covers the storage side. For the serving, guardrail and release practices that apply to any LLM application, see how to deploy an LLM in production. When one fixed retrieval path stops being enough, agentic RAG lets the system choose a path per question, at the price of more latency and harder debugging.

When a pilot is stuck

A pilot that has run for months without a launch date usually has one missing gate: no test set, so nobody can prove quality; no permission model, so security will not sign off; or no budget, so finance cannot approve scale. Find the missing evidence and the decision usually unblocks. Governance teams ask for much of the same evidence, which is why AI governance is worth reading alongside this.

If your RAG pilot is live with a small group but stalled on the way to production, an AI App Review is a written review of retrieval, chunking, evals, cost and latency, with a prioritized fix list that maps onto these gates.

Key takeaways

  • Treat demo, pilot and live as stages with written exit criteria, and promote only on evidence.
  • Demo to pilot: a repeatable ingestion pipeline, a real test set with a baseline score, and citations on every answer.
  • Pilot to live: permissions enforced at retrieval time, latency and cost budgets with alerts, monitoring, a rehearsed rollback and a working human handoff.
  • Scaling reopens the first gate for every new source or question type, and production failures should become test cases.
  • A stalled pilot is usually missing one gate's evidence, not a better model.

Let's talk

Let's ship yours.

AI product, automation bottleneck, RAG use case, or operational workflow. Tell me what's slowing your team down, or what revenue you're leaving on the table.

Abdul Asim, AI / LLM Engineer