Production RAG for Enterprise Search: What to Evaluate Before You Ship
bicaralabs · PRODUCTION RAG EVALUATION FRAMEWORK
Enterprise search is a production system, not a demo prompt.
A retrieval-augmented generation (RAG) prototype can look convincing with a handful of clean documents and a few friendly questions. Production is different. Users ask incomplete questions. Source material changes. Permissions matter. Acronyms collide. A retriever returns something plausible but wrong. A model gives a fluent answer with a citation that does not support it.
The failure is rarely one component. It is the interaction between document processing, chunking, retrieval, prompting, model behavior, and change management.
Before you ship, build an evaluation practice that tests the whole path—not just whether a vector search returns similar text.
Why production RAG fails in enterprise settings
Enterprise knowledge is messy by default. Policies are revised. Product documentation has multiple versions. The same term can mean different things to Finance, Legal, and Engineering. A relevant answer may be split across a table, an appendix, and a document that was updated yesterday.
That creates several common failure modes:
- Stale context. The index contains an outdated policy or misses a recent change. The answer may be well written and still be operationally wrong.
- Bad chunk boundaries. A chunk starts halfway through a rule, loses a table heading, or separates an exception from the policy it qualifies. Retrieval finds a fragment, not the meaning.
- Weak retrieval. The system retrieves a semantically similar document instead of the authoritative one. This is especially common when terminology overlaps across teams.
- Ungrounded answers. The model fills gaps using general knowledge or inference that is not present in the retrieved evidence.
- Hallucinated citations. A citation can look credible while pointing to text that does not actually support the statement.
- Silent regressions. A prompt edit, embedding-model swap, parser upgrade, or index rebuild quietly lowers answer quality for a meaningful class of questions.
None of these problems are solved by choosing a single “best” model. A production RAG system needs measurable behavior, explicit ownership of source data, and a way to detect change before users do.
The minimum eval set: retrieval, grounding, answer quality, and refusal
Start with real questions. Pull anonymized examples from search logs, support tickets, internal help channels, and interviews with the teams who will use the system. Then add the questions that are rare but costly: policy exceptions, ambiguous acronyms, requests involving restricted information, and questions whose correct response is “I don’t know from the available sources.”
For each evaluation item, record more than a reference answer. Capture:
- The user question. Include the phrasing people actually use, not only polished test prompts.
- The expected source or sources. Identify the authoritative document, section, version, and—where applicable—access boundary.
- The expected answer behavior. Define what must be stated, what must not be inferred, and whether the system should ask a clarifying question or refuse.
- A scoring rubric. Keep it simple enough to apply consistently: correct, supported, complete enough, clear, and appropriately cautious.
Evaluate the pipeline at four levels.
1. Retrieval quality
Can the system return the evidence needed to answer the question? Measure whether the authoritative source appears in the top results, not merely whether a related document appears somewhere in the list. Review the retrieved chunks themselves. A correct document is not sufficient if the selected passage omits the condition that changes the answer.
2. Grounding
Does every material claim in the answer follow from the retrieved context? A grounded answer should distinguish between stated facts, reasonable synthesis, and information that is absent. Citation checks should test entailment: does the cited text support this exact claim?
3. Answer quality
A system can retrieve the right evidence and still produce an unusable answer. Score correctness, completeness, clarity, and actionability. For enterprise search, the best response is often concise: answer the question, show the relevant source, and flag any uncertainty or version limitation.
4. Refusal and safe fallback behavior
Test questions that should not receive a definitive answer. Examples include missing evidence, conflicting versions, ambiguous requests, and content outside the user’s permissions. The system should say what it can verify, identify what is missing, and guide the user to the next step. A confident guess is not a fallback.
Use automated checks where they are reliable, but keep human review for a representative sample. The goal is not to produce one magic score. It is to make failure visible by category so the engineering team knows what to fix.
Chunking choices that change retrieval behavior
Chunking is an engineering decision with direct product consequences.
Fixed-size chunks are easy to implement, but they can cut through headings, lists, tables, and exception clauses. Very small chunks may improve keyword precision while stripping away the context needed to interpret a rule. Very large chunks preserve context but can dilute relevance and consume the context window with material the model does not need.
Use document structure when it exists. Preserve headings with their body text. Keep list items with the policy or procedure they belong to. Treat tables carefully: retain headers, row labels, and nearby explanatory text so values keep their meaning. Store source metadata such as document title, section, version or update date, and access controls with every chunk.
Then test chunking against questions that expose boundary problems:
- Questions where the answer depends on an exception immediately after a general rule.
- Questions answered by a table, not a paragraph.
- Questions requiring two nearby sections to be considered together.
- Questions where an older document is semantically closer than the current authority.
There is no universal chunk size. Choose a strategy from observed retrieval and answer behavior in your corpus. Revisit it when the corpus, document formats, or user queries change.
Regression tests for prompts, indexes, and model swaps
Treat the evaluation set as a release gate.
Any change to parsing, chunking, embeddings, retrieval logic, reranking, prompts, model provider, model version, or indexing should run against the same benchmark before deployment. Compare aggregate scores, but do not stop there. Averages hide regressions. Segment results by document type, business domain, question type, ambiguity, and required refusal behavior.
A practical release review asks:
- Did authoritative retrieval decline for any critical query group?
- Did supported-answer rates fall after a prompt or model change?
- Are citations still attached to the claims they support?
- Did refusal behavior become overly permissive or overly conservative?
- Did latency, cost, or error handling change enough to affect the user experience?
Keep a small set of canary queries for high-risk workflows. Run them after index refreshes and monitor them in production. When a failure reaches a user, turn it into a new evaluation case with the relevant source and expected behavior. This turns incidents into coverage instead of recurring anecdotes.
Deployment checklist for a production RAG system
Before launch, make sure the following is true:
- Source ownership is clear. Every indexed system has an owner and a defined refresh process.
- Freshness is observable. You can see when content was last ingested, parsed, indexed, and made available for retrieval.
- Permissions are enforced before generation. Retrieval must respect the user’s access rights; the model should never receive content the user cannot access.
- Answers expose evidence. Users can inspect the source, section, and relevant context behind the response.
- The eval set covers real work. It includes normal questions, edge cases, ambiguous inputs, stale-content scenarios, and required refusals.
- Changes are gated. Prompts, indexes, and model changes are evaluated before rollout, with a rollback path.
- Monitoring is actionable. Track retrieval failures, unsupported answers, refusal patterns, latency, user feedback, and source freshness. Assign owners for investigating each signal.
- Feedback closes the loop. Give users a way to flag poor results and route those examples into triage and future regression tests.
The point of production RAG is not to make a chatbot sound informed. It is to help people find reliable answers in the systems they already depend on.
That requires disciplined evaluation, source-aware retrieval, and operational controls that let the system improve after launch. Build those in before you ship—not after confidence in a demo becomes a production incident.
Build a RAG system that can be operated
Bicara Labs builds production-ready AI systems in client infrastructure: working code, measurable behavior, and a clear path from deployment to iteration. If you are evaluating enterprise search or need to harden an existing RAG stack, we can help define the evaluation strategy and ship the system around it.
Talk to Bicara Labs for a 30-minute scoping call.
