Guide
Enterprise RAG: answers with the source cited and per-document permissions
RAG is the technique that lets an AI answer from your company's documents instead of from what it learned on the internet. This guide explains how it works, what goes wrong in a real company and how TENGWAR handles it.
What RAG is
RAG stands for retrieval-augmented generation. Instead of asking a language model to answer from memory, a RAG system does two things:
- Retrieves: it searches your documents for the passages that deal with the question.
- Generates: it hands those passages to the model, which writes the answer from them.
The result is an answer based on your documents, which can state which document and page each fact comes from. The model does not need to have been trained on your information: it reads it at the moment of answering.
How it works, step by step
When a document is added
Every document you upload to TENGWAR goes through a 17-phase process. In short:
- Its structure is detected and the text extracted. Scanned documents go through optical character recognition (OCR).
- Images, tables and charts are described so they can be found too.
- It is translated when needed and split into passages with their context.
- Each passage is indexed in two ways: by meaning and by exact words.
When a question is asked
- The question is prepared: rephrased, or split if it is complex.
- The search runs at once by meaning, by exact words and over a knowledge graph built from the facts extracted from your documents.
- The results are fused and re-ranked to keep the most relevant passages.
- The model writes the answer from those passages, and the citations are aligned with what it actually used, including the page.
The three problems of RAG in a company
Building a RAG demo is easy. Making it serve a whole company means solving three things:
Permissions
If every passage sits in the same index, a search can hand an intern a paragraph from a management document. In TENGWAR permissions apply inside the search: the access level and department of the person asking filter what is retrieved, and before any evidence reaches the answer the system checks again that the person may open the document. More in the security section.
Real documents
A company's documents are not clean text: there are scanned PDFs, spreadsheets, slides, mail and drawings. TENGWAR learns 24 formats, including scanned ones, and checks that each document has been indexed properly before accepting it.
Citations you can check
An answer with no source asks for blind trust. TENGWAR states the document and page behind each fact and lets you open it to verify before relying on it.
RAG versus training a model or uploading files to a chat
| Approach | How it uses your information | Limitation |
|---|---|---|
| Uploading files to a cloud assistant | Files are attached to a project or conversation | File limits per project, and the documents leave your company |
| Training or fine-tuning a model | The information is baked into the model's weights | Costly, must be repeated when documents change, and it does not cite the source |
| RAG | The information is searched at the moment of answering | Depends on the quality of search and ingestion |
RAG is the right approach when documents change, there are many of them and you need to know where each answer comes from.
RAG on your own server
A RAG system can run in the cloud or at your premises. In TENGWAR the whole process happens on servers in your office: ingestion, indexes, search and the model that writes. Your documents and questions are not sent to any cloud AI.
Depending on the edition, it learns up to 3, 6 or 9 TB of documents. To understand what running it at your premises involves, continue with what on-premise AI is; for which data leaves and which does not, see security and data.
Frequently asked questions
- Does RAG stop the AI from making mistakes?
It reduces them, because the model answers from passages of your documents rather than from memory, but it does not remove them. That is why citations matter: each fact carries its document and page so you can check it.
- Do I have to train a model on my documents?
No. With RAG, documents are indexed and consulted at the moment of answering. Adding, changing or deleting a document does not require retraining anything.
- Does it work with scanned documents?
Yes. Scanned documents go through optical character recognition, and TENGWAR checks that the extracted text covers the document before accepting it.
- How many documents can it handle?
Up to 9 TB depending on the edition: 3 TB in TENGWAR, 6 TB in Pro and 9 TB in Max, in 24 formats.
Shall we try it with your documents?
We prepare a private demo with your use case, at your office or remotely. No commitment.
