Retrieval-augmented generation, usually called RAG, combines a language model with an external knowledge source. Instead of relying only on information stored during training, the system retrieves relevant evidence and includes it in the model prompt. The basic RAG pipeline Documents are divided into useful chunks and converted into vector representations. At question time, the query…