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→Cursor
Anysphere's coding agent with an agent-first desktop editor, a CLI, cloud agents and an iOS app.
- 02→Sourcegraph Cody
Sourcegraph's AI coding assistant with codebase-wide context, now available only on Sourcegraph Enterprise.
- 03→Continue
Open-source AI code assistant for VS Code, JetBrains and the terminal, whose maker was acquired by Cursor.