When we build AI agents to interact with unstructured documents, we often focus on the extraction logic—the prompts, the schema definitions, and the LLM temperature. But as anyone who has moved a prototype into a production pipeline knows, the most brittle part isn't the reasoning; it's the retrieval mechanics.
I recently encountered a scenario involving a document extraction tool designed to parse Markdown structures. On paper, the capability set looks straightforward: extracting fenced code blocks (triple backticks), handling indentation (4 spaces or tabs), and pulling inline code via single backticks. However, looking under the hood reveals a more complex reality regarding structural integrity and error recovery.
The Reality of Fragmented Data
In a perfect environment, an extractor pulls exactly what you expect.…