Naive RAG
Single retrieval path. Best for a first baseline and easy debugging.
Concepts
Each RAG type changes how the system retrieves, reasons, verifies, or compresses knowledge before answering.
RAG type selection should follow the failure mode. If a simple vector lookup works, keep it simple. If retrieval misses context, use query enhancement or fusion. If answers are unsupported, use self-checking or corrective patterns. If documents are long, preserve parent context.
| Need | Choose | Reason |
|---|---|---|
| First working baseline | Naive RAG | Simple, fast, easy to debug. |
| Production support bot | Advanced RAG | Adds quality controls around retrieval. |
| Complex tool-using tasks | Agentic RAG | Uses LangGraph to plan retrieval, query rewriting, direct answering, and approved tool use. |
| Long documents | Parent-Child RAG | Small chunks retrieve, larger parent passages answer. |
| Cross-document analysis | GraphRAG | Uses relationships, entities, and communities. |
| Ambiguous questions | Multi-Query RAG or RAG-Fusion | Searches multiple phrasings. |
| Strict grounding | Self-RAG or Corrective RAG | Grades retrieved evidence, checks answer support, or uses approved corrective fallback. |
Use this table when the user asks, "Which RAG should I choose?" The recommendation should come from the problem shape, not from what sounds most advanced.
| RAG type | Recommended condition | Use it when | Avoid it when | Best companion settings |
|---|---|---|---|---|
| Naive RAG | First baseline and simple Q&A. | Documents are clean, questions are direct, and you need a working system quickly. | Questions are ambiguous, multi-hop, or answers need strict verification. | Recursive chunking, Dense Vector retrieval, top_k 4-8. |
| Advanced RAG | Default production starting point. | The baseline works but retrieval quality, grounding, or answer consistency must improve. | You have not inspected retrieved chunks yet. | Query rewriting, hybrid retrieval, reranking, RAGAS/DeepEval checks. |
| Modular RAG | Custom architecture with replaceable stages. | Different content types need different retrievers, prompts, or routing paths. | A single simple pipeline is enough. | Clear module boundaries, structured logs, evaluation per module. |
| Agentic RAG | Tool-using or multi-step workflows. | The system should retrieve, optionally call user-approved tools through explicit triggers, use approved memory, and then answer with traceable steps. | Latency must be predictable or the question is a simple lookup. | LangGraph traces, conservative tools, strict permissions. |
| Self-RAG | Strict grounded answers. | You need relevance grading on retrieved documents and an answer support check before returning. | You cannot afford extra LLM checks. | High-quality embeddings, lower top_k, faithfulness metrics. |
| Corrective RAG | Corpus coverage is uncertain. | Retrieved chunks may be wrong, missing, stale, or incomplete, and the system may need an approved Web Search fallback. | Your corpus is complete and retrieval is already strong. | Document grading, fallback logging, source-quality review. |
| Speculative RAG | Hypothesis-first retrieval. | A draft answer or hypothesis can help find better evidence. | The model is likely to invent unsupported claims. | Reranking, strict grounding prompt, answer verification. |
| GraphRAG | Cross-document relationship analysis. | Questions depend on entities, relationships, communities, or facts spread across many documents. | Your documents are small or relationship extraction is unnecessary. | Entity extraction, graph metadata, analytical evaluation queries. |
| HyDE RAG | Query wording differs from document wording. | User questions are abstract but the corpus uses different technical language. | The generated hypothetical answer may drift too far from the corpus. | Strong generation model, reranking, drift checks. |
| Multi-Query RAG | Ambiguous or underspecified questions. | One query phrasing misses useful chunks. | Latency/cost must stay minimal. | 3-5 query variants, deduplication, reranking. |
| RAG-Fusion | Multiple retrieval paths need merged ranking. | You want better recall and ranking from several rewritten queries. | A single retrieval call already returns strong context. | Reciprocal rank fusion, hybrid retrieval, top_k tuning. |
| Step-Back RAG | Questions need background principles. | The answer needs both general concepts and specific source facts. | Questions are direct factual lookups. | Broad query generation, original query retrieval, final synthesis prompt. |
| Parent-Child RAG | Long documents need surrounding context. | Small chunks retrieve the right location but answers need the larger section around it. | Documents are already short and self-contained. | Child chunks 300-600 tokens, parent chunks 1200-2500 tokens. |
| Adaptive RAG | Mixed simple and retrieval-heavy workloads. | Some questions can be answered directly while others should retrieve corpus evidence first. | You cannot reliably route query complexity. | Routing prompts, LangGraph traces, per-route evaluation. |
| Contextual Compression RAG | Retrieved chunks are long or noisy. | Relevant chunks contain too much irrelevant text and the final prompt overflows. | Chunks are already short and clean. | Embeddings filters first, LLM extraction only when necessary. |
Naive RAG and Dense Vector retrieval are usually fastest. Multi-query, RAG-Fusion, Self-RAG, Corrective RAG, and Agentic RAG add extra LLM or retrieval calls.
Multi-Query RAG, RAG-Fusion, HyDE, and Step-Back RAG improve recall when one query phrasing does not find enough useful context.
Self-RAG, Corrective RAG, reranking, compression, and stricter system prompts help reduce unsupported answers.
Parent-Child RAG and Contextual Compression RAG are best when documents are long, verbose, or contain multiple topics per retrieved chunk.
Each picture shows the actual shape of the runtime path. Use these diagrams when deciding which extra steps are worth the latency, credentials, and operational complexity for your users.
Single retrieval path. Best for a first baseline and easy debugging.
Adds quality controls around the baseline path for production Q&A.
Stages are replaceable, so teams can swap modules per domain or file type.
Uses permission-gated tools, memory, and routing for multi-step tasks.
Reflects on retrieval and verifies whether the answer is grounded.
Repairs weak retrieval with explicit checks and approved fallback paths.
Uses an initial draft to guide retrieval, then verifies against evidence.
Builds persistent graph context for cross-document relationship questions.
Useful when user wording is abstract but documents use different terms.
Improves recall by searching multiple phrasings of the same question.
Merges result rankings from multiple retrieval paths for stronger recall.
Combines general principles with source-specific facts.
Small chunks find the location; larger parent context gives the answer.
Routes simple, normal, and complex questions to different paths.
Removes irrelevant text before generation to reduce noise and prompt size.
How it works: query embedding, top-k vector retrieval, context inserted into prompt, answer generated.
Use when: documents are clean and the user needs straightforward Q&A.
Tradeoff: weak on ambiguous, multi-hop, or noisy queries.
How it works: adds query rewriting, HyDE, reranking, or compression around the basic RAG flow.
Use when: quality matters more than raw latency.
Tradeoff: more moving parts and more model calls.
How it works: treats routing, retrieval, fusion, memory, and generation as replaceable modules.
Use when: teams need full control over each stage.
Tradeoff: more architecture decisions for users.
How it works: plans whether to retrieve, rewrite, call approved tools, or answer directly, then follows the selected graph path.
Use when: tasks need approved tools, memory, URL reading, file reading, API reads, or multi-step reasoning.
Tradeoff: less predictable latency and cost.
How it works: reflects on retrieval need, grades retrieved document relevance, generates, and checks whether the final answer is supported by context.
Use when: hallucination control matters.
Tradeoff: slower than simple RAG.
How it works: grades retrieved chunks, removes irrelevant content, rewrites weak queries, and can use approved Web Search fallback when the corpus is insufficient.
Use when: corpus coverage is uncertain.
Tradeoff: needs additional relevance checks.
How it works: drafts an answer first, then retrieves evidence to verify or improve it.
Use when: a hypothesis can guide retrieval.
Tradeoff: early guesses must be carefully grounded.
How it works: extracts entities and relationships during ingestion, stores a persistent graph, builds community summaries, then combines graph context with hybrid evidence retrieval.
Use when: questions span many documents and entity names or relationships matter.
Requirement: configure a graph store and keyword store.
How it works: creates a hypothetical ideal answer document, embeds it, and retrieves real chunks close to it.
Use when: query wording differs from document wording.
Tradeoff: hypothetical content can drift.
How it works: generates multiple query variants and retrieves for each variant.
Use when: one query phrasing misses good context.
Tradeoff: multiple retrieval calls.
How it works: retrieves from multiple generated queries and merges rankings with reciprocal rank fusion.
Use when: ranking quality is more important than speed.
Tradeoff: more retrieval work per question.
How it works: asks a broader conceptual question, retrieves background principles, then combines with original context.
Use when: questions need theory plus facts.
Tradeoff: not needed for simple lookup.
How it works: indexes small child chunks, stores parent document state, then returns the larger parent context for generation.
Use when: legal, research, policy, or book-length documents need surrounding context.
Requirement: original sources must remain available for saved-session rebuilds.
How it works: routes simple prompts to direct generation, standard questions to retrieval, and complex analytical questions to rewrite-plus-retrieval.
Use when: workloads mix easy prompts and corpus-grounded questions.
Tradeoff: requires reliable routing logic.
How it works: retrieves chunks, then filters or extracts only relevant parts before generation.
Use when: chunks are verbose or noisy.
Tradeoff: compression adds latency.
Agentic RAG can use all configured tools. Corrective RAG can use the Web Search tool as an approved fallback. MS-RAGS(ALL-IN-ONE) keeps tools permission-gated: the runtime cannot read a URL, local file, memory store, or API unless the user enabled that tool during setup and approved the required allowlist or credential.
| Tool | When to use it | Permission required | Runtime trigger |
|---|---|---|---|
| Web Search | The private corpus has no matching context and the answer needs current public information. | Tavily or Brave Search API key, max result count, timeout. | Automatic fallback only when retrieval returns no documents. |
| Memory Systems | The agent should remember approved session facts, long-term facts, semantic notes, episodic events, or user profile preferences. | Enabled memory types and a JSON memory path that can be mounted in production. | Automatic memory recall for Agentic RAG queries. |
| URL Fetch / Web Page Reader | The user asks the agent to inspect a specific docs page, blog, changelog, or official URL. | Allowed domains, timeout, max page size. | Include a visible https://... URL in the query. |
| File System Read | The user wants the agent to compare or summarize changing local files. | Strict path allowlist and max file size. | Use file:<approved-path> in the query. |
| Document Summarization | Tool output is too long to pass directly to the answer prompt. | Uses the selected LLM; no extra key. | Automatic when enabled and tool output is large. |
| API Request | The agent must read a safe business API such as status, tickets, inventory, or metrics. | Allowed base URLs, allowed HTTP methods, optional auth env var and credential. | Use api GET https://api.example.com/v1/status. |
For deployment, keep secrets in environment variables or the interactive credential prompt, mount persistent memory storage, and keep URL/file/API allowlists narrow. If a selected tool is missing approval or credentials, MS-RAGS(ALL-IN-ONE) raises a clear runtime error instead of silently pretending the tool worked.
| RAG type | Internal flow | Recommended companion settings |
|---|---|---|
| Naive RAG | query -> embed -> vector search -> prompt -> LLM | Recursive chunking, Dense Vector retrieval, top_k 4-8. |
| Advanced RAG | query enhancement -> retrieval -> reranking/compression -> LLM | Query rewriting, hybrid retrieval, Cohere/BGE reranker, RAGAS evaluation. |
| Modular RAG | router -> selected modules -> retriever/fusion -> generator | Use when users need different retrievers or prompts per content type. |
| Agentic RAG | plan -> retrieve/rewrite/tools/direct answer -> generate | LangGraph tracing, conservative tool access, evaluation on full traces. |
| Self-RAG | retrieval-need reflection -> retrieve/direct -> relevance check -> generate -> support check | Use lower top_k, high-quality embeddings, and strict faithfulness metrics. |
| Corrective RAG | retrieve -> grade chunks -> rewrite/retry or approved web fallback -> answer | Use when documents may be incomplete; log fallback events. |
| GraphRAG | ingest -> extract entities/relations -> graph store -> community summaries -> local/global graph retrieval -> hybrid evidence -> grounded answer | Best with Neo4j/Aura, Kuzu, or Local JSON graph store plus a keyword store. |
| HyDE RAG | query -> hypothetical document -> embed hypothetical -> retrieve real chunks | Use with good generation model and reranking to prevent drift. |
| Parent-Child RAG | retrieve small child -> return larger parent context -> answer | Use child chunks around 300-600 tokens and parent chunks around 1200-2500 tokens. |
| Contextual Compression RAG | retrieve -> filter/extract relevant spans -> prompt | Use embeddings filter first; add LLM extraction only when needed. |