Building an On-Premise RAG Platform for Regulated Documents

A professional services firm wanted its associates to stop guessing which precedent applied. The rule was absolute: no client document, no query and no answer may reach a third-party model.

Client withheld under NDA. The sector, the shape of the engagement and the constraints are described; no client data, screens, names or volumes are reproduced.

Snapshot
Client
Professional services firm, Hong Kong and Singapore
Sector
Legal and advisory
Engagement
Architecture, build, evaluation, handover
Scope
Ingestion · chunking policy · on-premise index · cited answers · access control · evaluation set
Duration
11 weeks
Status
Running on the firm’s own hardware
0
documents, queries or answers that leave the firm’s network.
41k
documents indexed in the first corpus: precedents, opinions, closed matters.
1
citation required before an answer is shown. No citation, no answer.
6
weeks from kick-off to the first answer an associate trusted enough to use.

Problem

The firm already had search. It returned documents, ranked by a relevance score nobody understood, and the associate did the reading. What they wanted was an answer with a source, produced in seconds, over material that must never leave the building.

Every hosted option was excluded in the first meeting, and correctly: a client matter is not a training corpus. That left an on-premise stack, which is a slower and less forgiving way to build — and the only way to build this one.

Figure 1 — From a closed matter to an answer with a citation

Corpuswhat the firm already ownsIngestionmatters, precedents, opinionsChunkingby clause, not by pageIndexvectors and metadata, on-premRetrievalfiltered before it ranksAnswercited, or refusedwhat each step producesAccess checkwho may read this matterClause unitthe citable objectMetadatamatter, date, court, authorTop-kre-ranked by recencyCitationpage and paragraphwhy it worksAccess is applied before retrieval,not after. A document the reader maynot open is never a candidate, sothe answer cannot leak what thesearch already knew.Chunking by clause rather than by page was the single decision that made answers usable: a page of a judgment is not anargument, and half a clause is worse than no clause.

Approach

We built the evaluation set before the system. Two hundred questions with known answers, written by the people who would use it, including the ones designed to fail: questions about a matter they had no access to, questions whose answer was three documents deep, and questions with no answer in the corpus at all.

That last category turned out to matter most. A retrieval system that cannot say “not in the corpus” is worse than a search box, because it produces a confident paragraph with a citation that does not support it. The refusal path was built as a feature, tested as one, and tuned until it fired on the unanswerable set rather than on the merely difficult.

Figure 2 — Each control has a place in the delivery and a way to be checked

DesignBuildTestAuditPermission before retrievalCitation on every answerRefusal on an empty corpusNo outbound calls at runtimePrompt and corpus versioneddecidedbuilttestedsampleddecidedbuilttestedsampleddecidedbuilttestedsampleddecidedbuiltverifiedsampleddecidedbuilttestedsampleddecided → built → tested → sampled: nothing is claimed without a check.

What it costs to keep

An on-premise system has no vendor to blame. The index has to be rebuilt when the corpus changes, the model has to be upgraded deliberately, and someone has to own the evaluation set as a living document rather than a delivery artefact.

So the handover was half the project: runbooks for the rebuild, a versioned prompt, and a quarterly re-run of the evaluation set with the results filed next to the last one. A system like this does not stay correct on its own; it stays correct because someone is paid to check.

What we delivered

Ingestion
Clause-level chunking
Documents split by clause and paragraph, with the source coordinates kept for citation.
Index
On-premise vectors
Embeddings and metadata resident on the firm’s hardware, rebuilt on a schedule.
Access
Filter before rank
Matter permissions applied to the candidate set, so an unauthorised document is never retrieved.
Answer
Cited or refused
Every answer carries page and paragraph, or the system says the corpus does not contain it.
Evaluation
200 known questions
Written by users, including unanswerable ones; re-run quarterly and filed.
Handover
Runbook and versioning
Rebuild procedure, prompt version history, and an owner named for each.

What it changed

Associates stopped searching and started checking. That sounds like a small difference and it is the whole point: the system proposes the paragraph and the citation, and the lawyer’s time goes into judging whether it applies rather than finding it.

The refusal path earned more trust than any accurate answer did. A tool that says it does not know, in a domain where being wrong is expensive, is a tool people keep using after the novelty has gone.

CONTACT US

We provide a custom made service for just drop us a line.
We would be glad to have feedback from you.