RAG Techniques Explained: 16 Retrieval-Augmented Generation Approaches

    This article explains why large language models need Retrieval-Augmented Generation (RAG), breaks down the five stages of a minimal RAG pipeline, and surveys 16 RAG approaches, from Naive RAG and query rewriting to hybrid retrieval, reranking, graph-based RAG, permission-aware RAG, and evaluation-driven RAG. It also covers practical deployment guidance and a quick selection guide to help you choose the right approach for prototyping, long documents, numerical question answering, enterprise compliance, and long-term iteration.

    1. Why LLMs Need RAG

    Large language models perform well on general reasoning and generation tasks, but they have three structural limitations. Their knowledge has a training cutoff, so they cannot perceive newly occurring facts. Their generation is based on probability distributions, which makes them prone to “hallucinations” that sound plausible but are factually wrong. And their parameters contain no private corpus, so they know nothing about internal company documents, business rules, or ticket records.

    When a user asks about a recently released project or an internal specification, the model can only piece an answer together from old memories, and the tech stack and timeline are often wrong. The core idea of RAG (Retrieval-Augmented Generation) is “search first, then answer”: before the model generates anything, relevant fragments are retrieved from an external knowledge source and injected into the prompt as context, so the model organizes its answer based on the given material. This paradigm turns a “memory problem” into a “retrieval problem,” and turns uncontrollable generation into conditional, constrained generation.

    2. Breaking Down the Basic RAG Pipeline

    A minimal working RAG pipeline has five stages:

    1. Data ingestion: extract raw text from documents, web pages, databases, and ticket systems.
    2. Chunking and vectorization: split text at semantic boundaries and call an embedding model to generate vectors.
    3. Index construction: write the vectors into a vector index while retaining the original text and metadata.
    4. Retrieval: vectorize the user query, perform similarity recall, and optionally add keyword recall.
    5. Generation and post-processing: concatenate the context, call the model, and add citation annotation and fact checking.

    Illustrative code (pseudocode):

    1. chunks = split_by_semantics(load_documents(paths))
    2. vectors = embed(chunks)
    3. index = build_vector_index(vectors, metadata=chunks.meta)
    4. query_vec = embed(user_query)
    5. candidates = index.search(query_vec, top_k=20)
    6. context = rerank(candidates, query=user_query)[:5]
    7. answer = llm.generate(prompt_with(context, user_query))

    3. The Full Landscape of 16 RAG Approaches

    1. Naive RAG

    The most basic “retrieve once, concatenate once.” It is simple to implement but extremely sensitive to chunk granularity and recall quality, making it suitable for prototype validation.

    2. Query Rewriting RAG

    A small model first rewrites colloquial, referential questions into retrieval-friendly phrasing, then retrieval runs. It improves results noticeably for elliptical questions in multi-turn conversations.

    3. Multi-Query RAG

    A single original question is expanded into multiple sub-questions from different angles and retrieved in parallel; the results are merged and deduplicated, significantly improving recall coverage.

    4. Hybrid Retrieval RAG

    Vector recall handles semantic similarity while keyword recall handles exact matching of proper nouns and identifiers. The two result sets are combined with weighting, covering both semantics and literal wording.

    5. Reranking RAG

    The initial screening stage relaxes top_k, then a cross-encoder reranks the candidate fragments precisely, sending only the few most relevant fragments to the model, balancing accuracy and cost.

    6. Parent-Child Chunk RAG

    Small chunks are used at retrieval time to improve hit precision; after a hit, the system traces back to the parent chunk to provide complete context, solving the problem of “shredding the text and losing context.”

    7. Context Compression RAG

    Recalled fragments are first compressed extractively or generatively, keeping only sentences strongly related to the question, which reduces token consumption and noise interference.

    8. Adaptive RAG

    The model or a classifier decides “whether retrieval is needed and how many rounds,” answering simple questions directly and running multi-round retrieval for complex ones, optimizing latency and cost.

    9. Self-Reflective RAG

    After generation, the model self-assesses whether the answer is supported by the context; if not, a second retrieval is triggered, forming a “retrieve-generate-verify” loop.

    10. Graph-Structured RAG

    Entities and relations are extracted into a knowledge graph, and retrieval traverses multiple hops along relations. It suits questions that require reasoning chains and relational constraints.

    11. Hierarchical Summary RAG

    Long documents are first turned into a hierarchical summary tree; retrieval first locates the chapter and then drills down to details, fitting very long documents and manual-style corpora.

    12. Multimodal RAG

    Images, tables, and audio/video are transcribed into text descriptions or structured fields and indexed uniformly, enabling cross-modal retrieval and answering.

    13. Structured Data RAG

    For databases and tabular data, the approach is “convert the question into a query statement” to fetch data, then use the result as context to guarantee numerical accuracy.

    14. Conversational Memory RAG

    The conversation history itself is treated as retrievable memory, and earlier turns are recalled by relevance, mitigating forgetting in long conversations.

    15. Federated / Permission-Aware RAG

    The retrieval layer introduces identity and permission filtering to ensure users can only recall fragments within their visible scope, meeting enterprise compliance requirements.

    16. Evaluation-Driven RAG

    Metrics such as recall rate, context hit rate, answer faithfulness, and citation accuracy are established, and an offline evaluation set continuously drives iteration of chunking strategies and prompts.

    4. Key Points for Engineering Deployment

    In a cloud implementation, you can combine object storage for raw documents, a message queue for incremental synchronization, a container platform to host retrieval and generation services, and logging plus monitoring and alerting to observe pipeline quality. Cloud vendors such as Baidu AI Cloud typically offer the general-purpose capabilities above, making it easy for teams to assemble them as needed.

    Deployment recommendations: start with a small offline evaluation set, then gradually introduce reranking and query rewriting; prefer chunking at semantic and structural boundaries rather than a fixed character count; always retain citation provenance so answers can be verified; and for permission-sensitive scenarios, push filtering conditions down to the retrieval layer rather than the generation layer.

    5. Quick Selection Guide

    Choose approach 1 for rapid validation; approach 4 when you need both semantics and literal matching; approaches 6 and 11 for long documents; approach 10 when a reasoning chain is required; approach 13 for numerical question answering; approach 15 for enterprise compliance; and approach 16 must be added for long-term iteration.