What is RAG for codebases and how does it work?
Retrieval-Augmented Generation (RAG) for code means the AI tool indexes your codebase into a vector database and retrieves the most relevant files/functions based on your query before generating a response. This lets the model reference your entire codebase even when it doesn't fit in the context window. Cursor and Cody (Sourcegraph) use codebase-level RAG to answer questions like "how does authentication work in this project?"