LlamaIndex's Document Parsing Protocol: 140 rules for a correctly parsed page LlamaIndex published working draft 0.1 of its Document Parsing Protocol (DPP), a proposed answer key for document parsing containing 140 rules covering text, tables, forms, charts and diagrams, each with example pages and expected output. The protocol grew out of the rules LlamaIndex annotators followed when labeling pages for ParseBench, the company's document parsing benchmark, and specifies handling such as preserving multi-row table headers via HTML colspan, marking empty form fields as [blank], converting charts to tables of their numbers, and rendering diagrams as Mermaid code when possible. LlamaIndex argues that without a shared definition of a correctly parsed page, parsers can capture every word yet produce outputs that mean different things, causing agents to return wrong answers. Parsing a page into structured text or Markdown means making a run of judgment calls: - Is this block of aligned text a table, or just layout? - Does a header that spans two rows stay two rows, or get flattened into one? - Is a table that continues onto the next page one table or two? - Does a flowchart get described, converted to Mermaid, or skipped? Different parsers make different calls. So two parsers can capture every word on a page and still hand you outputs that mean different things. An agent works only from what the parser hands it, so if the parser groups a header wrong, the agent’s answer is wrong too. But there’s no shared definition of what a correctly parsed page looks like. The Document Parsing Protocol DPP is our proposed definition: an answer key for document parsing, with the reasoning behind each hard call. Today we're publishing working draft 0.1. Its 140 rules cover text, tables, forms, charts, diagrams, and more, and each comes with example pages and the output it expects. It grew out of the rules our annotators followed when labeling pages for ParseBench https://www.llamaindex.ai/blog/parsebench , our document parsing benchmark. The same table comes out three different ways Here’s a sales page with two header rows. The years run across the top, each spanning its own columns, and the quarters sit underneath. 2023 also has a full-year column. Three parsers might turn that table into Markdown like this, shown down to the first data row. Now ask an agent for Q2 2024 systemwide same-shop sales. - A pushed the quarters into the body, so the 4.1 % column has no year above it. The agent has to guess that it belongs to 2024. - C dropped the years, so “Q2” matches two columns: 3.8 % and 4.1 %. - B gets the right number, but only by inventing a label the page never printed: “2024 Q2”. Another parser might write “Q2 2024”, and code written for B would break on it. DPP counts all three as wrong. It keeps both header rows exactly as the page prints them. Markdown tables can’t show a header that covers several columns, so DPP uses an HTML table. Here’s DPP’s output for the same table: html