Choosing a RAG Architecture: Naive, Advanced, CRAG, GraphRAG, Agentic
A practical comparison of six RAG architectures with pros, cons and use cases, plus a four-step decision path and the cases where RAG is the wrong tool.
This article is published in English.
Sources: How to Design a Production-Ready RAG System (Architecture + Tradeoffs)
Why RAG, and why one design isn't enough
AI agents are capable, yet they hallucinate and can't see specialized or real-time data on their own. Retrieval-Augmented Generation (RAG) addresses both by anchoring the agent's answers in a verified knowledge base. But RAG isn't a single recipe. Plain vector search is plenty for a basic FAQ bot and fails badly on complex reasoning or analysis that spans many documents. What follows covers the common RAG architectures and a decision path for choosing among them by task requirements.
What RAG does
RAG retrieves documents from a knowledge base and uses them to produce more relevant answers. The diagram below shows the flow from document storage through vector retrieval to LLM generation.
The core idea pairs information retrieval, which runs from storage to retrieval in the figure, with generative AI. Injecting relevant context into the prompt keeps a language model tied to real information. It can scan pages of domain-specific material in seconds, so the LLM answers a user's query accurately and quickly.
A typical workflow has two phases. The offline phase ingests raw data and prepares it as searchable, structured data. The online phase retrieves the relevant data and answers the query. A third phase is worth adding, a feedback loop in which retrieved context is evaluated over and over.
Phase 1: ingestion
The first phase turns raw files into structured, searchable records in a database:
- Load data from sources such as PDFs, Notion, SQL and Slack, with a tool like LlamaIndex or LangChain.
- Clean out noise like headers, footers and HTML tags.
- Chunk long documents into meaningful pieces, say 500 words each. Oversized chunks confuse the model, and undersized ones lose context.
- Embed each chunk with an embedding model (OpenAI's
text-embedding-3-small, for instance) to convert text into vectors. - Index the vectors in a vector database such as Pinecone or Chroma, enabling semantic search by meaning.
Phase 2: retrieval and generation
When a user asks something, this runs in milliseconds:
- Query transformation. The system turns the question, say "How do I reset my password?", into a vector with the same embedding model used in Phase 1.
- Retrieval. It searches the vector database for the 3 to 5 chunks mathematically closest to the question.
- Reranking. A reranker model double-checks the results so the best match sits on top.
- Augmentation. The retrieved chunks are packed into the LLM's prompt. A typical one tells the model it's a helpful assistant, hands it the chunks as context and then poses the question about resetting a password.
- Generation. The LLM reads prompt plus context and writes an answer grounded only in what it was given.
Phase 3: feedback
Retrieval results should be evaluated continuously to prevent hallucination. Evaluation scores whether an answer actually rested on the context, and observability shows exactly which chunk caused a wrong answer. Those findings feed back into fixing the chunking strategy from Phase 1.
Tools by phase
RAG tools are the building blocks linking your data to a language model, and they're categorized by the pipeline stage they serve. The right choice depends on which phase you're working on.
The table sorts the RAG tech stack by pipeline phase.
Is a vector database required?
Not strictly. A dedicated vector store isn't mandatory for building RAG, and two simpler routes exist. With a zero-DB approach, a handful of documents are chunked and held in RAM. That's fast, free and needs no setup, but memory is wiped on restart, and large documents are slow. A traditional database approach stores text chunks in something like PostgreSQL and runs rule-based keyword search. It's good at unique phrases such as a person's name or an ID, but it lacks semantic understanding: a user asking about "mammals" won't match a document that only says "dogs."
Six architectures compared
No single setup is right everywhere. Some tasks need speed and simplicity, others need deeper analysis, several sources or non-text inputs such as images or graphs. Six major designs cover most needs: Naive RAG, Advanced RAG, Modular RAG, Corrective RAG (CRAG), GraphRAG and Agentic RAG.
Naive RAG
The simplest form pulls documents based on the query and passes them to the model with no adjustments.
The diagram shows plain top-K vector similarity matching. The query becomes a vector, the top-K similar chunks come from a vector DB, and they go to the LLM. Search is semantic, and complexity is low.
- Strengths: it has the fastest responses and lowest compute cost, it's easy to set up with libraries like LangChain or LlamaIndex, and it works for basic fact retrieval from clean documents.
- Weaknesses: irrelevant chunks can add noise that confuses the LLM, it struggles with complex or multi-part questions, and it can't correct itself, so a retrieval miss turns into a hallucinated answer.
- Best for: simple Q&A over small, clean datasets, such as personal document Q&A, internal company FAQs and simple chat-with-your-document apps.
Advanced RAG
This variant adds logic such as query routing and reranking around the retrieval step for better accuracy.
The figure shows pre-retrieval query transformation and post-retrieval reranking. Before retrieval, the query is rewritten to be clearer. After retrieval, results are ranked and sanity-checked so the generated answer is as relevant and accurate as possible. Search is hybrid (vector plus keyword) with reranking, and complexity is medium.
- Strengths: it copes better with complex questions, picks suitable approaches for different situations and gives more control over generation.
- Weaknesses: reranking adds latency, several model calls per query raise costs, there are more moving parts to maintain, and the components need tuning to work well together.
- Best for: high-fidelity systems where mistakes aren't acceptable, like professional knowledge bases and customer support bots.
Modular RAG
Modular RAG uses a plug-and-play structure in which separate modules handle different parts of the workflow.
The highlighted components include Search and Memory modules. Splitting the system like this means any part can be customized with no rebuild of the rest: a team could drop in a different retriever, a stronger reranker or another generator. Retrieval can span multiple sources such as APIs, databases and the web, and complexity is high because it needs a sophisticated orchestration layer.
- Strengths: each component is easy to tune, and parts can be upgraded or replaced without starting over.
- Weaknesses: setup cost and architectural complexity are very high and demand upfront planning, a strong engineering team has to run the orchestration, and different module versions may clash.
- Best for: complex enterprise systems needing deep customization, such as an assistant that checks Jira, Slack and Google Drive simultaneously.
Corrective RAG (CRAG)
CRAG is built to double-check its answers and fix them when something is off.
The flow shows an evaluation step with fallback web search. An evaluator model scores the retrieved documents. When the score is too low, the system sets aside the internal DB and runs a web search to find the answer elsewhere, the dashed path in the figure. It's high in complexity because of logic-based branching and external API calls.
- Strengths: poor search results are fixed before a user sees them, and the extra quality-control layer makes responses more reliable and accurate.
- Weaknesses: the fallback search costs time and compute, and the system can loop endlessly if it's never satisfied with what it finds.
- Best for: high-stakes work where wrong or outdated information is unacceptable, such as medical and legal research.
GraphRAG
GraphRAG uses a knowledge graph to structure relationships between pieces of information and doesn't rely on text similarity alone.
The diagram shows knowledge graph traversal and community summary generation. After the graph is built, the system traverses it for patterns across data and not just word matches, so it can find how Entity A relates to Entity B even when they appear in different documents. Complexity is very high, since a structured graph database must be built and maintained.
A second figure, taken from a Microsoft Research illustration, shows an LLM-generated knowledge graph built on a private dataset with GPT-4 Turbo.
- Strengths: it handles complex questions that connect several concepts, avoids scattered answers, and can surface unexpected but relevant results by joining dots.
- Weaknesses: building the graph takes significant effort, it's slower than basic RAG, and its quality caps performance, because it's only as good as the connections in the graph.
- Best for: seeing the big picture and multi-hop reasoning across several data sources, as in investigative journalism and fraud detection or in drug discovery.
Agentic RAG
In this dynamic design, an AI agent acts as coordinator to plan, retrieve and refine the response.
The workflow shows a coordinating agent using tools for multi-step reasoning. Rather than grabbing the first relevant documents, it plans an approach, decides what to investigate and acts through its tools. It breaks the task into smaller steps, searches various data sources, checks whether the findings answer the query and keeps searching if they don't.
- Strengths: it suits multi-step reasoning, makes intelligent choices about gathering information and can improve results on complex queries.
- Weaknesses: multiple searches raise cost, and the research-style work slows responses.
- Best for: tasks needing methodical planning, such as comprehensive case analysis in legal research or financial analysis that combines market data with regulatory information.
A four-step decision path
No rule fits everything, but a common path helps with the task at hand.
The flowchart guides architects among Simple, Graph, Corrective and Advanced RAG based on task constraints. The steps:
Step 1, the complexity test. Is the answer inside a single document? If yes, No-DB RAG for a small document, or Simple RAG, is best, being fast, cheap and nearly effortless to build.
Step 2, the relationship test. Does answering require grasping deep hierarchies or hidden connections across several data sources? If so, GraphRAG maps those resources and links, which plain text search misses. Take "Which departments are affected by Policy A, and who are their managers?" It must join department data to employee data, and GraphRAG represents both as linked entities.
Step 3, the reliability and reasoning test. Can the system afford to be wrong? Where extreme precision matters, Corrective RAG or Self-RAG adds a dedicated step that checks whether retrieved data truly answers the question before it reaches the user. If such a task also needs multi-step reasoning, Agentic RAG brings planning and self-refinement through its agents.
Step 4, the performance versus cost trade-off. When latency is the priority, a simpler setup such as No-DB, Naive or Simple RAG works best. When quality outweighs cost, though not to the extreme precision of Step 3, Advanced RAG reads the intent behind a query better than simpler designs, at the price of more processing time.
When not to use RAG
RAG lets LLMs give context-aware answers from massive private datasets without constant retraining. It isn't universally useful, however, especially when a task depends on deep reasoning, creative synthesis or mastery of language patterns and not on looking up a document. These scenarios usually do better without it:
- Broad reasoning about common sense, ethical nuance or general human behavior. Rely on the pre-trained model's internalized weights.
- General knowledge queries about things unchanged for decades. The pre-trained model suffices, and RAG would add latency without adding accuracy.
- Creative writing with a specific tone and style. Use pre-trained models or fine-tuning, because RAG is overkill.
- Deep math or logic problems needing multi-step computation. Fine-tuning or Chain-of-Thought (CoT) prompting fits better.
- Extremely low-latency needs with near-instant responses. Embedding, searching and injecting all add overhead.
- Small datasets that fit entirely in the prompt. Pasting the data in beats building a pipeline.
The closing table compares performance across RAG, fine-tuning and reasoning models.