Build the RAG pipeline

Put the steps of a RAG system answering a question in order.

RAG (Retrieval-Augmented Generation): the AI fetches context before answering.

A RAG doesn't answer from memory: it fetches context first. Build the order. ⚗️
  1. 1Build the prompt, placing the snippets as context.
  2. 2Receive the user's question.
  3. 3The LLM generates the answer using that context.
  4. 4Search the base for the snippets most similar to the question.
  5. 5Return the answer with the sources cited.