How to build a chatbot on your documents (RAG)
Updated 7/20/2026
RAG (Retrieval Augmented Generation) makes an AI model answer based on your documents, not just what it learned. Ideal for an assistant that knows your products, manuals or company policy.
How it works
- You split the documents into chunks and turn them into vectors (embeddings).
- You store them in a vector database.
- On a question, you retrieve the relevant chunks and give them to the model as context.
- The model answers using that context.
What you need
- A local model, see Ollama.
- A vector database (pgvector or Qdrant).
- Glue that ties it together: frameworks like LangChain or LlamaIndex, or visually with Flowise.
The simplest path
Open WebUI allows uploading documents and asking questions based on them right from the interface, see Open WebUI. For custom flows, Flowise lets you build the chatbot visually, no code.
Privacy
The whole process runs on your server, so sensitive documents never leave your infrastructure.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
How to use OpenHands as an AI software engineer
OpenHands takes a task and writes, runs and debugs the code on its own. Here is how to use it safely.
Updated 7/20/2026AI & self-hostingHow to extract web data without code, using Maxun
Build robots that collect data from websites by clicking, without writing a line of code.
Updated 7/20/2026AI & self-hostingHow to build a customer chatbot with Dify
Use Dify to create an assistant that answers from your company documents, without writing code.
Updated 7/20/2026