Most teams debugging a disappointing RAG system start at the end of the pipeline. They swap the model, tune the prompt, raise top k. The answer quality barely moves, because the problem arrived long before the query did.

A retrieval system can only return what it indexed. Everything downstream inherits whatever the ingestion step produced, and no amount of reranking repairs a chunk that was scrambled on the way in.

Ingestion Sets The Ceiling

Parsing is the step most teams underestimate. Plain text and Markdown are simple. PDFs, which hold the majority of enterprise knowledge, are not. Multi column layouts, repeating headers and footers, tables whose cell boundaries are implicit, images with text baked in, nested sections with inconsistent formatting. Naive extraction with a general purpose library produces text with merged columns, broken paragraphs and lost table structure.

The damaging part is that a bad parse does not throw. It becomes a chunk, gets embedded, and sits in the index looking exactly as trustworthy as everything around it. Layout aware parsers exist for this reason, and so does the cleaning pass that strips boilerplate, page numbers and repeated headers before anything gets embedded.