Skip to content
kenjtecJournal
Search the Journal

RAG explained: how an AI gets access to your own knowledge

A correct source can seem wrong because of an awkward text boundary. With three short rules, RAG can be examined traceably from retrieval to answer.

From a sheet, Hanne cuts a narrow strip and a wide piece that holds two fields together. AI illustration.

“Material may be taken.” The sentence really is in the handbook. The exception for sealed packages follows directly after it, but does not end up in the retrieved piece of text. An AI can formulate a clean, sourced answer from the first sentence and still lose the decisive condition.

RAG combines search and answer: passages from a collection that match the question are selected and provided as context. This does not automatically change the model weights. The relevant technology begins before the answer is written, with the ingestion, splitting and selection of the material.

Four steps and four possible points of failure

First, the content of a file has to be available in a usable form. It is then split into sections. A search index helps to find sections that match the question. Finally, a model formulates an answer using this selected material. An error at the start does not disappear just because the last sentence sounds particularly convincing.

The Open WebUI documentation describes, among other things, text splitting, overlap and re-indexing. Existing knowledge documents keep their previous splitting until they are re-indexed. A changed setting is therefore not yet proof that the search index has already changed.

Build a tiny collection with known answers

Create three text files of your own with stable identifiers. The first describes taking material and its exception. The second distinguishes guests from team members. The third explains the difference between current and archived documents. The source can be deliberately selected local files or content exported from a system such as Nextcloud; providing the files and AI search remain separate steps.

K01 Material
Material may be taken.
Sealed packages require approval beforehand.

K02 Access
Guests check in at reception.
Team members use their own access.

K03 Archive
Current documents are kept in the working folder.
Archived versions are kept only for traceability.

Write down four questions with their expected basis: What applies to sealed packages? How do guests check in? Which version is current? Where is the reception’s phone number? The last piece of information is deliberately missing. This gives you a genuine unknown case alongside three answerable questions.

In an existing RAG tool, start with this small collection. Save or display the pieces of text actually retrieved before you judge the finished answer. If the exception is already missing there, the splitting or selection should be examined first. Rewording the answer prompt cannot reliably make up for a missing source.

Changing text boundaries deliberately

Compare two manageable variants: a splitting in which rule and exception end up separated, and one that keeps both together. Note the sections actually produced. A mere setting with an appealing name does not yet tell you where your own text was really cut.

Overlap can preserve neighbouring context but creates additional repeated content. Very large sections, on the other hand, can bring along a lot of irrelevant material. This example therefore does not yield a universal ideal section size.

When comparing, keep all the other steps the same. If extraction, embedding model and prompt change at the same time, a changed answer can hardly be attributed to a single cause. A small collection makes exactly this observation easier.

Re-indexing and re-importing are different

Open WebUI names a particularly practical limit for re-indexing: it works with the text that has already been extracted and does not open the original file again. A different extraction method therefore does not automatically change old document content. For genuinely new processing, the affected files must be added again following the documented procedure.

This distinction helps with troubleshooting. If a table row is already missing from the extracted text, a different chunk size is not the first lever. If the exception is present but retrieved separately, that concerns a later stage.

A good answer to the four test questions names its basis, keeps restrictions and leaves the missing phone number open. The test does not measure general RAG quality. It makes the chain understandable: ingest the source, preserve context, find the right passage and only then answer from it.

Sources and status

Sources as of 25 October 2026. Retrieval Augmented Generation — Chunking and re-indexing.

Hamburg is our starting point.

The useful part travels with you.

Practical AI from Hamburg, explained for everyone.

Saved articles