← All explainers
Explainer

RAG: Search Results Added to an AI Model’s Input

4 min read Reviewed
A lamp lights two pages on a shelf of binders, and they arc into the 'Input' tray of a machine labelled 'Model', beside a card asking 'How many days can I work abroad?'. The machine prints: 'Up to 15 days a year, with manager approval.'

Key takeaways

  • RAG (retrieval-augmented generation) retrieves relevant information from sources outside the model, such as company documents, and adds it to the model's input so the model can use it in its response.
  • In a common setup, a search returns the passages it ranks as most relevant, and copies of those passages, not the whole collection, go into the model's input for that request. The ranking can be wrong.
  • RAG can reduce hallucinations, but it doesn't guarantee a correct answer or make outdated documents current, and access permissions have to be enforced before retrieved content reaches the model.
  • Our recommendation: judge a tool you connect yourself and a tool you buy the same way: how it gets, updates and restricts company information, and whether you can check an answer against its sources.

Looked up, then handed to the model

Retrieval-augmented generation (RAG) is a technique that retrieves relevant information from sources outside the model and adds it to the model’s input, so the model can use it in its response. Outside the model means supplied separately from its training: company documents, a database or the web. It lets a model use company information when it answers, without retraining it whenever that information changes.

The name lists the three moves: retrieve, augment (add to the input), generate. One use is an assistant that answers employees’ questions from the company’s own policies.

What reaches the model

Here’s a common setup for company documents. Ahead of time, the documents are split into passages and prepared for search, and the searchable copy has to be updated when a document changes. When an employee asks how many days a year they can work abroad, the search returns the passages it ranks as most relevant, by meaning, by matching words, or both. That ranking can be wrong.

Copies of those passages go into the model’s input with the question. The model’s context window limits what it can handle in one request, input and answer together. In this setup, retrieval selects passages instead of sending the whole collection, which also cuts how much the model processes. The model writes its response from its input and what it learned in training, and the response can include references to the passages, which still need checking.

If an important passage is left out, the model can’t consult it in that call.

RAG adds search results to the model's input. Illustrative example of how RAG adds search results to the model's input, starting from your question: how many days can I work abroad? The question goes to a search step, which ranks passages from the company documents. The documents are shown as six passages: expense claims are due within 30 days, the office closes on public holidays, book all travel through the portal, lock your screen when you step away, and two passages about working abroad, marked in blue as the ones the search returned: work abroad up to 15 days a year, and work abroad: manager must approve. An arrow says only the returned passages are copied into the input. The model's input for this call holds your question, which also runs straight there, and the two returned passages, marked in orange as the search results added to the input. An arrow leads to the model, which writes the answer from its input and what it learned in training. The answer: up to 15 days a year, with your manager's approval, with references 1 and 2 to the two returned passages. A note says references, where a system shows them, still need checking. RAG adds search results to the model's input. Illustrative example. Your question How many days can I work abroad? Search ranks passages in the company documents Company documents, as passages Blue: the passages the search returned. Expense claims are due within 30 days. Work abroad: up to 15 days a year. [1] The office closes on public holidays. Work abroad: manager must approve. [2] Book all travel through the portal. Lock your screen when you step away. only these two are copied The model's input, this call Orange: search results added to the input. How many days can I work abroad? Work abroad: up to 15 days a year. [1] Work abroad: manager must approve. [2] The model writes the answer from its input and what it learned in training The answer Up to 15 days a year, with your manager's approval. [1] [2] [1] [2]: the two returned passages References, where shown, still need checking.
Of this collection, only the two returned passages are in the model's input for this call.

Think of a briefing pack: before a meeting, an assistant pulls a few pages from the company files that look relevant and puts them on your desk, and you answer with those pages in front of you, plus what you already know.

What the video shows. The video presents this text in motion, with music and sound effects and no speech.

The video opens on "RAG adds search results to the model's input." and "Here's a common setup for company documents." The company documents, split into passages, appear as six short lines: "Expense claims are due within 30 days.", "Work abroad: up to 15 days a year.", "The office closes on public holidays.", "Work abroad: manager must approve.", "Book all travel through the portal." and "Lock your screen when you step away." Separately, the model appears with its input, empty at first and labelled "The model's input: what it's given for this answer". Then the question: "How many days can I work abroad?"

An arrow carries the question to a search step that "ranks passages in the company documents". The search marks the two passages about working abroad, as the definition begins: "Retrieval-augmented generation (RAG) is a technique that retrieves relevant information from sources outside the model". The question goes into the model's input. Copies of the two marked passages follow it and turn orange there, while the originals stay in the documents with the other four: "only these two are copied". The definition ends: "and adds it to the model's input, so the model can use it in its response."

Then the model, now labelled "The model writes the answer" and "from its input and what it learned in training", writes the answer a word at a time: "Up to 15 days a year, with your manager's approval." The video ends on the opening line and the A-Eye Level logo.

More ways to search, the same limits

The idea is the same, but retrieval has moved on. Providers’ own write-ups from 2025 and 2026 describe systems that break a question into several searches, and systems that let the model ask for more information while it works. These can gather context for harder questions, but the extra searching can take longer, and the simple setup remains an option.

In every form, the search can pick the wrong passages or miss important ones, and even with the right ones the model can still answer wrongly. That’s where the briefing pack misleads: in the simple setup nobody goes back for a missing page, and the pages alone don’t show that nothing important was left out.

Fine-tuning alone isn’t RAG: it changes the model through further training on your documents rather than retrieving information for a response, though a system can use both. Nor is pasting a document into a chat yourself, a fine option when it fits in one request, though fitting doesn’t mean every detail gets used reliably.

RAG can reduce hallucinations, but it doesn’t guarantee a correct answer or make outdated documents current, so someone has to maintain the sources. And the system has to enforce each person’s access permissions before retrieved content reaches the model.

Two policies, one outdated answer

In a hypothetical 140-person logistics company, the HR assistant’s collection holds last year’s remote-work policy, which allowed 30 days abroad, and this year’s, which cut it to 15. The search returns the old one, and the answer says 30 days, with a reference, in the same confident tone as every other answer.

One control sits outside the model: when a policy is replaced, an owner in HR retires the old version in the system the assistant searches, not just on the shared drive, then asks the assistant the same question to confirm the new rule comes back. That deals with the superseded policy once the update has gone through, but not with the old limit repeated in another document, a search that returns the wrong section of the current policy, or a misreading. So the reference with each answer matters: it lets the employee, or HR, check.

Connect or buy, one set of questions

Our recommendation: a bought tool may use RAG too, so judge “connect our documents” and “buy a tool that knows our business” by the same questions, below: how each gets, updates and restricts company information, and whether you can check an answer against its sources. Then test before you rely on it, with questions whose answers you know, some worded differently from the documents, one the documents can’t answer, one with an outdated version in play, and one asked by someone without access. Decide up front what passing means: answers supported by the current documents, nothing shown to the wrong person, and a plain “the passages I received don’t answer that” when they don’t. What belongs in the collection at all is a separate call, about what’s worth keeping.

Ask these before the demo

  1. Where does each tool’s knowledge of our business come from: its training, what it’s given directly (an attached file, say), or what it retrieves, and from which sources?
  2. Who owns each connected collection, and how do superseded versions leave its searchable copy?
  3. Does retrieval enforce each person’s access permissions?
  4. Can we open the cited passages and check that they support the answer?

Questions this explainer gets

Is RAG the same as training a model on our documents?

No. Fine-tuning alone changes the model itself through further training, while RAG retrieves information when it's needed and adds it to the model's input, and a system can use both.

If an AI tool uses RAG, are its answers correct?

Not necessarily. The search can miss the right passage or return an outdated one, and even with the right passage the model can answer wrongly. References to the passages make answers easier to check, and they still need checking.