Most RAG guides spend their pages on chunk sizes and overlap percentages. Fair enough — but chunking strategy is the second step. If what you feed the chunker is raw PDF extraction full of page headers, broken reading order, and shattered tables, no overlap setting will save you. Retrieval quality is decided at pre-processing.
Two reasons. Structure: heading-aware splitters (LangChain’s MarkdownHeaderTextSplitter and friends) are the easiest reliable chunkers to operate, and they need Markdown headings to exist. Density: tokens spent on format noise are tokens not spent on content — in our measurements, Markdown versions of the same documents run 53–75% smaller than native formats, which means cheaper embeddings and more content per retrieved chunk.
Milldown handles the front half of this pipeline on your Mac. Drop a folder of mixed PDFs, Word files, and decks (scans get OCR’d on-device), then use RAG chunk export: heading-aware chunks with YAML front matter carrying the source filename, section path, and a SHA-256 of the source — or JSONL, one chunk per record, ready for your embedding script. The user guide covers both shapes.
Privacy bonus: because conversion, OCR, and chunking all run locally, sensitive corpora never touch a third-party converter on their way into your vector store. The first external service your documents meet is the embedding endpoint you chose — or none at all, if you embed locally too.
Start with one chunk per leaf section (whatever sits under a single heading), cap around 800–1,000 tokens, and only add overlap if your sections are long and unstructured. Then evaluate on your own queries — the best chunking config is corpus-specific, and a clean Markdown corpus makes re-chunking a five-minute experiment instead of a re-ingestion project.
Convert, clean, and chunk your documents entirely on your Mac — with provenance metadata attached. Free for 14 days.
Get Milldown for macOSmacOS 14+ · Apple Silicon · $39 one-time after trial (excl. VAT) · no subscription