Retrieval-augmented generation

Retrieval-augmented generation, or RAG, supplies a generative AI model with relevant information retrieved from a source collection when preparing a response.

Retrieval-augmented generation, commonly called RAG, connects generation with retrieved information. A system looks for relevant material in a source collection and supplies that material as context for an AI model's response.

For a business, the approach can help an assistant answer questions using approved documents, product information or internal guidance. It does not make every answer automatically correct; the quality of the sources, retrieval and final response still needs to be assessed.


Why use retrieval with generation?

A general model may not contain the specific or current information a business needs. Even if it has encountered a subject during training, that does not establish access to the organisation's latest approved material.

Retrieval provides relevant reference information at the time of the task. This creates a route for the response to use material selected from a maintained source collection.

The concept is useful when the answer depends on information that should be traceable and updated independently of the model itself.


How does a typical RAG workflow work?

A user asks a question. The system searches a collection, identifies potentially relevant passages and supplies selected material to the model along with instructions.

The model then prepares a response using that context. A surrounding application may add source references, validation or a review step.

Implementations vary. Some use simple retrieval, while others reformulate queries or reassess the selected evidence. More steps are justified only when they improve the task enough to support their additional complexity and cost.


What information can the system retrieve?

Sources might include product manuals, policy documents, service information, support articles or other approved records. The collection needs to suit the questions the system is expected to answer.

Availability alone is not enough. A folder containing years of conflicting documents may be less useful than a smaller collection with clear ownership and current versions.

Establish which sources are authoritative and how obsolete information is removed or marked. Retrieval quality begins with information management.


What are chunks and embeddings?

Large documents are often divided into smaller passages, sometimes called chunks, so the system can retrieve relevant parts without supplying every document in full.

Some retrieval methods use embeddings: numerical representations that support comparisons between the query and candidate material. Other methods use keyword matching, structured filters or combinations of approaches.

These are implementation choices. The practical test is whether the system retrieves the information needed to answer the question accurately and with enough context.


RAG versus fine-tuning

RAG supplies retrieved context during the task. Fine-tuning adapts a model through an additional training process. They address different needs and can sometimes be used together.

If the problem is access to changing reference information, retrieval may be worth investigating. If the problem concerns a particular behaviour or output pattern, the team may evaluate other approaches as well.

Avoid choosing between methods as a branding exercise. Define the problem and compare realistic implementations against the required outcome.


Does RAG prevent incorrect answers?

No. The system can retrieve the wrong passage, miss a necessary qualification or generate an answer that goes beyond the evidence.

A relevant source reference also does not prove that every statement is supported. The answer may cite a document while misrepresenting its meaning.

Evaluate both retrieval and generation. Ask whether the required information was found and whether the final response used it faithfully. Those are separate failure points.


Permissions and information boundaries

The retrieval layer should respect who is allowed to access the underlying information. A shared assistant must not make a restricted document available simply because it is present in the index.

Design access controls as part of the system. Establish how permissions are applied during retrieval and how changes to those permissions reach the source collection.

The same care applies to instructions found inside retrieved material. Reference documents should provide evidence; they should not silently gain authority to redirect the application's behaviour.


How do you test a RAG system?

Create questions that represent the intended work, including ordinary cases, ambiguous requests and questions the sources cannot answer.

For each case, identify the evidence a good answer would require. Then assess whether the retrieval found it, whether the response was accurate and whether uncertainty was handled appropriately.

Include conflicting and outdated material in the evaluation where those conditions are realistic. A demonstration using only well-prepared questions gives an incomplete picture of operational performance.


RAG and AI agents

An AI agent can use retrieval as one capability within a wider process. It might look up approved service information before preparing a summary or proposing an action.

Retrieval does not itself authorise the action. Reading a policy and changing a customer record are different operations with different boundaries.

Keep the responsibilities clear: source ownership, retrieval quality, answer evaluation and any subsequent tool use should each have an appropriate design.


What makes a good first project?

Choose a bounded set of questions and a maintained collection of sources. Define what the system should do when evidence is missing and who reviews performance.

Start with a task where accuracy can be checked. Expand only when the complete process, including maintenance and review, demonstrates useful results.

For the original research, see Lewis and colleagues' paper on retrieval-augmented generation. For a general introduction, see IBM's RAG overview. Explore Linford AI for the connection between information, workflow and implementation.

A practical example

Illustrative example: an internal assistant retrieves passages from an approved service handbook before answering a team member's question. It shows the supporting material and identifies when the handbook does not establish an answer. The team tests retrieval accuracy as well as the wording of the response.

Why it matters

RAG provides a way to connect generative systems with maintained reference information. Its value depends on source quality, appropriate access and evidence-based evaluation of the answers produced.

From understanding to action

Put the thinking to work.

Explore how websites, creative, advertising and AI can work together for your business.

Talk to Linford ↗
Privacy settings