Tutorial 8: Intro to RAG (Chat with Your Docs)

By Jakub RusinowskiLast updated 9 min readIntermediate

Retrieval Augmented Generation (RAG) allows an LLM to answer questions based on your own private data (PDFs, Notes, Emails).

How it Works

  1. Ingestion: Your text documents are chopped into small chunks.
  2. Embedding: Each chunk is converted into a vector (a list of numbers) representing its meaning.
  3. Retrieval: When you ask a question, the system finds the most similar chunks.
  4. Generation: The chunks are sent to the LLM along with your question.

Why use RAG?

  • Accuracy: Reduces hallucinations by grounding the AI in facts.
  • Privacy: Your data stays local.
  • Context: The AI knows things it wasn't trained on (e.g., your specific project details).

Where to go next

This page explains what RAG is. To use it on your own files: the recipe Chat with your PDFs privately sets it up with an app, no code; the Complete Local RAG Pipeline builds the same thing yourself in Python.