
In a RAG pipeline, hallucinations can arise at three critical stages: before retrieval, during retrieval, and during generation. Imagine all the things that could go wrong during a library visit—asking for the wrong book title, picking the wrong shelf, or misunderstanding the content—and you'll have a good analogy for how these issues manifest in a RAG pipeline.