Retrieval-Augmented Generation (RAG) in Context Sean Helvey's GitHub notebook 'RAG in Context' explains how retrieval-augmented generation (RAG) enables language models to answer questions from documents they were not trained on by retrieving relevant passages and inserting them into the prompt, and connects the search mechanisms to pre-existing ideas. The notebook is available for free on GitHub, requires no account or API key, and takes about twenty minutes to read. RAG gets a language model to answer questions from documents it was never trained on, by finding the right passages and pasting them into the prompt. Most of what makes the searching work predates the models, so this notebook https://github.com/seanhelvey/rag-in-context/blob/main/rag.ipynb connects it back to ideas that have been around a lot longer. Read the notebook on GitHub → https://github.com/seanhelvey/rag-in-context/blob/main/rag.ipynb About a twenty minute read, no account and no API key. Browse the repo https://github.com/seanhelvey/rag-in-context .