AI development RAG Over Messy PDFs: OCR, Structure-Preserving Chunking, and Incremental Re-indexing Every RAG demo works on a clean PDF. Then you point it at a decade of scanned contracts and it returns confident nonsense. The chunk is the unit of retrieval, and three moves decide whether yours are any good before the model ever runs.