Glossary · AI & automation

Retrieval-augmented generation (RAG)

Retrieval-augmented generation (RAG) is a technique in which an AI system first searches a set of documents for passages relevant to a question, then gives those passages to a language model so the answer is based on that source material.

Also called: RAG · retrieval augmented generation · chat with your documents · AI knowledge base

Documents are split into short passages and converted into numerical representations called embeddings, which are stored in a vector database. When someone asks a question, the system finds the passages closest in meaning, adds them to the prompt, and asks the language model to answer using that text. A well-built system also shows which documents the answer came from.

A general AI model knows nothing about your price list, policies, or client files, and retraining a model on them is costly and slow. RAG lets a business use its own documents with an existing model and change the answers simply by updating the documents. Typical uses are an internal assistant for staff questions and a customer chatbot grounded in approved content.

RAG reduces invented answers but does not eliminate them, and it can only be as good as the documents behind it. Outdated or contradictory files produce bad answers. The system must respect permissions so staff cannot retrieve documents they are not allowed to open. Scanned PDFs and complex tables often need extra preparation. We build RAG assistants on cloud or self-hosted models, depending on how sensitive the data is.

Want this handled for you?

A free 15-minute call to understand what's slipping through the cracks. You'll leave with the department that fixes it first and what it costs, whether or not you work with us.

Remote team · US, UK, Canada, Australia, NZ and EuropeHire us on Upwork