1. Home /
  2. Insights /
  3. RAG
RAG · LLM · Practical guide

What is RAG? A practical guide to retrieval-augmented generation for businesses

Retrieval-augmented generation, or RAG, lets a large language model answer from your own documents instead of only what it learned in training. It is the most practical way to put AI to work on company knowledge: manuals, policies, contracts, product catalogues and service information. This guide explains how it works and what makes a RAG system reliable.

Devonetics · Updated 18 November 2026 · 3 min read

The problem RAG solves

A language model only knows what was in its training data. It does not know your prices, your internal procedures or the contract you signed last month, and when it does not know, it may produce a confident wrong answer. Retraining a model every time your documents change is slow and expensive.

RAG solves this by looking up the right information at the moment a question is asked. The model stays the same; what changes is the context it is given for each question.

How RAG works, step by step

  • Prepare: your documents are split into small passages (chunks) and each one is converted into a vector, a numerical representation of its meaning.
  • Store: the vectors are stored in a vector index, for example PostgreSQL with pgvector, along with metadata such as the source document and date.
  • Retrieve: when a user asks a question, the question is also turned into a vector and the most relevant passages are found.
  • Generate: the model receives the question together with those passages and writes an answer based on them, ideally citing the source.

A simple example

Imagine a clinic’s service list contains a page about a laser treatment: what it is, how many sessions are usually needed and how to prepare. A caller asks, in Arabic, how to prepare for the treatment.

The RAG system converts the question into a vector, finds the passage about preparation for that treatment, and gives it to the model with the question. The model replies in Arabic using that passage. If the clinic later changes its preparation advice, it edits the document, and the next answer reflects the change without retraining anything.

What makes a RAG system good

Most of the quality comes from engineering around the model, not the model itself.

  • Chunking: passages must keep related information together. Splitting a table or a procedure in the middle produces incomplete answers.
  • Metadata: tagging each chunk with its document, type, department and date lets you filter results and show sources.
  • Hybrid retrieval: combining keyword search with vector search finds both exact terms, such as product codes, and passages with similar meaning.
  • Grounded prompts: the model is instructed to answer only from the retrieved passages and to say clearly when the answer is not there.
  • Access control: users should only retrieve passages from documents they are allowed to see.
  • Evaluation: a set of real questions with known answers, run after every change, shows whether quality is improving or slipping.

Where RAG is used

  • AI receptionists and chat agents that answer from a company’s own service information, in Arabic or English.
  • Internal assistants that answer staff questions from policies, procedures and manuals.
  • Private, on-premises assistants for government and regulated organizations.
  • Search over contracts, tenders and technical documentation.

Our RAG work in production

Our AI receptionist for a beauty clinic in the UAE uses RAG over the clinic’s own service information to explain treatments and book appointments in Arabic. For a government organization in Saudi Arabia we built RAG inside a fully air-gapped private LLM, with around 50 documents indexed and mapped with pgvector metadata.

RAG or fine-tuning?

Use RAG when answers must come from documents that change. Use fine-tuning when the model needs to adopt your domain’s language, format or behaviour. Many strong systems use both: fine-tuning for style and domain, RAG for facts. The Saudi Arabia system above combines the two.

How to start a RAG project

  • Choose one use case with a clear owner, for example answering staff questions about HR policies or callers’ questions about services.
  • Collect the documents for that use case and remove outdated or duplicate versions.
  • Write 30 to 50 real questions with the correct answers, to measure quality from day one.
  • Build a first version, test it against those questions, and fix the weakest answers at the source.
  • Put it in front of a small group of users, then expand.

Frequently asked questions

Does RAG need a private LLM?

No. RAG works with cloud models and with private models. If your documents are confidential, combine RAG with a private LLM so nothing leaves your environment.

Which database do you use for RAG?

Often PostgreSQL with pgvector, which keeps vectors and metadata next to your existing data. The right choice depends on your volume and infrastructure.

Can RAG work with Arabic documents?

Yes. Retrieval and generation can work in Arabic, as in the Arabic-speaking AI receptionist we run for a clinic in the UAE.

How many documents can a RAG system handle?

From a few dozen to many thousands. What matters more than the count is how well the documents are prepared, chunked and tagged.

Will RAG stop the model from making things up?

It greatly reduces it, as long as the prompts require answers to come from the retrieved passages and the system says when the answer is not in the documents.

More insights

AI agents · Clinics · UAE AI receptionist for clinics in the UAE: how it answers calls in Arabic and books appointments How an Arabic-speaking AI receptionist answers every clinic call, explains treatments from your own information and books the appointment. Real UAE example. Read the guide → Private LLM · Data security · Saudi Arabia & UAE Private LLM vs ChatGPT: when confidential data should never leave your environment When public AI tools are fine and when a private LLM on your own servers is the right choice for confidential or regulated data. Real Saudi Arabia example. Read the guide → Data engineering · SAP · Power BI Connecting SAP to Power BI without manual exports SAP to Power BI without manual exports: pipelines that bring SAP and third-party data into one current reporting source, refreshed every 5 minutes to daily. Read the guide →

Have a problem like this?

Build your solution design in a few clicks and get a free review, or talk it through with us on a free 30-minute call.