Why chunking decides answer quality
A local retrieval-augmented assistant does not read your whole document library when someone asks a question. It searches an index of small pieces of text, picks a handful that look relevant, and hands those pieces to the language model. If the pieces are badly cut, the model receives half a procedure, a table without its header, or a paragraph that only makes sense next to the one before it. The model then does its best with incomplete material, and the answer sounds confident while missing the point.
Most teams spend their first week comparing models. In our experience, an afternoon spent on how documents are split often improves answers more than switching models. This note describes a practical way to choose a chunking approach for a small office knowledge base running entirely on local hardware.
1. Start from the structure your documents already have
Office documents usually have structure: headings, numbered steps, tables, FAQ entries. Use it. Splitting on headings and paragraphs keeps related sentences together far better than cutting every fixed number of characters. A sensible default is to treat each section under a heading as a candidate chunk, then split long sections at paragraph boundaries.
Keep the document title and the heading path with every chunk. A piece of text that begins "Section 3.2 Expense claims > Travel" is easier to retrieve and easier for the model to interpret than the same paragraph with no context. It also lets the assistant show a useful citation.
2. Pick a size range, not a single magic number
There is no universal best chunk length. Short chunks match precise questions well but lose context; long chunks carry context but dilute the match and use more of the model's context window. Choose a range that fits your material, for example a few short paragraphs, and allow a small overlap between neighbouring chunks so a sentence that straddles a boundary is not lost.
Remember that whatever you retrieve has to fit in the model's context alongside the question and the instructions. On a machine with limited graphics memory, a smaller number of well-cut chunks is better than many long ones. If you are still deciding which hardware can hold which model and context length, the device-to-model matching guide is a good place to check before you design around a limit you do not have.
3. Treat tables, lists and scans separately
Tables are the most common failure. When a table is flattened into plain text, the column headers end up far from the values. Convert small tables into sentences or keep each row together with its header. Numbered procedures should usually stay in one chunk so the steps arrive in order. Scanned PDFs need OCR first, and the OCR output deserves a quick human look on a sample before you index the whole archive; poor scans produce poor answers no matter how clever the splitting is.
4. Test with real questions before you index everything
Build a small test set: fifteen to twenty questions that colleagues really ask, each with the document and section where the correct answer lives. Index a representative sample of documents, run the questions, and look at which chunks were retrieved, not only at the final answer. If the right section is not in the retrieved set, no model will fix it. Change one thing at a time, such as the size range, the overlap or the way headings are attached, and re-run the same questions.
Write down what you tried and what happened. This record is what lets the next person understand why the index is built the way it is.
5. Plan for updates
Documents change. Decide how the index is refreshed when a file is edited or deleted, and make sure removed documents disappear from search. A step-by-step setup for a fully local pipeline, including indexing and refresh, is covered in our local RAG knowledge base tutorial.
A short checklist
- Split on headings and paragraphs first; fixed-length cutting is a fallback.
- Attach the title and heading path to every chunk.
- Use a size range with a small overlap, and respect the context budget.
- Keep table rows with their headers and procedures in one piece.
- Test retrieval with real questions before tuning the model.
- Refresh the index on a schedule and remove deleted files.
Good chunking is unglamorous work, but it is the part of a private document assistant that users notice most, because it decides whether the answer comes from the right page.