From the source
Perplexity's guide explains that RAG (retrieval-augmented generation) supplements LLMs by adding data from external sources to the input context, addressing issues such as out-of-date information, hallucinated responses, and lack of verification.
It describes three main types of RAG—naive, modular, and advanced—and notes that RAG is necessary when an LLM requires access to company documentation, databases, or fast-changing information, while an LLM-only approach suits tasks where all inputs can be supplied by the user.