Blocks

Extract

The AI Agent's extract task: declare fields inline and pull them out of upstream text or an uploaded document with AI vision — results auto-saved with confidences.

Declare the fields you want — name, type, required — and the AI pulls them out of upstream text or an uploaded document (PDF or image, read with AI vision). No prompt writing: the fields are the contract.

Config

The extract task in the Inspector A fields table is the whole schema — one row per value to pull out.

  • Extract fromdocument reads an uploaded file with AI vision (pair with a file upload trigger); text extracts from upstream text.
  • Fields to extract — one row per field: a name (borrower_name), a type (string / number / date / currency / boolean), and whether it's required.
  • Document type — optional label ("Invoice") stored on the saved extraction result.

Output

Slug-keyed fields, each with its value and provenance:

{ "fields": {
    "invoice_number": { "value": "INV-2041", "confidence": 0.98, "page_number": 1 },
    "total": { "value": 1250.00, "raw_value": "$1,250.00", "confidence": 0.95, "page_number": 2 }
  },
  "missing_required": [],
  "document": { "filename": "invoice.pdf", "": "…" } }

Downstream, reference {{ payload.fields.total.value }}. Any required field the document doesn't contain lands in missing_required — branch on it to route incomplete documents to a human.

Document extractions auto-save their result — fields, confidences, source document, and run are persisted together, no separate save step needed.

Patterns

  • Invoice intake — file upload → extract (number, total, due date) → branch on missing_required → save to store.
  • Email parsing — email trigger → extract from text (order id, customer, issue) → look up the order.

Gotchas

  • Types are enforced on the way out — currency returns a number (raw_value keeps the original string), date normalizes.
  • Extraction confidence is per-field: gate high-stakes automation on it ({{ payload.fields.total.confidence }}) rather than trusting every read.