RAG (retrieval-augmented generation)
Short answer
RAG means finding the relevant passages of a document first and showing only those to the model, instead of trying to fit the whole document into the context window.
It is what makes a 300-page PDF answerable by a model with a 4,000-token window. The retrieval step picks the handful of passages that look relevant, and the model answers from those.
It also explains the most common disappointment with document assistants: if retrieval picks the wrong passages, the model answers confidently from the wrong part of the file. Nightjar's retrieval matches words rather than meaning, so phrasing your question in the document's own vocabulary measurably improves the answer.
Related terms
Other ways people ask this
- what is rag