Elephant Scale
BeginnerTechnical AI/ML

Introduction to RAG

Learn Retrieval-Augmented Generation from first principles: chunking, embeddings, vector search, and grounding LLM answers in your own documents.

Course Overview

Large language models are trained on public data and frozen at a point in time. They know nothing about your contracts, your ticket history, or the policy document your legal team revised last week, and when asked they will produce a confident answer anyway. Retrieval-Augmented Generation is the standard remedy: retrieve the relevant passages from your own corpus first, then ask the model to answer using only what was retrieved.

This course builds a working RAG pipeline end to end, one stage at a time. You start with document loading and chunking, because chunk boundaries determine what the retriever can find at all. You then move to embeddings and vector stores, learn why cosine similarity retrieves plausible-looking but wrong passages, and add the reranking and hybrid keyword search that fix it. Every stage is implemented in a lab rather than described on a slide.

The final third of the course is about knowing whether your pipeline actually works. Teams routinely ship RAG systems with no measure of retrieval quality and discover the problem only when a user is given a wrong answer with a citation attached. You will build a small evaluation set, measure retrieval precision and answer groundedness, and learn to trace a bad answer back to the specific stage that caused it.

Duration: 2 days|Delivery: onsite, virtual, or hybrid

Prerequisites

  • Python programming at an intermediate level (functions, classes, virtual environments)
  • Familiarity with calling a REST API and handling JSON
  • Having used an LLM chat interface such as ChatGPT or Claude
  • No prior machine learning or NLP experience required

Who Should Attend

  • Software engineers who need to ground an LLM feature in company documents
  • Data engineers responsible for the ingestion pipeline behind an AI product
  • Technical leads evaluating whether RAG or fine-tuning fits their use case
  • Solutions architects who must size and cost a retrieval system before committing

Course Outline

  1. 1Why LLMs hallucinate: context windows, training cutoffs, and parametric memory
  2. 2RAG architecture end to end: ingest, chunk, embed, index, retrieve, generate
  3. 3Document loading and parsing: PDFs, HTML, Office formats, and their failure modes
  4. 4Chunking strategies: fixed-size, recursive, semantic, and document-structure-aware
  5. 5Embeddings explained: what a vector represents and how models differ
  6. 6Vector databases: indexing, distance metrics, and choosing between pgvector, FAISS, and managed services
  7. 7Retrieval quality: top-k tuning, metadata filtering, and why pure similarity search fails
  8. 8Hybrid search and reranking: combining BM25 keyword search with dense retrieval
  9. 9Prompt construction for grounded answers, citations, and refusal behavior
  10. 10Evaluating RAG: retrieval precision and recall, answer groundedness, and building a golden test set

Learning Outcomes

  • Explain when RAG is the right approach and when fine-tuning or a longer context window is better
  • Build a complete RAG pipeline from raw documents to a cited, grounded answer
  • Choose a chunking strategy based on document structure rather than by default
  • Select and configure a vector store appropriate to your data volume and latency budget
  • Diagnose whether a wrong answer came from retrieval or from generation
  • Measure retrieval and answer quality with a repeatable evaluation set
  • Add citations and controlled refusal so the system says it does not know

What You Will Build

  • A working RAG pipeline over your own sample documents
  • A comparison of at least three chunking strategies measured on the same queries
  • An evaluation notebook reporting retrieval precision and answer groundedness
  • A reference architecture diagram you can take to your own team

Frequently Asked Questions

What is the difference between RAG and fine-tuning?
RAG retrieves relevant text at query time and puts it in the prompt, so the model answers from documents it was never trained on. Fine-tuning adjusts model weights to change style, format, or task behavior. Use RAG when the answer depends on facts that change or that the model has never seen; use fine-tuning when you need a consistent output format or domain tone. Most production systems use RAG first, and fine-tune later if at all.
Do I need to know machine learning to take this course?
No. The course is written for software and data engineers. You need solid Python and comfort with APIs. Embeddings and vector similarity are taught from scratch, and no model training is involved.
Which vector database does the course use?
Labs run on pgvector and FAISS because they are free and require no vendor account, and the retrieval concepts transfer directly. The course also covers how managed options such as Pinecone, Weaviate, and Azure AI Search differ on indexing, filtering, and cost, so you can choose deliberately.
How long is the course and how is it delivered?
Two days, roughly half instruction and half hands-on labs, delivered onsite, virtually, or hybrid. Labs run in a browser-based environment, so there is nothing to install on corporate laptops.
Can the course use our own documents?
Yes. For private cohorts we commonly swap the sample corpus for a representative set of your own documents so the chunking and retrieval problems your team hits are the ones you practice on.

Ready to Get Started?

Contact us to schedule training for your team or inquire about upcoming sessions.