Every "chat with your PDFs" demo looks good in a screenshot. Ask a question, get a confident paragraph. The screenshot does not tell you whether the answer came from the document or from the model's memory.

For document work that matters, contracts, policies, reports, citations are the product. An answer you cannot check is a liability, not a feature.

What grounding actually requires

Three things have to be true before an answer is trustworthy:

  1. The retrieved passages are relevant. If retrieval returns the wrong pages, a fluent answer is still wrong. Retrieval quality is the ceiling on answer quality.
  2. The answer is constrained to the passages. The prompt has to say: use only this context; if the context does not contain the answer, say so.
  3. The passages are shown with the answer. Not a link at the bottom. The specific chunks, with their source file and a usable excerpt.

The third one is the one most demos skip, and it is the cheapest to implement.

A practical structure

A small local RAG app can be built without a vector database, which removes a lot of setup for personal and small-team use:

  • Split documents into overlapping chunks, for example 800 characters with 100 characters of overlap, so a sentence is not cut in half at a boundary.
  • Keep the chunk text and its source label together from the start. Retrofitting provenance later is painful.
  • On each question, score chunks against the question, take the top few, and pass only those to the model.
  • Instruct the model to answer from context only, and to reply "not in the provided documents" when the context does not cover it.
  • Render the sources next to the answer, so a reader can open the chunk and check.

The honesty rule matters more than the model choice. A smaller model that says "I do not know" is more useful than a larger one that invents a clause.

Where the documents go

This is the question buyers ask first, and it deserves a precise answer:

  • With a local app, documents stay on the machine running it.
  • Only the retrieved passages are sent to the model API for that question.
  • No third-party vector store receives the corpus.
  • The API key is the user's own, so billing and access sit with them.

If any of those is not true, say so on the product page. "Private" is not a marketing adjective; it is an architecture claim that can be checked.

What to test before trusting it

  • Ask a question whose answer is in one paragraph. Confirm the shown source contains that paragraph.
  • Ask a question the documents do not answer. The correct behaviour is a refusal, not a guess.
  • Ask a question with two plausible passages. Confirm the answer does not merge them into something neither says.
  • Search for a name that appears in a different document. Confirm retrieval does not pull the wrong file.

These four checks catch most of the failure modes that a demo screenshot hides.

The version I packaged

I built a local document Q&A app in Streamlit, with retrieval in-process and answers through the user's own Anthropic key. It shows the source passages next to every answer, and the README covers setup, usage and the limits. It is intentionally small: one Python file you can read before you run it.

Source is $19 with an MIT licence: https://takbirzaman.gumroad.com/l/rag-chatbot

You do not need this specific app. You do need the source panel. If your document assistant cannot show you where an answer came from, treat the answer as a draft, not a fact.