Retrieval-augmented generation, usually shortened to RAG, is a method for grounding an AI model's output in real, retrievable source material at the moment it generates a response, instead of relying purely on whatever patterns it absorbed during training. In a standard large language model, an answer is generated entirely from the statistical patterns baked into the model's parameters, which is exactly the mechanism behind AI hallucination. A RAG system adds a retrieval step: before generating an answer, it searches a defined set of documents (a medical literature database, a clinical guideline set, a company's own knowledge base) for relevant material, then generates its response using that retrieved material as grounding.

In healthcare specifically, RAG matters because it changes what a model's answer is actually based on. A model without retrieval can only reproduce whatever medical knowledge happened to be present, and current, in its training data. A model with retrieval can pull from an up-to-date, verifiable source and, in well-designed systems, cite exactly where its answer came from. This is the core mechanism behind citation-first health AI products like Perplexity Health, and it is one of the primary reasons hallucination rates have fallen across newer generations of medical AI tools.

Example

Instead of generating a drug interaction warning purely from training data, a RAG-based system retrieves the actual current interaction entry from a maintained drug database, then generates its explanation from that retrieved entry, and can show the source it pulled from.