Building a Private Document Search Web App (Local RAG) with Open WebUI
Home > Tutorials > Building a Private Document Search Web App (Local RAG) with Open WebUI
Archive
- Install Apache, MySQL, PHP and phpMyAdmin on Archlinux 2021
- Configure an Apache Virtual Host Server on ArchLinux Jun 12, 2021
- How to Deploy a Static Blog to GitHub Pages Nov 17, 2026
- How to Sign Up for make.fun with an Agent and Let the Agent Find Bounties on Its Own Nov 17, 2026
- How to Hunt Bug Bounties with Agentic-Bug-Hunter (Free, Local AI) Nov 18, 2026
- How to Install Google Analytics 4 and Tag Manager on a Static Blog Nov 26, 2026
- How to Optimize SEO for a GitHub Pages Blog Nov 26, 2026
- How to Join make.fun Bounties with an AI Agent Nov 26, 2026
- How to Build a Tank Bot on battle.training Nov 26, 2026
- How to Make a Bootable Ventoy USB (Detected on Phones and Laptops) Nov 26, 2026
- Small and Lightweight Linux ISOs for Old Laptops (Potato PCs) Nov 28, 2026
- Local AI on Linux: Ollama + Open WebUI on a Potato Laptop (CPU Only) Nov 28, 2026
- Accessing Local AI from Your Phone via LAN & Cloudflare Tunnel Nov 28, 2026
- Building a Private Document Search Web App (Local RAG) with Open WebUI Nov 28, 2026
- How to Mint Free NFTs on BSC Safely Nov 30, 2026
- How to Make Automated Story YouTube Shorts (Stickman + TTS) Nov 30, 2026
Have a folder full of hundreds of PDFs, notes, and documents — but can never find anything inside them? With local RAG, you can ask those documents questions in a chat, like asking a librarian who has read them all. And because everything runs on your own laptop, not a single file goes up to the cloud.
Prerequisite: Ollama and Open WebUI are already running on your laptop (Local AI on Linux: Ollama + Open WebUI on a Potato Laptop).
What Is RAG?
RAG (Retrieval-Augmented Generation) is how an AI can answer from your own documents. The flow: when you ask a question, the AI first searches for the relevant document chunks, then answers based on those chunks — not based on its memory. So the answer is grounded in your documents, complete with citations to the source.
Figure 1: Local RAG flow — documents, embeddings, then cited answers.
Step 1: Create a Knowledge Base
In Open WebUI, click
Workspace > Knowledge > Create, then give it a name — for example "Private Documents" or the name of your collection.
Step 2: Upload Documents
Upload
PDF, TXT, DOCX, or Markdown files to the Knowledge Base you just created. Wait for processing to finish — Open WebUI splits the documents into small chunks and turns them into embeddings (see the section below).
Step 3: Ask Your Documents
Open a new chat, type
# and pick your Knowledge Base, or click + > Attach Knowledge. Then ask anything about the contents of your documents — for example, "What are the leave application requirements in the HR document?" — and the AI will answer from those documents.
Alternative: attach the Knowledge Base to a model so it is always active — go to
Workspace > Models > Edit > Knowledge, then pick your Knowledge Base.
The Local Embedding Model
An embedding is a way of turning text into numbers so the computer can find the chunks that match your question. Open WebUI uses a local embedding model — the default is
nomic-embed-text (about 274 MB). If it is not on your laptop yet, pull it with Ollama:
ollama pull nomic-embed-text
then pick it under
Admin > Settings > Documents > Embedding Model.
Reading Answers: Citations
RAG answers come with citations to their sources — click a citation to open the file at the quoted page. That is what sets RAG apart from ordinary chat: you can check for yourself where the answer came from, instead of just trusting it.
Tips
- Plain text files (text-based PDFs, TXT, Markdown) give the best results — scanned files (images) need OCR first before they can be read.
- Manage files under
Settings > Data Controls > Manage Files — deleting a file also deletes its embeddings.
Every step — chat, embeddings, and documents — runs on your own laptop. No data leaves it.
Quick Troubleshooting
- Answers do not connect to your documents → check that the files have finished processing, then re-index.
- Out of RAM during RAG → embeddings and the chat model share RAM, so do not run them together with heavy apps.
References
- https://docs.openwebui.com/features/workspace/knowledge/
- https://docs.openwebui.com/features/chat-conversations/rag/
- https://peira.dev/articles/open-webui-advanced/
Like this tutorial? Support the author so there are even more free tutorials.
Support via Saweria
Comments