Three Paths to On-Prem Enterprise RAG and How to Evaluate Them
On-prem RAG for internal standards and manuals succeeds or fails on data processing and evaluation, not on which orchestration stack you pick. This article outlines three deployment paths, four processing decisions that drive quality, a four-metric eval baseline, and an operations checklist.
The hard part of on-prem RAG is not “wiring a model”
When enterprises want internal standards, manuals, and policies as a Q&A knowledge base, the first instinct is often to pick an orchestration framework. What actually determines production quality is the unglamorous work of data processing and evaluation. One reproducible engineering-spec knowledge-base example reported: top-5 retrieval hit rate 100% (down to the section), 95 of 96 Q&A items with correct citations, 19 of 19 engineering calculation questions correct, and raw documents to a serving state in one command in 26.1 seconds. Those numbers matter less as absolutes than as evidence that quality differences come mainly from processing strategy, not from the orchestration tool itself.
Three technical paths
Path 1: Build your own orchestration layer. Combine a general-purpose retrieval library and vector index, and assemble chunking, recall, reranking, generation, and citation backfill yourself. Maximum flexibility, including deep customization for hierarchical spec documents, but you own operations, upgrades, and access control.
Path 2: Privately deployed visual orchestration. Run it in containers and configure pipelines instead of coding them. Fits organizations that already have a clear document system and want a usable version quickly. Engineering requirement: configuration as code and one-click environment rebuild.
Path 3: Cloud-hosted retrieval and model services. Use generic capabilities (object storage for source documents, a container platform for services, logging and monitoring for observability), outsource non-core pieces, and keep the team on data processing. Generic cloud product categories from vendors such as Baidu AI Cloud can serve as the substrate for this pattern.
The three paths are not mutually exclusive. A common pattern is to validate quality on path 2, then freeze stable processing logic as path-1 in-house assets.
Four processing decisions that make or break quality
1. Chunk by section, not by fixed token count. For specs, the unit of value is the clause or section. Fixed 500-character chunks split a complete requirement and leave retrieval fragments semantically incomplete. Parse heading hierarchy, build a section tree, use the section as the smallest retrieval unit, and keep the document–chapter–section path.
2. Citations must resolve to the section. Answers need clickable locators, not only a filename. Write structured metadata at chunk time:
chunk = {"text": section_body,"meta": {"doc_id": "spec_001","doc_title": "Construction technical specification","chapter": "Chapter 5 Structural calculation","section": "5.3 Load combinations","anchor": "#sec-5-3",},}
At generation time, require the model to answer only from retrieved fragments and to attach citation numbers at the end of sentences; post-process those numbers back to anchor.
3. Hand calculations to code. Asking the model to mentally compute load combinations or reinforcement is a major source of error. A workable approach is tool calling: when the model detects a computation intent it emits structured parameters; a deterministic code module runs the math and returns results for the model to phrase. Sketch:
def answer(question, retriever, calculator):if calculator.is_computable(question):args = calculator.parse(question)return calculator.run(args) # result from code, not model guessworkhits = retriever.search(question, top_k=5)return generate(question, hits) # generation must carry citations
4. Explicit refusal outside the corpus. Bound the system in both the prompt and post-processing: if top similarity is below threshold, or the generated answer cannot be aligned to fragments, return that the material is not covered, plus a suggested document scope. Prefer fewer answers over fabrication—that is a hard line in enterprise settings.
Evaluate before you choose a stack
Do not judge a design on a handful of demo questions. Establish a baseline across four metric families:
- Retrieval: whether top-5 hits are exact to the section (chunking and recall);
- Citation: source correctness (metadata and backfill);
- Calculation: accuracy on deterministic problems (whether tool calling works);
- Refusal: correct-refusal rate and false-refusal rate on out-of-corpus questions.
The eval set should match real question distribution, ideally at least about a hundred items, and be re-run after every change to chunking or prompts so versions are comparable. That baseline is also a shared language with vendors: run eval on your own documents and questions first, then decide where to invest.
Operability is a first-class requirement
“One command, 26.1 seconds from documents to live” implies full engineering constraints: image-based delivery, config and documents mounted separately, idempotent re-entrant index builds, and a stateless environment that can be discarded and rebuilt. Put source documents and index artifacts in object storage and local volumes respectively, orchestrate services on a container platform, hook logs and alerts for recall quality and latency, and design incremental rebuilds for knowledge updates so full rebuilds do not interrupt service.
Selection checklist
- Do documents have a stable hierarchy that can be parsed to the section?
- Are per-clause, traceable citations required?
- What share of questions are computational, and is tool calling needed?
- Can data leave the intranet? That decides private vs. hosted form.
- Is there a re-runnable eval set and baseline?
- Can environment rebuild and incremental knowledge updates reach minute-scale?
The conclusion is direct: lock processing strategy and eval baselines before platform choice. Tools can be swapped; processing logic and evaluation assets are what you keep.
