Talk Flux
Empieza gratis
Léxico / TÉCNICA

RAG (Retrieval-Augmented Generation)

A technique that enhances AI responses by retrieving relevant information from external sources before generating an answer.

RAG combines a retrieval step with text generation. Instead of relying solely on what the model memorized during training, RAG fetches up-to-date, relevant documents and feeds them into the prompt.

How RAG Works

  1. Your query is converted into an embedding
  2. Similar documents are retrieved from a vector database
  3. The retrieved context is injected into the prompt
  4. The model generates an answer grounded in real data

Why RAG Matters

  • Reduces hallucinations — answers are backed by actual sources
  • Stays current — no need to retrain the model for new information
  • Respects context windows — only the most relevant chunks are included