A customer asks your AI assistant about a refund, and it answers with total confidence, quoting a policy that was retired two years ago. Nothing about the AI changed. The file was never cleaned on the way in. Chapter 33 of the Deployed Lab course is about that front door: document ingestion, everything that happens to a file before an AI can search it, and the stage where most bad answers are actually born.
The mailroom before the shelf
The chapter's picture is a mailroom that opens every parcel, reads it, labels it, and only then puts it on the shelf. Ingestion is that mailroom for files. Raw files arrive in whatever shape people left them: PDFs, Word docs, help centre pages, spreadsheets, decks, tickets and scans. A parser pulls the text out of files that carry real text. Scans are only pictures of text, so OCR, software that guesses words from a picture, reads those. Then the text is cleaned: headings and reading order restored, page numbers and other furniture stripped. Every chunk gets tagged at the door with its title, source, date, version and who may read it, while those facts are still known. Copies are collapsed to one, old editions are marked retired, and only then is the cleaned text cut into chunks and stored where search can find it. Anything that fails a step drops into a failure queue, with a reason, for a human to look at.
Where the mess gets in
Skip the mailroom and each file type breaks in its own way. A pricing table split across two pages comes back with its columns scrambled, because the column headings stayed behind on page one: the numbers survive, their meaning does not. A scanned contract returns no text at all. A tilted, faint scan can turn "30 days" into "3O days", and search finds nothing. In the chapter's case, a support team connected an assistant to a shared drive of 12,000 files with none of this done. A week later the retired refund policy was being quoted to a customer, because the old edition sat in the index as an equal of the current one, and nothing told the ranking which one was alive.
The first clean-up, counted
When the team finally ran the files through the door properly, the counts told the story. Of the 12,000 files, 612 failed to produce text at all, mostly scans and two corrupt archives. Another 1,480 were duplicates, about 12 percent: the same handbook in three folders, plus an email attachment making a fourth. After cleaning, 214 files landed in the failure queue with reasons attached: 96 unreadable scans, 58 with no owner, 41 with tables too broken to trust, and 19 with no access tag that could be set. What survived, 9,694 files, produced the searchable chunks. The queue, the chapter argues, is the real deliverable of week one: it turns "the search is bad" into a list a team can work through, owner by owner. And it stays cheap to run: each night, a fingerprint of each file is compared, so only changed files are reprocessed, 410 out of 12,000 on a typical night, instead of all of them.
Why it matters
Every AI search and support tool is built on files somebody already has, and those files are messy in exactly these ways. When the assistant gives a wrong answer, the instinct is to blame the model or the search. The chapter's claim is that most retrieval bugs blamed on search were born at the front door, in the shape ingestion left the files. Clean, tag and retire at the door, and the wrong page never gets read in the first place.
Sources: Deployed Lab course, Chapter 33: Document ingestion: from messy files to searchable chunks. The 12,000 file case is the chapter's own composite teaching example.
Go deeper
Chapter 33 of the Deployed Lab course walks the full path from raw file to searchable chunk: where parsing and OCR fail, the metadata every chunk must carry from day one, dedupe and versioning with numbers, and a hands-on lab where you triage eight messy documents yourself. The full interactive course library, 193 chapters across five courses, is at deployedlab.dev, with 79 chapters free and no signup.