Kodename JPG
IDEN

Building a Private Document Search Web App (Local RAG) with Open WebUI


Written: Nov 28, 2026 · Level: Intermediate · Category: AI Agent


Home > Tutorials > Building a Private Document Search Web App (Local RAG) with Open WebUI

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.
Local RAG flow: documents (PDF/notes) → chunks → embeddings (nomic-embed-text) → vector DB → retrieval → answer with citations

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



  1. https://docs.openwebui.com/features/workspace/knowledge/
  2. https://docs.openwebui.com/features/chat-conversations/rag/
  3. https://peira.dev/articles/open-webui-advanced/

Like this tutorial? Support the author so there are even more free tutorials.

Support via Saweria

Comments