What is the difference between naive RAG, advanced RAG, and modular RAG?
Naive RAG follows the basic retrieve-then-generate pattern with simple chunking, single-stage retrieval, and direct context insertion. It works for basic use cases but suffers from poor retrieval precision, context window waste, and inconsistent answer quality. Advanced RAG adds pre-retrieval optimizations like query rewriting, expansion, and routing; retrieval enhancements like hybrid search, reranking, and recursive retrieval; and post-retrieval processing like context compression, citation extraction, and answer verification. Modular RAG treats RAG as a composable system of interchangeable modules including routing, retrieval, reranking, compression, generation, and verification, each of which can be independently optimized or replaced. Modular RAG enables complex patterns like adaptive retrieval that decides whether retrieval is needed, multi-step retrieval that iteratively refines results, and multi-source retrieval combining different knowledge bases.