How to chat with your PDFs using local Large Language Models [Ollama RAG]

8 Apr 2024 · 23 min
23:00

In this tutorial, the presenter demonstrates how to construct a completely offline Retrieval‑Augmented Generation (RAG) system that lets users chat with the contents of PDF documents using locally hosted Large Language Models (LLMs) via Ollama. The workflow begins with loading PDFs through LangChain’s Unstructured PDF loader, then recursively splitting the text into overlapping chunks to preserve context. These chunks are embedded with the Nomic Embed Text model (served by Ollama) and stored in a ChromaDB vector store. A multi‑query retriever generates several paraphrased versions of a user’s question, retrieves relevant chunks for each, and merges the results into a concise context. This context is fed to a local LLM (e.g., Mistral, Llama 2, or Gemma) via LangChain’s ChatOllama wrapper to produce the final answer. The video also covers installation steps for Ollama, model selection, vector‑store alternatives, chunk‑size/overlap tuning, and the rationale for keeping data offline for privacy‑sensitive documents. Finally, the presenter outlines plans to wrap the pipeline in a Streamlit UI and mentions future extensions such as agent‑based RAG strategies.

Chapters

More from Tony

4:21
youtube.com

What Is LoRA? AI Fine-Tuning Explained With Glasses

1mo ago
3:07
youtube.com

i bought NVIDIA’s DGX Spark (unboxing a desktop AI Supercomputer)

1mo ago
2:59
youtube.com

Rekody: A Private Dictation App That Runs Entirely on Your Mac for Free!

3mo ago
11:49
youtube.com

Own Your LLM: Deploy + Build an App on It (Modal Auto Endpoints)

3mo ago
9:30
youtube.com

How to Setup Claude Code's NEW Remote Control Feature (Step-by-Step)

7mo ago
4:58
youtube.com

Faxes are Still a Thing? Here’s How I Automated Them for $1

7mo ago
15:04
youtube.com

CrewAI Flows Made Super Easy

1y ago
5:15
youtube.com

Summarize Videos and Research Companies with CrewAI + Gemini Models [Quickstart Guide]

1y ago
4:10
youtube.com

NotebookLM Video Overviews in 4 Minutes

1y ago
22:47
youtube.com

How I Made 3 AI Agents Work Together for Smarter Reports!

1y ago
8:36
youtube.com

How to Make Your AI Agents More Reliable with CrewAI Task Guardrails (Step-by-Step Tutorial)

1y ago
See all content