An Agent Needs a Clean Document: Why Extraction Matters More Than the Model

Microsoft explains why AI agent success depends on accurate PDF and scan extraction, and where pilots fail.

  • The occasion: Microsoft returns to PDF analysis
  • Five years of LLMs, but the documents are still the same
  • Where the agent fails
  • How the extraction layer works

The occasion: Microsoft returns to PDF analysis

The authors' main point is that enterprise AI success depends on whether the agent can trust the content it works with.

In their assessment, model selection has less impact on the outcome

I agree, and I would add from my experience as an integrator: in an AI project, most of the work goes into parsing PDFs, scans, and supplier exports.

At this stage, the project either delivers results or quietly shuts down.

Five years of LLMs, but the documents are still the same

  1. Microsoft puts it plainly: large language models have existed for five years; during that time, the models have become stronger, while the content has become messier.

  2. The authors estimate that the main engineering task is to turn a raw PDF, image, or audio file into verifiable information that the agent can act on.

  3. Content extraction is the layer between the file and the model.

  4. It recognizes text, reconstructs the structure (headings, columns, and tables), extracts fields, and records where each value appears in the source.

  5. The PDF specification alone, ISO 32000-2, spans about a thousand pages. A price list looks like a neat table on screen, but inside the file it is stored as a set of separate text fragments with coordinates.

  6. That same week, Microsoft released version dotnet-1.23.0 of its Agent Framework.

  7. Frequent releases show that vendors have made agent orchestration a standard library for C# / .NET and Python.

  8. A team can build an agent in a day, but it cannot teach it to read company documents correctly in that time.

Where the agent fails

  1. Consider a typical scenario: an agent receives a supplier invoice or specification and enters the items into 1C.

  2. Errors can occur at the input stage: - in a table with merged cells, the parser mixed up the row order, assigning one item's price to its neighbor; - in a scan, a stamp obscured a digit, and OCR read "8" as "3"; - in an Excel export, the unit of measure appears in the column heading, so "12" without context could mean either pieces or boxes.

  3. A model's reasoning error is usually immediately apparent.

  4. A poorly extracted document produces a plausible answer with an incorrect figure, and the agent confidently enters it into the accounting system.

  5. The result is an incorrect storefront price, inventory discrepancies, and manual reconciliation after the fact.

  6. After a couple of such incidents, the CFO shuts down the pilot, and it is hard to blame them.

How the extraction layer works

  1. ### Structure analysis First, the system reconstructs the page layout: reading order, columns, tables, and captions.

  2. For scans, OCR is added to the process.

  3. The step's goal is for a 40-row table to remain a 40-row table with the same relationships between cells. ### Normalization

  4. The system then maps values to the company's reference data: SKUs to the item master, units of measure to base units, and dates to a single format.

  5. This requires master data, so the step's outcome depends on the quality of PIM and master data. ### Linking to

Source

Each field stores a link to the page and coordinates in the source document. Microsoft calls this grounded, verifiable information.

An employee clicks the price and sees where it came from

RAG (searching the knowledge base before the model responds) works with the same fragments, so answer quality also depends on parsing. ### Confidence threshold

The system sends fields with low recognition confidence to an operator; the rest are processed automatically.

The team confirms the rules, and the share of automated processing gradually increases.

No one is betting that the model will "figure it out on its own."

Assess where AI can deliver impact in your process

What This Means for Business

A rule from my own practice (not Microsoft's): before comparing models, take 50 real documents from your workflow and measure extraction accuracy for each field. If the price and SKU are extracted less accurately than accounting requires, a more expensive model will not solve the problem. TTU (time to use) in such projects determines how quickly the team gets clean input data. A demo with three polished PDFs will not reveal this metric.

How we address this

In KT.Team projects, content extraction is most often needed when populating a catalog.

Suppliers send price lists, specifications, and product passports, while the output must be an item record in Pimcore or Akeneo.

We extract attributes from files, classify products by taxonomy, build facets for catalog filters from those attributes, and generate product-card text only from verified fields.

Each value stores a link to the source, so a content manager can open a disputed section in seconds without rereading the entire document.

We build the infrastructure around this.

LLM & Security Gateway masks personal and commercial data before sending it to the model and logs every call.

Through MCP, the agent accesses data that has already been extracted and normalized; raw files never reach it.

We select the model for the environment:

  • for the CIS environment, this is GigaChat
  • YandexGPT or Qwen on your own servers
  • for other tasks - Claude
  • OpenAI

When the extraction layer is well designed, replacing the model takes about a day.

Verdict

  1. Five years after the start of the LLM era, Microsoft is returning to PDF parsing, and that is an honest signal to the market.

  2. Vendors are quickly turning models and agent frameworks into standard components.

  3. The advantage will go to the company whose agent reads an invoice as accurately as an experienced accountant and shows exactly where it found each figure in the document.

  4. If an AI project's budget goes toward model selection and nothing remains for document analysis, the pilot will end with incorrect figures in the accounting system.

Source

Why content extraction still matters in the GenAI era - Azure AI team, Microsoft Foundry Blog. Microsoft material; all rights belong to the author.

Discuss the article: An Agent Needs a Clean Document: Why…

Enter your email or phone number so we can get back to you.

Send via: