Skip to content
Anton GoncharovAI systems developer

1 minute read

RAG: how AI answers from your documents

RAG: how AI answers from your documents

RAG is a way to give the model the knowledge it needs at the moment of the question, without retraining it.

Imagine an employee who doesn’t keep the company’s entire archive in their head. Before answering, they quickly find a few relevant pages, read them and draw a conclusion. RAG works the same way: the question is turned into a “fingerprint of meaning”, similar document fragments are found by it, and then they’re added to the model’s request.

In practice this is how knowledge base bots are built: on instructions, regulations, product documentation, support conversations. The model doesn’t just get the command “know everything about the company” — it’s shown specific excerpts it can rely on.

The main limitation: RAG doesn’t make the model smarter and doesn’t fix bad sources. If the search brought the wrong fragment, the document is outdated or the answer needs data from several places, you’ll get a confident but weak answer. RAG quality usually depends not on the model but on how the documents are prepared and searched.

Discuss in the channel
RAG: how AI answers from your documents — Anton Goncharov’s blog