Learn about AI · RAG

How do you give an AI access to your company's documents?

Why not just train the AI on the documents?

It is the first question most people ask, and the answer is practical: training is expensive, slow and hard to keep current. Train a model on your procedures in March and it will not know that section 4.2 changed in April. It also cannot tell you where an answer came from, and it misremembers the way a colleague does who read the document six months ago.

Looking things up solves all three problems. The document is the source every time, so a correction takes effect at once. The answer can point to the page it came from. And the model does not have to remember anything; it only has to read well and write clearly, which is what it is good at.

How it works, step by step

  1. Question

    An employee types the question the way they would ask a colleague.

  2. Retrieval

    The system finds the 3–8 passages in your documents that resemble the question most.

  3. Reading

    The language model gets the question and those passages, not the whole archive.

  4. Answer with source

    It writes the answer and points to the document and section.

RAG in one picture: look up first, write afterwards.

The retrieval step is not ordinary text search. The documents are split into passages in advance and turned into rows of numbers that describe what each passage means. The question is turned into numbers the same way, and the system picks the passages whose meaning sits closest. That is why it finds the answer when a pharmacy technician types "can we dispense this without a prescription" and the procedure says "over the counter". The technique behind it is called embeddings; it gets its own explainer.

An example: a pharmacy with four branches

Take a pharmacy with four branches and about 40 staff. The procedure manual runs to a couple of hundred pages: dispensing, substitution, dose dispensing, cold-chain goods, what to do with a prescription from another EU country. On top of that come supplier agreements, campaign terms, and the e-mails from the health authority that everyone has read and nobody can find again.

A new technician on a Saturday shift gets a question about substituting a product that is on back order. Without a lookup tool the options are leafing through the manual, calling the pharmacist, or guessing. With RAG she types the question the way she would ask it and gets a four-line answer: which rules apply, what the procedure says about back orders specifically, and a link to the section so she can read it herself before dispensing.

  1. The documents go in one place

    Procedures, agreements and authority e-mails go into one folder structure with an owner per area. Old versions are cleared out. It is the largest part of the work, and work the pharmacy owed itself anyway.

  2. Access follows roles

    Pay agreements and personnel files are not included. What only the pharmacist may see, only the pharmacist can ask about. The rules are the ones already on the file share; they are reused.

  3. 30 real questions as the test

    Before anyone gets access, the tool is tested on 30 everyday questions with a pharmacist as the judge. That exposes bad documents as well as bad answers, and it is cheaper to find them here than on a Saturday shift.

  4. The answer always shows its source

    An answer without a reference is not shown. If the documents do not cover the question, the tool says so instead of making something up.

The gain is not that the AI knows something the pharmacist doesn't. It is that the answer is there in half a minute, on a Saturday at two o'clock as well, and that it points to the procedure that applies today.

What RAG is good at, and what it is not

Good at

  • Questions that have an answer in a document: what does the procedure say, what is in the contract, how do we do this
  • Keeping answers current: fix the document and the answer fixes itself
  • Showing the source, so the employee can check
  • Large document sets that nobody can hold in their head

Not good at

  • Questions that need arithmetic or comparison across many documents
  • Documents that contradict each other; it will not pick the right one for you
  • Badly scanned PDFs and photos of text, until they have been made readable
  • Knowledge that only exists in people's heads; it cannot look up what was never written down

What it takes on your side

  • Documents in a readable format: Word, PDFs with text, a wiki, e-mails. Paper and scans go through text recognition first.
  • An owner of the document set. Otherwise the tool answers from outdated versions and trust is gone within three weeks.
  • Clear access rules: who may ask about what. You usually have them on the file share or intranet already, and they can be reused.
  • Somewhere to run it: in the cloud with a European provider, or on a server you control if the documents may not leave the building.
  • A test set of 20–30 real questions with known answers. It is run again every time something changes.

Common misunderstandings

What we hearHow it actually works
The AI memorises our documentsNo. It looks them up every time a question is asked. Remove a document and the answers from it disappear.
So it can answer anything about the companyIt can answer what is written down. What only lives in your experienced people's heads has to be written down first.
Our data gets sent to the USThat depends on where the model runs. It can run with a European provider or on your own server.
We have to train a modelNo. Standard models read and write well enough. The work is in the documents and in the retrieval.
It's just a better search boxThe retrieval is a better search. The difference is that you get a finished answer with a source instead of a list of documents.

What we would advise against

We would advise against starting with the whole archive. Pick one area where the questions are many and the documents are good, and let the tool prove itself there. We would also advise against switching off the source references because answers look tidier without them. The reference is the reason staff dare to trust the tool.

Frequently asked questions

How long does it take to set up?

The tool itself can be ready in a few weeks. What takes time is cleaning up the documents and settling the access rules, and that work is needed regardless.

Can it read our old scanned documents?

Yes, once they have been through text recognition (OCR). The quality of the answers follows the quality of the scan.

What happens when we correct a document?

The new version is indexed and the answers follow it. There is no retraining.

Could staff end up seeing something they shouldn't?

Not if access is built properly. Retrieval only happens in the documents each person is allowed to see, and that is one of the things we test before anyone gets access.

Is RAG the same as ChatGPT?

ChatGPT is a language model with a chat on top. RAG is the way you give a language model access to your documents. The two can be combined, but don't have to be.

Want help getting from explanation to practice?

Have a no-obligation chat with us about where it makes sense to start. We reply within 24 hours.