Codewerk.
Get a quote
Home/Blog/Building a RAG assistant on your own documents

Building a RAG assistant on your own documents

The model is the easy part. Chunking, retrieval and the honest 'I don't know' are what separate a useful assistant from a liability.

Photo: free stock photography (Unsplash licence) — see imprint

Chunking decides everything

Split a datasheet in the middle of a table and every answer built on it will be wrong. Chunk along document structure — headings, table rows, sections — not by a blind character count. This unglamorous step determines most of your final quality.

Retrieval, then generation

If the right chunk is not retrieved, the best model on earth will confidently make something up. Measure retrieval separately: for 50 real questions, is the correct passage in the top five? Fix that before you touch prompts.

Always cite, always allow 'no'

Every answer should link the source document, and the system must be allowed to say it does not know. An assistant that invents a torque value is worse than no assistant — someone will tighten a bolt to it.

Keep your data in your house

Quotes, prices and customer names are not training material for someone else's model. Use an endpoint with a no-training guarantee, or self-host — and write down which data leaves the building. Your DPO will ask.

Key takeaways
  • Chunk along structure, never by character count.
  • Measure retrieval before you tune prompts.
  • An assistant that cannot say 'I don't know' is dangerous.

We do this for a living — Shopware, Node.js, React, ERP integration and automation for B2B.

Talk to an engineer

// Keep reading

Related articles

AI & Automation 9 min

AI in e-commerce: what actually works in 2026

Product descriptions, search, support triage, forecasting. Three of those pay for themselves. We separate the working from the pitching.

25 Mar 2026 Codewerk Team