Pointing an LLM at your own documents (RAG)
A common request is 'a ChatGPT that knows our internal docs'. That's RAG: simpler than often presented, and most of the work is in the retrieval half.
The most common AI request to land on an infrastructure team is some version of: “can we have a ChatGPT that knows our stuff?” Our runbooks, our wiki, our tickets, our contracts. It’s a reasonable ask, and it’s an established pattern. The demo is the easy 20%; whether the system is useful depends on the retrieval plumbing behind it.
The pattern has a name, RAG, and it’s worth understanding properly before you greenlight a project around it, because the failure modes live in details that vendor presentations rarely cover.
Training on your data is the wrong first step
This is usually the first question. You can fine-tune a model on your corpus, and it’s almost always the wrong first move. Fine-tuning teaches a model style and behaviour, not reliable facts: train a thousand documents into the weights and the model gets a vague, blurry sense of them, not a quotable memory, and it’ll still confidently make things up about the details. It’s also a rebuild every time a document changes, and changed documents are the norm, not the exception.
RAG sidesteps all of that. The model stays fixed; your data lives in a store you can update any time. Change a runbook, re-index that one file, done. The model reads the current text at question time instead of trying to remember a snapshot. For “answer from our documents”, retrieval beats memorisation almost every time.
How it works
Two halves. A slow one you do up front, and a fast one that runs per question.
The key component is the embedding.
So matching a question to the right chunk isn’t keyword search, it’s meaning search: embed the question, find the stored chunks whose vectors sit nearest, hand those over. This is what makes the demo work, and it is also where things go wrong without visible errors.
Retrieval decides the quality
The most important point for a project kickoff: the quality of a RAG system is almost entirely the quality of its retrieval, not its model. If the right chunk doesn’t make it into the prompt, no model answers correctly, it either says it doesn’t know, or worse, fills the gap with something plausible. The generation step is only as good as the retrieval feeding it. Where I’ve watched these projects struggle, it’s almost always retrieval, and almost always one of these:
- Chunking. Split documents too small and you sever the context a sentence needed; too large and you bury the relevant line in noise the model has to wade through. There’s no universal right size, and getting it wrong lowers answer quality with nothing in the logs to show for it.
- The corpus is inconsistent. Stale runbooks, three contradictory versions of the same policy, a wiki half of which is wrong. RAG will faithfully retrieve and cite your out-of-date document with total confidence. Wrong input produces wrong output, delivered confidently. RAG exposes documentation debt directly.
- Permissions. The instant your assistant can read “all company documents”, it can leak the salary spreadsheet or the security review to whoever asks. Retrieval has to respect who’s allowed to see what, per user, per query, and that’s real access-control engineering, not a checkbox. And an index of documents with personal data in it falls under the GDPR like the documents themselves.
- Tables, PDFs, images, diagrams. Half your real knowledge isn’t clean prose. Text extraction from a scanned PDF or a spreadsheet is a project of its own, and what the embedder never sees, retrieval can never find.
None of these are AI problems. They’re data, plumbing and access-control problems, the things an ops team already does well. The model is the easy, mostly-solved part you rent from an API. The data pipeline around it is the project, and it decides whether the system is worth it.
What it is good for, and what it isn’t
RAG shines
- "What does our policy say about X" over real docs
- Answers that quote and link the source
- Knowledge that changes often, re-index, don't retrain
- Cutting hallucination by grounding in real text
RAG struggles
- Questions needing the whole corpus at once, not a few snippets
- Counting, aggregating, "how many tickets mention…"
- Reasoning across many documents it didn't retrieve
- A messy or contradictory source, it'll cite the mess
The use case is narrow and real: look up the relevant passage and answer from it, with a citation you can click to check. That last part is the main advantage: a RAG answer can show its sources, which turns the model from an oracle you have to trust into a research assistant you can verify, exactly the posture that keeps an LLM in the right seat in your infrastructure.
Recommendation
If the requirement is “answer questions over our documents”, RAG is the right pattern, not fine-tuning, not waiting for a model big enough to memorise everything. But scope it realistically: budget for the retrieval and data work as the main project, treat the LLM as a rented commodity, and demand citations so every answer is checkable. Build it that way and it’s useful. Build it as “point a chatbot at the wiki and ship”, and you get a search bar that returns confident wrong answers. As elsewhere with this technology, the value lies in the discipline around it, and most of that discipline is plumbing you already know how to do.