Document Classification

The classifier identifies the type of each PDF you send and returns a confidence score and metadata tags. Workflows use the result to route the document.

Overview

The Classifier is a workflow node that reads a document and assigns it one of the classes you define.

You configure your Classifier Agent with the document classes you need: system classes such as bank statements and tax forms, custom classes of your own, or both.

Document
PDF file
Classifier Agent
Your custom classes
Bank Statement
Confidence:98%

Classifier Agent

A Classifier Agent is the building block for document classification in your workflows. Each agent is configured with:

Classes Configuration

Define which document types your classifier can identify. System and custom classes can be mixed.

Classification Rules

Add global rules to guide classification logic, handle edge cases, and disambiguate between similar document types.

Confidence Scores

AI confidence (0-1) indicating classification certainty. Route documents to human review when confidence is low.

Workflow Routing

Use classification results to route documents to different extractors or processing steps in your workflow.

System Classes

System classes come with tuned classification prompts. Add them to your Classifier Agent for common financial document types:

ClassDescription
bank_statementMonthly or quarterly bank account statements with transactions
fr_bilan_actifFrench balance sheet - Asset side
fr_bilan_passifFrench balance sheet - Liability side
fr_compte_resultatFrench income statement
fr_cerfa_2033_aFrench tax form - Simplified balance sheet (assets)
fr_cerfa_2050French tax form - Full accounting balance sheet (assets)
de_susaGerman trial balance (Summen- und Saldenliste)
be_interne_jaarrekening_bilan_actifBelgian internal annual accounts - Balance sheet (Activa)
be_interne_jaarrekening_bilan_passifBelgian internal annual accounts - Balance sheet (Passiva)
be_interne_jaarrekening_compte_resultatBelgian internal annual accounts - Income statement (Resultatenrekening)

System classes automatically expand to include all supported year versions (e.g., fr_cerfa_2050 includes 2023, 2024, 2025 variants).

Classification tell-tales: BE Interne Jaarrekening

Belgian interne jaarrekening documents are not deposited at the NBB and vary in layout. The classifier relies on a combination of signals to distinguish them from French balance sheets or NBB-deposited accounts:

  • Dutch financial vocabulary: Balans, Activa / Passiva, Resultatenrekening, Boekjaar, Eigen vermogen, Vaste activa, Vlottende activa, Handelsvorderingen, Handelsschulden, Omzet, Bedrijfsresultaat, Winst of verlies.
  • NBB rubric codes in the line items: composite codes like 20/58, 21/28, 29/58, 10/15, 10/49, 42/48, 170/4, 60/66A, 70/66, 70/67, 600/8, 640/8, 630/1. These are unique to the Belgian PCMN.
  • Schema type markers: explicit mentions of micro-schéma / microschema, schéma abrégé / verkort schema, or schéma complet / volledig schema in headers or footers. Maps to the schema_type metadata (micro, abrege, complet).
  • Belgian VAT format: BE0123456789 (BTW-nummer / numéro TVA) near the company header.
  • Absence of NBB deposit markers: no "Jaarrekening neergelegd bij de Nationale Bank van België" footer, no 8-digit NBB deposit number. Distinguishes interne from neergelegde accounts.
  • Bilingual (FR/NL) column headers: many internal templates expose both languages side-by-side, unlike purely French or purely Dutch NBB filings.

Custom Classes

Create custom classes for document types specific to your business. Each custom class needs:

  • Name - A clear, descriptive identifier (e.g., "Supplier Invoice", "Quarterly Report")
  • Description - Instructions for the AI on how to identify this document type

The more detailed your description, the more accurately the classifier will identify your documents. Include visual cues, structural patterns, and distinguishing characteristics.

Result Structure

When classification completes, the result includes the identified document type and confidence score.

Classification Result

{
  "classification": "bank_statement",
  "confidence": 0.95,
  "reasoning": "Document contains bank account header with IBAN, date range, and transaction list with debits/credits columns typical of bank statements"
}

Result Fields

FieldTypeDescription
classificationstringThe class name matching one of your configured classes
confidencenumberAI confidence score between 0 and 1
reasoningstringAI explanation for the classification decision

API Configuration

When using the Workflow Runs API, classifier node results include the agent configuration used for the classification.

Classifier Node Run

{
  "node_type": "classifier",
  "config": {
    "classifier_id": "ca_8kL2mNpQ4xYz",
    "classifier_name": "Invoice Classifier",
    "classes_config": [
      {
        "name": "invoice",
        "is_system_type": true,
        "system_type_key": "invoice"
      },
      {
        "name": "receipt",
        "is_system_type": false,
        "description": "Purchase receipts from retail stores"
      },
      {
        "name": "contract",
        "is_system_type": false,
        "description": "Legal agreements and contracts"
      }
    ],
    "classifier_rules": "When in doubt between invoice and receipt, check for tax ID presence"
  },
  "results": {
    "classification": "invoice",
    "confidence": 0.95,
    "reasoning": "Document contains invoice header, line items, and total amount"
  },
  "status": "completed",
  "started_at": "2024-01-15T10:30:01Z",
  "completed_at": "2024-01-15T10:30:03Z",
  "duration_ms": 2000
}

Config Fields

FieldTypeDescription
classifier_idstringUnique identifier for the Classifier Agent (prefix: ca_)
classifier_namestringDisplay name of the Classifier Agent
classes_configarrayClass definitions for the classifier
classes_config[].namestringClass name identifier
classes_config[].is_system_typebooleanWhether this is a pre-built system class
classes_config[].system_type_keystringSystem type key (present when is_system_type is true)
classes_config[].descriptionstringCustom description (present when is_system_type is false)
classifier_rulesstringGlobal rules to guide classification logic and handle edge cases