# What is RAG (retrieval-augmented generation)? — QANATONE

> RAG lets a language model find and read the relevant documents before it answers, so the answer rests on current information you control.

Kaynak: https://www.qanatone.com/en/nedir/rag-nedir/

---

[Explainers](https://www.qanatone.com/en/nedir/)

# What is RAG (retrieval-augmented generation)?

12 Sep 2026 2 min read Architecture · RAG

RAG lets a language model find and read the relevant documents before it answers, so the answer rests on current information you control.

## What is RAG?

RAG stands for retrieval-augmented generation. What a language model knows is limited to its training data. It cannot know a regulation published after training, your company's internal procedures or today's stock levels. RAG closes that gap: when a question comes in, the relevant documents are found first, and the model writes its answer by reading them.

Think of a closed book exam versus an open book exam. A model without RAG answers from memory; a model with RAG has the right pages open in front of it.

## How does it work?

- Preparation: documents (PDFs, web pages, support records) are split into small chunks, each chunk is turned into an [embedding](https://www.qanatone.com/en/nedir/embedding-nedir/) vector and stored in a [vector database](https://www.qanatone.com/en/nedir/vektor-veritabani-nedir/).

- Retrieval: the user's question is embedded too, and the chunks closest in meaning are found.

- Generation: the retrieved chunks are given to the model along with the question. The model answers from them and can show which document each part came from.

## Why use it?

With RAG a model can work with company knowledge that was never in its training data. When documents change, answers change with them, without retraining. Because each answer rests on a document, it can be checked, and the risk of [hallucination](https://www.qanatone.com/en/nedir/halusinasyon-nedir/) goes down. It goes down but does not disappear: if retrieval brings back the wrong passage, the answer can still be wrong.

## RAG or fine-tuning?

If the model needs knowledge (products, prices, policies), RAG is usually the right tool, because you only update documents as things change. If you want to change the model's behavior (a specific writing style or a fixed output format), [fine-tuning](https://www.qanatone.com/en/nedir/fine-tuning-nedir/) may fit better. Many systems use both.

## Building a good RAG system

Most of the quality is decided at the retrieval step. Chunks that are too small lose context, chunks that are too large fill the [context window](https://www.qanatone.com/en/nedir/context-window-nedir/) with noise. Combining vector search with keyword search (hybrid search) and re-ranking the results with a second model noticeably improve accuracy. Testing the system regularly with real user questions is the most reliable way to see where the wrong document comes back.

An assistant that works from your own documents is also a core part of an [AI agent](https://www.qanatone.com/en/hizmetler/ai-ajan/) setup.

## More articles

[Core Concept · AI ### What is artificial intelligence and how does it work? 12 Sep 2026 · 5 min](https://www.qanatone.com/en/nedir/yapay-zeka-nedir/)[QANATONE · Brand ### What is a qanat? The water channel behind our name 23 Sep 2026 · 2 min](https://www.qanatone.com/en/nedir/qanat-nedir/)[Applications · AI Agent ### What is an AI agent? 15 Sep 2026 · 2 min](https://www.qanatone.com/en/nedir/ai-agent-nedir/)[Architecture · Memory ### What is memory in AI assistants and agents? 15 Sep 2026 · 2 min](https://www.qanatone.com/en/nedir/ai-memory-nedir/)[Core Concept · Context Window ### What is a context window in AI? 15 Sep 2026 · 2 min](https://www.qanatone.com/en/nedir/context-window-nedir/)[Business · Digitalization ### What is digitalization? How it differs from transformation 15 Sep 2026 · 1 min](https://www.qanatone.com/en/nedir/dijitallesme-ne-demek/)[Web · Cookies ### What is a cookie on a website? 15 Sep 2026 · 2 min](https://www.qanatone.com/en/nedir/cerez-nedir/)[Guide · AI Tools ### Which is the best AI? A guide to choosing the right tool 15 Sep 2026 · 2 min](https://www.qanatone.com/en/nedir/en-iyi-yapay-zeka/)
