Use case / Document processing agents

See which page each field came from.

Extraction agents read invoices, contracts and forms, and one wrong field can slip through. Trace page to field so every value can be checked against where it came from.

Pages
Traced
Fields
Linked
Reviews
Recorded

Extraction record

Each field, with its page.

  1. Every file becomes a trace, so any filed value has a history.

  2. Page splits show which pages were hard to read.

  3. Each field is a span with the text the model saw.

  4. A wrong or low-confidence field is flagged on its page.

  5. Review handoffs are recorded, so you see what people fixed.

Document processing agents1 / 5 steps
  1. 01

    File received

    A 6 page supplier invoice, PDF.

    ok
  2. 02

    Pages split

    Page 3 is a scan with low contrast.

    ok
  3. 03

    Fields extracted

    Eleven fields, one with low confidence.

    ok
  4. 04

    Total read wrong

    The subtotal was read as the total.

    misread
  5. 05

    Sent to review

    The field is queued for a person.

    ok

The failure to catch

An invoice total read from the wrong line, and filed as correct.

Trace extraction from page to field so a misread amount or a missed clause points back to the step that got it wrong.

What Tracify watches.

01

Pages read

Recorded on every run, so it can be searched, compared and alerted on.

02

Fields extracted

Recorded on every run, so it can be searched, compared and alerted on.

03

Confidence per field

Recorded on every run, so it can be searched, compared and alerted on.

04

Review handoffs

Recorded on every run, so it can be searched, compared and alerted on.

Instrument it

Make every field traceable to its page.

Record the read and the extraction as separate spans, and a wrong field shows the text the model saw.

$ npm install tracify-sdk

import { span, traceAgent } from "tracify-sdk";

export const extract = traceAgent(async (fileId: string) => {
  const pages = await span("read-pages", () => readPages(fileId), { type: "tool", input: fileId });
  const fields = await span("extract-fields", () => extractFields(pages), { type: "llm" });
  return span("validate", () => validate(fields), { type: "tool" });
}, { environment: "production" });