
From broker documents to matching-ready data
October 9, 2026 by Paul Ionescu

An insurance company that takes business from many brokers receives it in every shape a document can take: bank statements, payment slips, contracts, policy schedules. Some arrive digital, some scanned. They come as PDF, Excel and CSV, and every broker brings its own layouts and conventions.
Before any of it is useful, two questions need answers. What does this document actually say? And does it match what the company already knows about its policies, its customers and its records?
Today both answers are produced by hand: data is re-keyed out of documents, then checked against internal systems. The matching step cannot be automated while its input is a pile of unstructured files. And the traditional fix, training an extraction model per document type, collapses when there are hundreds of broker-specific layouts and new ones arrive every month.
So the problem worth solving first was the prerequisite: turn any broker document, including layouts nobody has seen before, into reliable structured data, without a model-training project per layout.
What we built
A reviewer drops in a PDF, an Excel file or a CSV and gets schema-shaped structured data back in minutes. The output is clean JSON and CSV with a confidence score on every extracted field, streamed live to the screen as it is produced and ingested into the parent company's systems, ready for matching.
The most important behavior is what happens at the edges. When the system meets a document type it has never seen, it does not fail. It asks.
The life of one document
Every document is first classified against a registry of known document types.
If the type is known, extraction runs against that type's registered schema, and the data comes out in exactly the agreed shape.
If the type is unknown, GPT-5 reads the document's layout and proposes a schema: the fields it can see, the tables, the data types. The reviewer refines that proposal in a live chat ("split the address into street and postcode", "the second column is the gross amount", "ignore the footer") and watches the schema update as they go. One click approves it into the schema registry, and extraction continues immediately.
From that moment the document type is known, and the next document like it flows straight through. New document types are taught by the people who understand the documents best, in minutes, with no model training and no data science team in the loop.

Under the hood
An upload hits the API, which stores the file and enqueues a job. A background service picks up the job and runs the stages, classify and then extract, writing durable per-run state after every stage.
The browser holds a Server-Sent Events connection, plain HTTP with no WebSockets, and receives progress updates, chat tokens and results as they happen.
Restarts are handled by design. If the process restarts mid-run, a recovery service re-enqueues every non-terminal run at boot. Each stage is idempotent and resumes from durable state, so nothing is recomputed and nothing is orphaned. That includes runs paused mid-conversation, waiting for a human to reply.
Around that pipeline sits a .NET 8 backend in Clean Architecture, an Angular 21 UI built zoneless and signals-first, Azure AI Document Intelligence for layout reading, and a schema registry on Azure Blob Storage.
Every LLM call goes through a model-agnostic interface, so swapping the model is a configuration change. Azure OpenAI GPT-5 is the current choice because it won our internal benchmarks on real documents, not because the architecture depends on it.
What we learned
LLMs need guards
Models do not always know when to stop. One vague refinement request on a table-heavy document produced a runaway response tens of thousands of characters long. Every model call now sits behind guards: output caps, response validation, and rejection of degenerate outputs before they reach a user.
Treat model output as untrusted input.
Strict schema output, everywhere
"Please respond in JSON" is a hope, not a contract. Every LLM call in the system uses strict structured outputs, which constrain the model to a JSON Schema it cannot violate. That contract is what turns a language model into a dependable API.
Human-in-the-loop refinement needs a grammar
Early on, each chat request made the model rewrite the whole schema. Small requests became full rewrites, and errors crept in along the way. The fix was to move the model onto a constrained grammar of small, field-level edit operations. Refinements became precise, auditable and easy to diff.
Let the human speak freely. Make the model answer in small, reviewable operations.
Dates and currencies lie without a locale
01/02/2026 and 1.234,56 mean different things in different countries, and broker documents arrive in mixed locales. Every document type in the registry carries locale metadata, so dates and amounts are interpreted against a declared locale rather than guessed per document.
Never let a model guess a decimal separator.
Benchmarking models is a project of its own
Public leaderboards will not tell you which model extracts your documents faithfully. Candidate models were benchmarked on real documents against our own metrics: extraction faithfulness (nothing missed, nothing invented) and latency. The results picked the model.
Benchmark on your own data, with metrics you define, and keep the harness so you can run it again when the next model ships.
Where this goes next
Structured data was never the end goal. It is the enabler. The next step the company wants automated is matching: checking extracted broker data against reference data such as customers, prior policies and claims.
The planned engine is deliberately hybrid. Deterministic rules written as code handle everything that must be exact: amounts, dates, policy numbers, thresholds. LLM-as-judge calls with strict structured outputs handle the fuzzy questions, such as whether "J. Smith, 42 Oak Ln" is the same person as "John Smith, 42 Oak Lane", backed by fuzzy search over an indexed copy of the reference data.
On top of that comes a chat interface over the extracted data, with inline charts, so a reviewer can ask questions instead of reading tables.
The short version
Unstructured broker documents in. Matching-ready structured data out. New document types taught by the people who review them, in minutes, with no model training.
If you are working on the same class of problem, with documents too varied to template and too important to guess, we would be glad to compare notes.
More Insights
We write about what we build, how we think, and the decisions that shape real digital products.










