Why Better RAG Starts With Better Ingestion

Part 2 of 6: Building a production retrieval layer, one failure at a time. TL;DR: Same 5,000 documents. Same embedding model. Same top-5 retrieval, same prompt, same everything downstream. I changed only the ingestion pipeline — structure-aware chunking, provenance on every chunk, and explicit supersession — and the parental leave bug from Part 1 became impossible rather than unlikely. Here is the rebuilt pipeline, the schema, and an honest account of what this approach still cannot do. Where we are The system currently does this: extract text from a document, cut it into 512-token pieces, embed each piece, store the piece and its vector in Postgres, retrieve the five nearest to a question
…