RAG (Retrieval-Augmented Generation) combina um LLM com um sistema de recuperação — buscando informações relevantes em uma base de conhecimento e fornecendo-as ao LLM como contexto para gerar respostas precisas e fundamentadas. É uma técnica fundamental para construir aplicações LLM sobre dados personalizados.
O que RAG faz
RAG → augment an LLM's generation with RETRIEVED relevant information:
1. RETRIEVE → search a knowledge base (your documents/data) for info relevant to the query
2. AUGMENT → add the retrieved info to the LLM's prompt as CONTEXT
3. GENERATE → the LLM answers using the provided context (grounded in your data)
→ gives the LLM relevant, up-to-date, specific knowledge it wasn't trained on
