RAG
Retrieval-Augmented Generation — a pattern where the application retrieves relevant text chunks from a knowledge base (vector DB, search index) and includes them in the LLM prompt at query time, so the model answers from grounded sources instead of pure memorisation.
Background
RAG combines an information-retrieval step with a generation step. At query time, the user's question is embedded and used to find top-K matching chunks from a corpus. Those chunks are concatenated with the question into a single prompt. The model answers grounded in retrieved context, reducing hallucinations and allowing fresh data without retraining. In coding tools, RAG indexes the codebase so the model can answer "where is auth handled?" with real file references.
Tools that use it
- 01→Sourcegraph Cody
Code-search and AI assistant by Sourcegraph — semantic search across enterprise codebases plus inline coding help.
- 02→Continue
Open-source AI code assistant for VS Code and JetBrains, with full BYOK and local-model support.
- 03→Cursor
AI code editor forked from VS Code with built-in agent, multi-file edits, and tab-completion.