tonytautai home/local-ai/private-ai/how-it-works/private-rag

./find --index ./archive

Searching Your Own Archive Without Indexing It Elsewhere.

Private rag architecture means the index of your documents, the retrieval step and the model that reads the passages all run on the premises. It is useful, it is overused, and it opens a door that needs locking.

Tony Tautai

private rag architecture

Retrieval-augmented generation is the fashionable way to make a model answer questions about your own documents: index the archive, find the relevant passages, hand them to the model with the question. Done in the cloud, it means your whole archive is now in someone else's index. Done on the premises, it is a reasonable tool with limits. This page is the last of the mechanics explained under the overview of how private ai works.

What Runs Where

private rag architecture

The index lives on the appliance, built from the documents in a folder you choose. The Find model does the retrieval: given a question, it returns the passages most likely to answer it, with their source file and page. A reading model then answers from those passages only. Nothing is sent out to build the index, and nothing is sent out to answer. The index is a second copy of your archive and is treated as such: same permissions, same backup, same retention.

Where It Helps

A law firm asking which of four hundred leases contains a break clause of a particular shape. An insurer looking for prior claims mentioning the same address. An accountancy checking whether a client's previous years' files mention a particular asset. Questions with a findable answer in a known set of documents. The output is the passage and its source, so the person checks the original rather than trusting a paraphrase.

Where It Leaks

private rag architecture

An index is queryable by anyone who can reach it, and a clever question can pull out a passage the asker was not meant to see. Permissions must be applied at retrieval time, per user, not just on the folder. We do that; many hobby setups do not. This is the door that what we wrote about ai data leakage prevention warns about, and it is the reason retrieval is not switched on by default in the layout described in what we wrote about private ai architecture.

Scoring Retrieval

Retrieval has its own failure mode: the right passage is not returned, and the model answers confidently from the wrong one. So we score Find separately, on a frozen set of questions with known source passages, with the same method as more on how to evaluate a private ai model. The model that reads the passages is specialised the way what we wrote about fine tune llm on private data describes and does not learn from your archive. It reads at run time; it does not train.

If you want a chat window over the whole company, this is not it. If you want to find the lease with the odd break clause before the deadline, it is.

private rag architecture

ssh [email protected]

Prove it on your documents.

Every engagement starts the same way: we run the system on a sample of your own files, under NDA/DPA, and hand you a written report with the scores, misses included. No commitment.

Test it on my documents Request a diagnostic