top of page

Private RAG on Your Own Hardware: Eight Objections, Answered

Writer: Srihari Maddula
Srihari Maddula
2 hours ago
16 min read
A rack of servers in a server room
Photo: Kevin Ache on Unsplash

A new engineer at a pump manufacturer has a simple question: what tightening torque did the company approve for the flange bolts on the 2019 revision of a particular pump casing? The answer exists. It is in a deviation approval, scanned as a PDF, sitting in a folder on a shared drive next to forty thousand other files. The engineer who signed it retired last year. Finding it will take the new engineer most of an afternoon, if he finds it at all.

Six months ago the company tried a cloud chatbot on a sample of its documents. The demonstration was impressive. Then the legal team read the terms, the information security team asked where the documents would be stored, and a customer contract turned up with a clause about sharing technical data with third parties. The pilot stopped.

So the question in the room now is different. Can the same idea, retrieval-augmented generation, usually shortened to RAG, run entirely inside the building, on a server the company owns, and still be good enough to use?

For most engineering and compliance documents, yes. The condition is that you treat retrieval as the product and the language model as the writer. A system that finds the right three paragraphs and hands them to a modest model, with an instruction to answer only from them and cite them, will beat a much larger model that is left to remember. The rest of this post takes the eight objections that engineering, IT and compliance teams raise, in roughly the order they raise them, and answers each with what we know and what we measured.


What RAG Is, in One Paragraph

A RAG system has two halves. The first half runs once and then whenever documents change: it extracts text from the files, splits it into passages called chunks, computes a numeric representation of each chunk called an embedding, and stores the chunks, their embeddings, a keyword index and their access permissions. The second half runs for every question: it searches for the chunks most relevant to the question, filters out anything the user is not allowed to see, optionally re-ranks the survivors with a more careful model, and passes the best few to a language model with instructions to answer from them and cite them.

Component

Job

Runs where

Typical size for a mid-sized document set

Text extraction and OCR

Turn PDFs, scans and Office files into clean text

CPU, batch

Hours for a first pass over tens of thousands of files

Chunker

Split text into passages with overlap

CPU

Negligible

Embedding model

Turn each chunk and each question into a vector

GPU or CPU

A model of a few hundred million parameters

Keyword index

Exact-term search for part numbers, codes and names

CPU, disk

A few gigabytes at most

Vector index

Similarity search over embeddings

RAM, CPU or GPU

Gigabytes for a million chunks

Re-ranker

Re-score the top few dozen candidates carefully

GPU

A model similar in size to the embedder

Language model

Write the answer from the retrieved passages

GPU

The largest single cost in memory

Permission store

Who may see which document

Existing directory

Synced from what you already have

Every one of those components has mature open-source options that run without an internet connection. The engineering is in joining them well, not in inventing any of them.


Objection 1: Our Documents Are Too Messy for This to Work

This is the most common objection and the most justified. Real document stores contain scanned pages, tables that span pages, drawings with text in title blocks, emails with the important line buried in a reply, and the same specification in seven revisions with no clear marker of which is current.

The answer is that messiness is a retrieval problem, and it is solved in extraction and indexing, not in the language model. Four steps carry most of the weight.

Extract properly. Run OCR on scans, keep table structure where the extraction tool can preserve it, and pull the title block from drawings as structured fields: drawing number, revision, date, approver. A drawing indexed only as its picture is invisible to search.

Attach metadata to every chunk. Document type, revision, date, project, product family and owner. A question about the 2019 revision can then be filtered to 2019 documents before any similarity search runs.

Handle revisions explicitly. Mark superseded documents, and by default search only current ones, with an option to include history. Many wrong answers come from a superseded revision that happened to match the question better.

Chunk with overlap and context. A chunk of a hundred to a few hundred words, overlapping its neighbours, with the document title and section heading prepended, keeps a table row or a requirement together with the context that gives it meaning.

The language model cannot fix bad extraction. If the right paragraph never reaches it, a larger model only writes a more confident wrong answer.

Plan for the first month of any project to be mostly extraction work. It is unglamorous, and it decides the outcome.


Objection 2: A Model Small Enough to Run Locally Will Make Things Up

Language models produce fluent text whether or not they know the answer, and smaller models tend to do so more readily. The objection assumes the model is being asked to answer from memory. In a RAG system it is not.

Three design rules keep a local model honest.

Answer only from the retrieved passages. The prompt says so, and the system checks it: every sentence in the answer should be traceable to a cited passage.

Cite every claim. Each answer lists the document, revision and page or section it drew on, as links the user can open. An engineer who sees the citation can verify the torque value in seconds; one who sees an uncited number has to search anyway.

Allow "not found". When retrieval returns nothing relevant above a threshold, the system says it could not find the answer and shows the closest documents. A system that always answers is a system that sometimes invents.

With these rules the job of the model is reading comprehension and summarisation over a few paragraphs, which current open models of moderate size do well. The quality ceiling is set by retrieval. Spend the hardware budget accordingly: a mid-sized model with excellent retrieval beats a large model with poor retrieval on this kind of work.


Objection 3: Search Will Be Worse Than What We Get From Google

Engineering questions are full of exact identifiers: part numbers, drawing numbers, clause references, supplier codes. Pure semantic search, which matches meaning rather than words, is good at "what is our policy on vendor audits" and surprisingly poor at "PN0417 torque". Keyword search is the reverse.

The answer is to use both. Hybrid retrieval runs a keyword search, typically the BM25 ranking function, and a vector search side by side, merges the results, and passes the top candidates to a re-ranker. The authors of BGE-M3, a widely used open embedding model, recommend exactly this pipeline: hybrid retrieval plus re-ranking, with BM25 alongside embedding retrieval as the classic example.

BGE-M3 is also a useful reference point for what an on-premise embedder can do. It supports more than 100 working languages and handles inputs from short sentences up to long documents of 8,192 tokens. It produces 1,024-dimensional vectors and is released under the MIT licence, so it can be deployed inside a company without a licence negotiation. For Indian organisations with documents in English and one or more Indian languages, multilingual retrieval is not a luxury.

Query type

Keyword search

Semantic search

Hybrid with re-ranking

Exact part or drawing number

Strong

Weak

Strong

Paraphrased question

Weak

Strong

Strong

Mixed: "torque for PN0417 flange"

Partial

Partial

Strong

Question in Hindi or Telugu about English documents

Fails

Works with a multilingual embedder

Works

Abbreviations and internal jargon

Strong if the jargon is in the text

Variable

Strong

Use keyword and semantic search together, then re-rank. Part numbers need exact matching, and questions need meaning; a system with only one of them fails half your users.

Questions in Telugu, Answers From English Manuals

Many Indian plants run on two languages at once. The manuals, drawings and quality records are in English; the technicians on the floor think and often type in Telugu, Hindi, Tamil or Marathi; and the supervisors move between both in the same sentence. A document assistant that only works in English excludes the people who would use it most.

Multilingual embedding models change this. Because a model such as BGE-M3 maps text from many languages into the same vector space, a question typed in Telugu can retrieve the English paragraph that answers it, without translating the archive. The keyword half of hybrid search still works on the English part numbers and codes inside the question, which technicians usually type in English anyway.

The answer itself is a separate choice. A language model that writes well in the user's language can answer in Telugu while citing the English source, or the system can answer in English and offer a translation. Test both with real users before choosing; plant teams often prefer the technical terms to stay in English even when the sentence around them does not.

Three cautions apply. Transliterated text, Telugu written in Latin letters, is common in chat and harder for every model; include it in the test set. OCR on Indian-language scans is weaker than on English, so archives of regional-language documents need extra extraction effort. And the test set must include questions in each language you intend to support, or the first complaint will come from the floor, not the office.


Objection 4: Access Control Cannot Be Enforced Inside a Chatbot

The fear is concrete. A finance document, an HR investigation or a customer's confidential drawing ends up in an answer to someone who should never have seen it. In a cloud system this is a vendor configuration question. On-premise it is an engineering requirement, and there is a simple rule that removes most of the risk: filter before you rank.

Every chunk carries the access groups of its source document, synchronised from the directory and file permissions the company already maintains. At query time, the system first restricts the candidate set to chunks the user may see, then searches and ranks within that set. Nothing the user cannot see ever reaches the re-ranker or the language model, so nothing can leak into an answer.

The opposite design, ranking everything and filtering the results afterwards, leaks in subtle ways. The language model may have seen a restricted chunk in an earlier step, a summary may combine restricted and permitted material, and the count of filtered results can itself reveal that a document exists.

Three operational details matter as much as the rule. Synchronise permissions on a schedule and on change, so a revoked user loses access within minutes, not at the next weekly rebuild. Log every query, the user, and the chunks returned, so an audit can show who saw what. And test it: the retrieval core shown later includes a test in which a user from one group asks for a fact held only in another group's documents, and the system must not return it.


Objection 5: It Needs a Data Centre

It needs a server, not a data centre. The memory arithmetic is straightforward.

The vector store holds one embedding per chunk. A document set of 50,000 pages at about 400 words per page, cut into chunks of 120 words with 30 words of overlap, gives about 222,000 chunks. Embedding memory is chunks times dimensions times bytes per value.

Chunks

Dimensions

32-bit floats

8-bit quantised

100,000

1,024

0.41 GB

0.10 GB

1,000,000

1,024

4.10 GB

1.02 GB

1,000,000

384

1.54 GB

0.38 GB

10,000,000

1,024

40.96 GB

10.24 GB

For most companies' document sets the vector store fits comfortably in the RAM of an ordinary server. Ten million chunks, which is a very large engineering archive, still fits in memory at 8-bit precision.

The language model is the larger cost. Our post on local LLM hardware works through that sizing in detail; the short version is that model weights at 4-bit or 8-bit precision, plus the working memory for the context window and concurrent users, set the GPU memory you need. A single server with one or two data-centre GPUs serves a department-sized user base for this kind of workload. The embedding model and re-ranker can share the same GPU or run on the CPU at lower throughput.


Objection 6: It Will Be Too Slow for Real Use

A user waiting at a screen will tolerate a few seconds if the answer is right and cited. The time budget splits into four parts, and the table gives planning ranges for a single on-premise server. They are estimates to plan against, not measurements of a particular system; measure your own in the pilot.

Step

What happens

Planning range

Embed the question

One short pass through the embedding model

Tens of milliseconds

Hybrid search and permission filter

Keyword and vector search over the permitted set

Tens to a few hundred milliseconds

Re-rank the top candidates

Re-score a few dozen passages

A few hundred milliseconds

Generate the answer

Write a few hundred tokens from a few thousand tokens of context

Several seconds, depending on model size and load

Generation dominates. Two practical measures keep it acceptable: stream the answer so the user sees the first words within a second or two, and keep the retrieved context tight, three to six passages rather than twenty. More context makes the model slower and, past a point, less accurate, because the relevant sentence is harder to find among irrelevant ones.


Objection 7: We Cannot Tell Whether It Is Right

A system nobody can evaluate will be judged on anecdotes, usually the worst one. The fix is a test set built before the pilot starts.

Collect a hundred to two hundred real questions from the people who will use the system, each with the document and passage that answers it. Include the hard cases: questions about superseded revisions, questions whose answer is "not found", and questions a given user should not be able to answer because of permissions. Then measure three things separately.

Retrieval. Is the answering passage among the top five retrieved? This is recall at five, and it is the number to improve first.

Faithfulness. Is every claim in the answer supported by a cited passage? Check by sampling, or with a second model as a judge, verified by a person on a subset.

Permissions. For every question tagged as restricted, the answer must not contain the restricted fact. This test has one acceptable score.

Build the test set before the system. Retrieval recall, answer faithfulness and permission leaks are three different numbers, and only the first one improves by tuning search.

Rerun the test set whenever extraction, chunking, models or prompts change. It turns arguments about whether the system "feels better" into a number on a chart.


Objection 8: A Cloud Service Would Be Cheaper

Sometimes it would. For a small team with non-sensitive documents and modest usage, a cloud service needs no hardware, no operations and no upgrades, and its per-query cost is low. If the documents may legally and contractually leave the building, the cloud is often the right first step.

The balance shifts in three situations. The first is when the documents may not leave: customer contracts that restrict sharing technical data, defence or government work, health records, or internal policy. India's Digital Personal Data Protection Act, 2023 adds obligations wherever personal data is involved, and many enterprises now prefer to keep such data on systems they control. The second is steady, heavy usage, where a server running all day costs less over three years than the equivalent volume of cloud calls; our post on building, buying or renting an on-premise AI server works through that comparison. The third is latency and availability inside a plant or campus with an unreliable internet link.

The honest comparison includes the costs people forget on the on-premise side: someone to run the server, patch it, back it up and update the models, and the electricity and cooling. Write those down next to the cloud invoice before deciding.


What Goes Wrong in the First Month

The pattern of early failures is consistent enough to plan for. The table lists the ones that appear most often in document assistants, what the user sees, and where the fix lives.

Failure

What the user sees

Usual cause

Where to fix it

Right document, wrong revision

A confident answer that was true three years ago

Superseded documents indexed as current

Revision metadata and default filters

Table values garbled

Numbers attached to the wrong row

Table flattened to text during extraction

Table-aware extraction, chunk by row with headers

Part number not found

"I could not find this" for a part that exists

Vector-only search; identifier split by the tokenizer

Keyword index in a hybrid search

Answer mixes two documents

A blend of two procedures that matches neither

Too many retrieved passages from different sources

Fewer passages, re-ranking, cite per sentence

Scanned pages invisible

Whole folders never appear in results

Images indexed without OCR

OCR pass with a quality check

Slow first answer of the day

A long wait after the server was idle

Models unloaded from GPU memory

Keep models resident; warm-up on start

Almost every early failure is in extraction, metadata or retrieval. Before changing the model, find the passage that should have been retrieved and ask why it was not.

The quickest diagnostic is the one most teams skip: for each failed question, look up the passage that contains the answer and check whether it was in the top twenty candidates. If it was not, the problem is extraction or search. If it was but the answer was still wrong, the problem is re-ranking, context size or the prompt. Those two branches need different people and different fixes.


The Retrieval Core in Code

The retrieval core, without the models, is small enough to read. The script below implements chunking with overlap, a BM25 keyword index and a search that applies permissions before ranking. It was run against a synthetic archive of 400 documents of about 600 words each across three access groups, each document hiding one fact such as a torque limit for a part number.

def chunk(text, size=120, overlap=30):
    w = text.split(); out = []; i = 0
    while i < len(w):
        out.append(" ".join(w[i:i + size])); i += size - overlap
    return out

def search(index, meta, query, user_groups, k=5):
    # permission filter BEFORE ranking: restricted chunks never reach the ranker
    allowed = [i for i, m in enumerate(meta) if m["group"] in user_groups]
    return sorted(allowed, key=lambda i: -index.score(query, i))[:k]

def embedding_store_gb(n_chunks, dim, bytes_per=4):
    return n_chunks * dim * bytes_per / 1e9

The archive produced 2,800 chunks. For 120 questions of the form "what is the torque limit for PN0417", the answering document was in the top five results every time, with no result from a group the user did not belong to. A user from the HR group who asked for a fact held only in a finance document did not get it.

That perfect score belongs to a synthetic test with exact identifiers in every question, which is the case keyword search handles best. Real questions are paraphrased, misspelt and ambiguous, which is why the production system adds a dense embedder and a re-ranker, and why the real test set matters more than this one. What the script does show is the structure: permissions enforced at the candidate stage, and retrieval measured as its own number.


Running It After Go-Live

A private RAG system is a service, not a project, and it needs a small amount of steady care.

Documents change every day, so indexing must be incremental: new and changed files are extracted and indexed within hours, deleted files are removed, and permission changes are applied on their own faster schedule. A full rebuild once a month catches anything the incremental path missed.

Models change every few months. Treat a new embedding model as a migration, because every stored vector must be recomputed with the new model; keep the old index serving until the new one passes the test set. A new language model is easier to swap, but it still goes through the test set before users see it.

The service needs the same monitoring as any internal application, plus a few measures specific to retrieval.

Measure

Why it matters

Review

Queries per day and per user group

Adoption, and where to invest next

Weekly

Share of answers with "not found"

Gaps in the document set or in extraction

Weekly

Citations opened per answer

Whether users verify, and which sources they trust

Monthly

Test-set recall and faithfulness

Regression after any change

After every change, and monthly

Indexing lag

How stale the newest answers can be

Daily alert if over the target

Permission sync lag

How long a revoked user keeps access

Daily alert if over the target

The people cost is modest but real: an owner for the document set, a part-time engineer for the pipeline and the server, and a habit of reviewing the "not found" questions with the teams that ask them. That review is where the system improves fastest, because each unanswered question points at a missing document, a bad scan or a term the users say differently from the way the manuals write it.


A Pilot in Six Weeks

A focused pilot proves or disproves the idea for one department without committing the whole company.

  1. Week 1: choose and collect. Pick one document set with clear owners, such as quality records or engineering change notes, and collect a test set of real questions with their answers.

  2. Week 2: extract. Run text extraction and OCR, pull metadata and title-block fields, mark superseded revisions, and inspect a sample of the output by hand.

  3. Week 3: index and search. Build the keyword and vector indexes with permissions attached, and measure recall at five on the test set. Improve chunking and metadata until it stops rising.

  4. Week 4: generate. Add the re-ranker and the language model with the answer-only-from-sources prompt and citations. Measure faithfulness on a sample.

  5. Week 5: users. Give ten real users access, log every question and every citation they open, and collect the questions that failed.

  6. Week 6: decide. Review the three numbers, the failed questions and the operating effort, and decide whether to extend, change the document set, or stop.

The decision at week six should rest on the test numbers and the logged usage, not on a demonstration.


When a Private RAG Is the Wrong Tool

Some problems look like a RAG problem and are not.

If the answer lives in a database, such as stock levels, order status or test results in a laboratory system, query the database. A language model can help turn a question into a query, but searching documents for numbers that a system already holds in structured form is slower and less reliable.

If the documents are few and stable, a well-organised folder with a good search index may be enough, and costs almost nothing to run.

If nobody owns the document set, the system will decay. Retrieval quality falls as documents go stale and permissions drift, and without an owner nobody notices until the answers are wrong.

And if the organisation cannot run a server, through lack of people, power or space, a private deployment will fail for operational reasons. A managed private deployment, or a cloud service under a suitable agreement for non-sensitive material, is the better start.


Back to the Flange Bolts

The engineer's question has an answer in a scanned deviation approval from 2019. A private RAG system that extracted that scan properly, attached its drawing number and revision, indexed the part number for exact search and filtered by the engineer's access rights would return the passage in a second or two, with a link to the page and the approver's name. The language model's contribution would be one sentence summarising it.


That is the right expectation to set. The value of the system is not a model that knows the company. It is a search that finally finds what the company already wrote down, inside the building, for the people allowed to read it.

EurthTech is an engineering-first product design and embedded systems company with a development center in Hyderabad. To discuss a project, write to connect@eurthtech.com or see https://www.eurthtech.com/case-studies.

Comments


EurthTech delivers AI-powered embedded systems, IoT product engineering, and smart infrastructure solutions to transform cities, enterprises, and industries with innovation and precision.

Factory:

Plot No: 41,
ALEAP Industrial Estate, Suramapalli,
Vijayawada,

India - 521212.

  • Linkedin
  • Twitter
  • Youtube
  • Facebook
  • Instagram

 

© 2025 by Eurth Techtronics Pvt Ltd.

 

Development Center:

4th Floor, Krishna towers, 100 Feet Rd, Madhapur, Hyderabad, Telangana 500081

Menu

|

Accesibility Statement

bottom of page