1. Home
  2. AI PC & Hardware
  3. Chat With Your Documents Locally: RAG With Ollama
AI PC & Hardware

Chat With Your Documents Locally: RAG With Ollama

Published on December 5, 2026 · by Qubira 7 min read
Chat With Your Documents Locally: RAG With Ollama

Yes, you can point a local AI at a folder of your own PDFs, notes and manuals and ask it questions, entirely on your own computer. The trick is called retrieval-augmented generation, RAG for short, and the simplest route today is Ollama for the models plus Open WebUI for the interface. It works well for “what does clause 7 of this lease say” and “where did I note the router password”; it works badly for “summarize my whole archive”, and understanding why saves hours of frustration.

If you have not set up the basics yet, start with our guide to running AI locally on your PC and the walkthrough for Open WebUI with Ollama, because we build on both here.

✓
Our short answerInstall Ollama, pull a chat model of around 8B plus an embedding model such as nomic-embed-text, add your files in Open WebUI's Knowledge section, and ask questions. Expect good answers on specific facts, and weak ones on questions that need the whole document at once.

What RAG actually does (and why it is not “training”)

A common misunderstanding is that the AI “reads” your documents and learns them. It does not. A language model can only see what is in the prompt in front of it, and that prompt has a limited size. Your 300-page manual will not fit, so RAG works around it in three steps.

First, your files are cut into chunks, typically a few hundred words each. Second, an embedding model turns every chunk into a list of numbers that captures its meaning, and those are stored in a small database. Third, when you ask a question, your question is converted the same way, the database returns the chunks whose numbers sit closest to it, and only those chunks are pasted into the prompt next to your question. The chat model then answers from that handful of passages.

Once you see it this way, most failures explain themselves. If the right paragraph never gets retrieved, the model cannot answer, however clever it is. If it answers with confidence from the wrong paragraph, you get exactly the behaviour we describe in our piece on why chatbots make things up.

The setup, in plain terms

You need two models, not one. The chat model writes the answer; the embedding model does the searching. In Ollama that is two downloads. An 8B instruction model is a sensible chat model for a machine with 16 GB of RAM or a graphics card with 8 GB of VRAM, and nomic-embed-text is a small, popular embedding model that is only a few hundred megabytes. Multilingual embedding models such as bge-m3 exist too, and they are worth the extra size if your documents are in Italian, Spanish or a mix of languages, because an English-focused embedder retrieves noticeably worse on other languages.

In Open WebUI, create a Knowledge collection, drag your files in, and in the document settings choose your embedding model from Ollama instead of the default built-in one. Then start a chat, attach the collection, and ask. That is genuinely the whole workflow; the rest of this article is about making it work well. The menu names shift between versions, so lean on the current documentation if ours differ.

Three settings that decide whether it works

Chunk size and overlap. Small chunks, say 300 to 500 tokens, retrieve precise facts but lose context. Large ones keep context but dilute the match. For manuals, contracts and notes, a few hundred tokens with a modest overlap is a good starting point. If your answers are accurate but oddly incomplete, try bigger chunks; if they drift off-topic, go smaller.

How many chunks to retrieve. Pulling three to five chunks suits a small model. Pulling twenty sounds generous, but it floods the prompt, and smaller models tend to lose the thread in the middle of long contexts. More is not better.

The context window. This is the one that catches people out. Ollama runs models with a limited context window by default, and if the retrieved text is longer than that window, the beginning of your prompt, which can include the very passages you retrieved, is silently cut. If answers ignore documents you know were found, raise the context length in the model settings, and remember it costs extra memory.

SymptomLikely causeFix
“I can’t find that” for something in the filePDF is a scan, or wrong chunks retrievedOCR first; rephrase using the document’s own words
Right topic, missing detailChunks too smallIncrease chunk size and overlap
Answer mixes two documentsToo many chunks retrievedRetrieve fewer; split collections by topic
Ignores the retrieved textContext window too smallRaise context length
Weak results in Italian or SpanishEnglish-only embedderSwitch to a multilingual embedding model

What it is good at, and where we would not bother

RAG shines at lookup. Ask a precise question whose answer lives in one or two paragraphs and you will usually get it, with a pointer to the source passage you can verify. Typical wins: a household folder of appliance manuals and warranty papers, years of meeting notes, a student’s lecture PDFs, a freelancer’s contracts.

It is poor at anything global. “What are the main themes across these 80 reports?” needs the model to see everything at once, and retrieval by definition shows it only fragments. Tables are another weak spot, since chunking tends to slice a table into pieces that make no sense alone. And if you have ten files, honestly, you may be better off pasting the relevant one into a long-context chat and skipping the machinery.

Finding a specific fact
Strong
Quoting a clause or passage
Good
Reading tables and spreadsheets
Patchy
Summarizing a whole archive
Weak

These bars are our editorial rule of thumb from how the method works, not benchmark results.

Hardware: what you really need

Retrieval itself is cheap. The embedding step is a one-off cost per file and a modest machine handles it, just slowly on CPU if you add hundreds of documents at once. The thing that scales your experience is the chat model, so the usual rules apply: 16 GB of RAM is a floor, and a GPU with 8 GB or more of VRAM makes answers arrive quickly. Our guide to how much VRAM local models need covers the sizing, and if you are starting from scratch, a desktop built for local AI saves guesswork. Indexing a large library also needs disk space for the vector database, so keep an eye on your SSD capacity.

If you are shopping for storage, a fast NVMe drive helps indexing and model loading alike; you can browse NVMe SSDs on Amazon.

A sensible first test

Do not start with your whole archive. Pick one document you know intimately, ten pages of something you wrote or a manual you have struggled with, and ask five questions whose answers you already know, including one that is not in the document at all. A healthy setup answers the first four correctly and admits it does not know the fifth. If it invents an answer to the fifth, tighten your prompt with an instruction to answer only from the provided passages and say so otherwise. Once that behaviour is reliable, scale up.

The honest bottom line: local RAG is a genuinely useful private search assistant for specific questions, and a disappointing “second brain” if you expect it to understand your archive. If you are curious about the cloud trade-off, our comparison of local AI versus cloud AI lays it out. Start small, tune chunks before you buy hardware, and let the source citations keep the model honest.

FAQ

Does RAG train the model on my documents?
No. The model is never changed. Your files are split into pieces and indexed, and for each question the best-matching pieces are pasted into the prompt. Delete the index and the model knows nothing about your files again.
Why does the model say it can't find something that is clearly in my PDF?
Usually the retrieval step failed, not the model. The wrong chunks were pulled, or the PDF is a scan with no real text layer. Check that you can select text in the file, then try rephrasing the question using the words the document itself uses.
Can I use RAG on scanned documents?
Only after OCR. A scanned PDF is a picture of text, and the embedding step needs actual characters. Run it through an OCR tool first, then index the result.
How many documents can a home setup handle?
Hundreds of ordinary PDFs are fine on a normal desktop. Indexing is the slow part, and it happens once per file. Search speed stays quick; what degrades first is answer quality when many similar documents compete.
Is a bigger chat model or a better embedding model more important?
For finding the right passage, the embedding model and your chunk settings matter more. For writing a good answer once the passage is found, the chat model matters. Upgrade the retrieval side first if answers cite the wrong places.
Is my data really private?
If the chat model, the embedding model and the interface all run on your machine, nothing leaves it. Switch off any web search or external API option you do not need.