Home
GLOSSARY
Retrieval-Augmented Generation (RAG)

Retrieval-Augmented Generation (RAG)

IN ONE LINE

Retrieval-augmented generation (RAG) is a technique where an AI model looks up relevant information from your own data before answering, so its answers are grounded in your content.

What is Retrieval-Augmented Generation (RAG)?

RAG combines a search step with a large language model. When a user asks a question, the system retrieves the most relevant passages from a knowledge source (documents, a database, a help centre) and gives them to the model along with the question, so the answer is based on that material.

Why it matters

LLMs on their own don't know your company's data and can make things up. RAG lets you build assistants and search tools that answer from your own, up-to-date content, and can cite sources, without the cost of training a custom model.

How it works

Content is split into chunks, turned into embeddings and stored in a vector database. At question time, the query is embedded too, the closest chunks are retrieved (often combined with keyword search and re-ranking), and the model writes an answer using them. Evals check accuracy over time.

Common mistakes

  • Poor chunking that splits answers across fragments.
  • No evaluation, so nobody knows how often answers are wrong.
  • Ignoring permissions, so users see documents they shouldn't.
  • Stuffing too much context into the prompt, which raises cost and lowers quality.

How Dev Monks approaches it

Dev Monks builds RAG systems as part of AI product development: data preparation, retrieval tuning, permission-aware search, source citations, evals and cost monitoring, so the assistant stays accurate once real users rely on it.

FAQs

Is RAG better than fine-tuning?

For answering from your own changing data, RAG is usually the better first choice. Fine-tuning suits changing style or behaviour.

Can RAG work with private documents?

Yes, with access controls so each user only retrieves what they are allowed to see.

Related terms

Need help with this? See our AI Product Development service.