Local Offline PDF RAG App

SilverConsistent9222 · reddit · 2026-07-13

The author built a **completely offline** local RAG app to answer questions based on personal PDF files. ### Implementation - Uses Flask for both frontend and backend - Uploaded PDFs are split into overlapping chunks to prevent sentence truncation - Embeddings for each chunk are stored in ChromaDB, persisted to disk using `PersistentClient` - User questions are also embedded to retrieve the most relevant chunks as context for the model ### Behavior - The prompt strictly instructs the model to **answer only based on the retrieved context** and to say "I don't know" if there is no answer, preventing hallucinations - The author tested out-of-document questions, and the model correctly responded with "I don't know" - Works without internet since the chat model, embedding model, and vector database all run locally with zero external API dependencies

Original post →

More from Apps

Apps channel →