Udemy
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
(English)Local RAG on Mac: Ollama, LangChain & ChromaDB
New
1 students

(English)Local RAG on Mac: Ollama, LangChain & ChromaDB

Build document Q&A on a Mac with local models: follow each demo, measure retrieval and answers, and improve them.
Created by達也 山本
Last updated 11/2026
English
English

What you'll learn

  • Install and connect Ollama, Qwen2.5 and bge-m3 on a Mac, with no external API
  • Understand how embeddings and cosine similarity work, and calculate them by hand
  • Prepare documents: extract text from PDF and HTML, clean it, split it into chunks and attach metadata
  • Build a persistent index with ChromaDB and a retrieval pipeline with LangChain (LCEL)
  • Show the sources of the answers, and make the system answer "not found" when the information is missing
  • Build an evaluation set and measure Recall@k, MRR, nDCG and the answer check
  • Separate retrieval failures from generation failures and fix the prompt, measuring one rule at a time
  • Evaluate BM25, hybrid search with RRF and reranking, and decide based on the numbers
  • Finish a local application with incremental updates, conversation history and a Gradio interface

Course content

9 sections • 124 lectures • 5h 6m total length
  • 1.1. What We Will Build in This Course4:17
  • 1.2. RAG Broken Down into Three Steps1:41
  • 1.3. Fine-Tuning vs. RAG - When to Use Which2:04
  • 1.4. Why Build RAG Locally3:00
  • 1.5. How to Take This Course, Requirements, and What to Do When You Get Stuck2:13

Requirements

  • A Mac (Apple Silicon recommended) with at least 16 GB of memory and about 15 GB of free disk space. The steps are not verified on Windows.
  • Basic Python: variables, functions, for loops, imports.
  • Being able to run commands in the terminal.
  • An internet connection to download packages and models. No API key is needed.

Description

This course contains the use of artificial intelligence.

This course is designed for macOS: the commands and screens shown are from a Mac. Windows instructions are not included.

The evaluation figures in this course (for example, from 86.7% to 90.0%) were measured by us, on our own machine, with the English version of the fictional company policies. On your computer you will most likely get different numbers; what matters is how they change after each step.

You built a RAG system by following a tutorial, but it gets the important questions wrong? That is exactly where this course starts.

On a Mac, you build a question-answering system for company documents from scratch, using only Ollama and no external API. You run Qwen2.5 for generation and bge-m3 for embeddings locally, store the chunks in ChromaDB, and connect retrieval and generation with LangChain (LCEL). Every step is shown on screen: the environment, the embeddings, cleaning the documents, choosing the chunks, the retrieval, the prompt and the sources.

Then you make the system fail on purpose, with questions about form numbers, negations or several documents, and you build an evaluation set of 30 questions. You measure retrieval with Recall@k, MRR and nDCG and the answers with a check of words and numbers, and you separate retrieval failures from generation failures. In our measurement, one added prompt rule that asks for exact numbers raised the passed answer checks from 86.7% to 90.0%. Hybrid search with BM25 and RRF and reranking with a cross-encoder are implemented and measured as well; neither was adopted, because the simpler setting reached the same result faster. You learn to tell, on your own data, what works and what does not. And you see why a passed word check does not yet prove a correct answer.

In the last part, you turn the notebook into scripts: incremental indexing, a production prompt, answers that say "not found", follow-up questions with conversation history, and a local Gradio interface. Finally, you try the system with your own PDFs.

The course has 8 sections and 62 lectures, about 4 hours in total, with a synthetic voice and English captions. The materials include all the code, 6 notebooks, the fictional company policies in English, the evaluation set, the prompts, our measurement results and the code of every lecture. The policies describe a fictional Japanese company and the amounts are in JPY; they are not employment or legal advice.

Note: at the end of the course you will also find the section "Previous version" with the 62 lectures of the first edition (about 1 hour 40 minutes), which stays available for everyone who had already started with it. The updated version is all you need for the course: the 8 main sections take about 4 hours. The total length shown by Udemy (about 5 hours 40 minutes) includes the previous version.

Who this course is for:

  • Python developers who want to build RAG for company documents without sending the documents to the cloud
  • Developers who have already built a RAG system but do not understand why it answers wrongly
  • Anyone who wants to learn to measure and improve the quality of a RAG system with numbers