AI integration

How AI document extraction works, and when to build it.

If someone in your business spends part of each day reading documents and typing what they say into another system, AI document extraction can take on much of that reading. Whether it should depends on your documents, how many arrive, and what happens when it gets one wrong.

By SETITUP ยท Updated

What AI document extraction is

AI document extraction is software that reads a document, such as a PDF, a scan, or a photo taken on a phone, and returns the details you care about as named fields: supplier name, document number, date, line items, total. Those fields can then be checked and saved into a system without anyone retyping them.

It helps to separate it from OCR (optical character recognition). OCR turns an image of a page into text. Extraction goes a step further and decides which piece of that text is the document number, which is the due date, and which rows make up the line items. Older extraction tools often relied on a template for each layout, so a new sender meant a new template. Tools built on large language models can often read layouts they have not seen before, which is what makes the approach practical for businesses that receive documents from many different senders.

It is not always right, and it is not always the best option. This guide covers how a working extraction feature is put together, where it goes wrong, and how to decide whether it is worth building for your documents.

How an extraction feature works, step by step.

  1. 1

    Intake

    Documents arrive from wherever they already arrive: an email inbox, an upload form, a shared folder, or a phone camera. The system stores the original file, because every later step should be able to point back to it.

  2. 2

    Read the document

    The page is turned into something a model can work with. Anthropic, for example, documents that its Claude models receive each PDF page as an image along with the text extracted from that page, so layout and tables are visible as well as the words.

  3. 3

    Extract into a fixed schema

    The model is asked for a defined set of fields with defined types, not a free-text summary. Some model providers can enforce the shape of the output against a schema, which removes a class of formatting errors. A correct shape does not mean correct values, so the next step still matters.

  4. 4

    Check with rules

    Ordinary code checks what the model returned. Do the line items add up to the total? Is the date a real date? Does the sender exist in your records? Does the reference number match an open order? These checks are cheap and predictable, and they can catch errors before a person needs to look.

  5. 5

    Human review where it matters

    Anything that fails a check, and any field that carries real risk, such as bank details or amounts above a limit you set, goes to a review queue. The reviewer sees the document and the extracted fields side by side and confirms or corrects them.

  6. 6

    Save and keep the trail

    Approved data is written into the system that needs it, such as your ERP, accounting software, or CRM. The record keeps a link to the original document and notes who reviewed it, so anyone can check later where a number came from.

Where extraction goes wrong

Read what providers publish about the limits. Anthropic's documentation for its vision features, for example, says its models can make mistakes when reading low-quality, rotated, or very small images, and advises against using them for tasks that need perfect precision without human oversight. Its PDF guidance recommends clear, legible text, standard fonts, and pages rotated upright.

In practice, the quality of what goes in shapes what comes out. A clean PDF generated by a supplier's accounting software is a very different input from a creased delivery note photographed on a warehouse floor. Handwriting, stamps over text, tables that run across several pages, and documents that mix languages, such as Arabic and English, all deserve testing on real examples before anyone relies on them.

Schema enforcement has limits too. Anthropic notes that output may not match the requested schema when a request is refused or cut off by its token limit. Well-built software treats those cases as failures and sends the document to review, instead of saving a half-finished record.

None of this is a reason to avoid extraction. It is a reason to design for checking from the start, rather than adding it after the first costly mistake.

Is it worth building?

Use this table as a first filter. If most of your answers fall under the simpler option, start there.

FactorExtraction is likely worth buildingA simpler option is likely better
VolumeDocuments arrive every day, and retyping them is a real part of someone's jobA handful of documents a week that one person handles quickly
VarietyMany senders and layouts, too many to template one by oneOne or two fixed layouts that a template or a simple parser can read
FormatThe information only exists as PDFs, scans, or photosThe sender can provide a CSV, a spreadsheet export, or an electronic invoice file
DestinationThe data has to land in a custom or connected systemYour accounting or expense tool already offers document capture that fits your documents
Cost of errorsRule checks and review can catch errors before they matterA single wrong value is costly, and every field would need checking anyway
What happens nextThe extracted data starts further work, such as matching, approval, or postingThe data is filed and rarely used again

Questions to answer before you build.

Work through these with whoever handles the documents today. The answers form most of a brief, whether you build in-house, buy a tool, or hire a team.

  • Which documents, and how many

    List each document type, who sends it, and roughly how many arrive in a month. Start with the type that takes the most time, not the one that seems most interesting.

  • Which fields

    Write down the exact fields you need from each document, and the ones you can ignore. Fewer fields means less to check.

  • Where the data goes

    Name the system each field ends up in, and whether that system can accept data from another system or needs someone to enter it.

  • Which rules already exist

    Totals that must match, senders that must be approved, orders that must be open. Every rule you can write down is a check the software can run.

  • Who reviews, and when

    Decide which fields always need a person, which only need one when a check fails, and who that person is.

  • What your test set looks like

    Collect a sample of real documents, including bad scans and unusual layouts, and record the correct answers. That sample is how you judge any tool or build.

  • What the data rules are

    Agree which documents may be sent to an outside AI provider, where they may be processed, and how long they are kept. Raise any compliance needs before anything is built.

How we would approach it

We would start with the test set, not the model. A sample of real documents with known correct answers lets you compare options honestly, including packaged capture tools, and shows which fields come back reliably and which do not.

Next, we would build one document type end to end: intake, extraction, rule checks, a review screen, and the write into your system. Review would be on for every document at first. As results on your own documents build up, you can decide which fields are safe to accept without a person looking, and keep review on for the rest.

What drives the cost is scope: how many document types and layouts, how many fields, how messy the inputs are, how many checks and integrations are needed, and how the review screen has to work. There is also a running cost, because AI providers charge by usage. Anthropic's documentation, for example, explains that the cost of processing a PDF depends on how much text it contains and how many pages it has. Both can be estimated once the questions above are answered.

Sometimes the honest answer is that you do not need a custom build. If your documents are standard supplier bills and your accounting software already reads them well, use that. Custom extraction earns its place when the documents are specific to your business, or when the extracted data has to feed approvals, matching, or systems a packaged tool cannot reach.

Common questions

Can AI extraction run without anyone checking the results?

For some fields, possibly, once results on your own documents show they come back reliably and rule checks catch the exceptions. For high-risk fields such as bank details or large amounts, we would keep a person in the loop. Anthropic, for example, advises human oversight for tasks that need perfect precision.

Can it read handwriting, photos, and poor scans?

Sometimes, but quality matters. Anthropic's documentation, for example, warns of mistakes on low-quality, rotated, or very small images. The only reliable way to know is to test a sample of your own documents before committing to a build.

Can it feed the software we already use?

Often, yes, depending on how that software is built and whether it can accept data from another system. We check that first and tell you plainly what is practical.

What happens to our documents?

That is agreed before anything is built: which documents may go to an AI provider, which provider, where data is processed, who can access it, and how long it is kept. Tell us about any compliance requirements early.

Let's talk about what you want to build.

Walk us through your idea or what is not working today. You leave the call with a recommended first step.