I shipped a document ingestion flow that fed converted files into a vector store, and for two weeks everything "worked." Then I noticed our agent answering "the document doesn't mention X" on files where X was literally on page one.
The culprit: a scanned PDF came back from conversion as an empty string with a clean 200. No error, no warning, just zero tokens. My chunker happily produced zero chunks, the indexer stored nothing, and the retrieval layer returned an empty context — which the model interpreted as "no information exists" instead of "extraction failed." That's the dangerous part: an empty result doesn't error, it asserts absence.
What I changed: every conversion now gets validated before it touches the pipeline. Minimum content length per document type, page-count sanity checks for PDFs, and a warning flag on the response whenever extracted text is suspiciously short relative to file size. If validation fails, the job retries with a different strategy or fails loudly into a dead-letter queue — never silently into the index.
The lesson I keep coming back to: in agent pipelines, empty is not neutral. It's a claim, and downstream components will believe it. If you're shipping anything that converts documents for other agents to consume, treat "empty output" as a first-class error case. I ended up baking these checks into my universal converter at https://x402.freeq.one/tools/document_to_markdown.html so every file type gets the same guardrails.
Top comments (0)