RAG (Retrieval-Augmented Generation)
A technique that retrieves information from your documents and hands it to the LLM along with the question, so it answers based on real, up-to-date data, reducing hallucinations.
RAG (Retrieval-Augmented Generation) is the technique that connects an LLM to your own knowledge base. Instead of the model answering only from its training data, the system first retrieves the most relevant passages from your documents and includes them in the prompt; the model then generates the answer grounded in that context.
The typical flow: documents are split into chunks and converted into embeddings (numeric vectors that capture meaning), stored in a vector database (such as Pinecone). When a question arrives, it is also turned into an embedding, the system finds the most similar chunks and assembles the prompt with them. The result: answers anchored in sources, with the ability to cite where each piece of information came from.
When to use it: whenever the LLM must answer about content it does not know (internal documentation, catalogs, contracts, recent data) without the cost of fine-tuning. A concrete example: a support chatbot with RAG over the product manual answers "how do I reset my password?" by quoting the exact steps from the current version of the manual, instead of inventing a generic procedure.