Machine Learning

Retrieval-Augmented Generation: A Practical Guide

How RAG grounds language models in your own knowledge — and the design choices that decide whether it works.

IAICB Editorial TeamInsights & Research
Published 1 min read
A long aisle between rows of metal server racks in a data centre

Large language models know a great deal, but not your policies, products or latest data. Retrieval-augmented generation (RAG) bridges that gap by searching a knowledge source at query time and passing the most relevant passages to the model along with the question.

How the pipeline works

  • Ingest — documents are cleaned, split into chunks and enriched with metadata.
  • Index — chunks are embedded as vectors and stored, often alongside a keyword index.
  • Retrieve — the user's question is used to find the most relevant chunks.
  • Generate — the model answers using the retrieved context, ideally with citations.
A RAG pipeline: ingest, index, retrieve and generate.

Design choices that matter

Chunking

Chunks that are too small lose context; chunks that are too large dilute relevance. Splitting along the document's natural structure — sections and headings — usually beats fixed character counts.

Combining semantic vector search with keyword search catches both paraphrased questions and exact terms such as product codes or policy numbers.

Re-ranking

A second-stage re-ranker can reorder candidate passages for relevance, improving precision without enlarging the context.

Key takeaways

  1. RAG retrieves relevant documents and supplies them to the model as context.
  2. Retrieval quality usually matters more than model choice.
  3. Chunking, metadata and hybrid search are high-leverage design decisions.
  4. Evaluate retrieval and generation separately.
RAGLLMsEngineering
IAICB Editorial Team

Insights & Research at the International AI Certification Board, publishing independent analysis for AI professionals and leaders.

Keep reading
All blog posts
AI Governance & Ethics

The EU AI Act: What Professionals Need to Know Now

The EU AI Act sorts AI systems by risk and assigns obligations accordingly. Here's how the framework works and what to do about it today.

2 min read
IAICB Standards Desk