Skip to main content
Version: v3.4 print this page

Schema

What Is a Schema?​

A schema defines what structured information ADI should pull from each document. It is the contract used by extraction models and by the Review Queue when reviewers validate results.

A workspace can have many schemas. Use more than one when the same PDFs should produce different templates or tabular views of the same data. Each schema has:

  • Its own Fields, Groups, and Tables
  • Its own Amorphic Redshift output dataset (created automatically from the schema name)
  • Its own status while that dataset is registered or updated

You create and edit schemas on the workspace Schema tab. They are not part of the workflow wizard. When you start a run, you choose which schemas that run should apply.

Info

Admins can create and edit schemas. Operators need Full Access or Editor to create or edit. Deleting a schema requires Full Access. Reviewers and users with Read Only access can view schemas but cannot change them.

Schema Statuses​

StatusMeaning
PendingThe schema and its output dataset exist. Redshift columns are not registered yet.
UpdatingADI is registering columns or applying an in-place column change. Edit and delete are disabled.
AvailableRegistration (or the latest update) and share finished. The schema can be used in a run.
FailedRegistration, update, or share did not complete. Edit the schema and save again after you correct the issue.

A new schema starts as Pending. After you save entries, ADI registers the output dataset. When that finishes, status becomes Available. You can edit an Available or Failed schema later; ADI applies column changes in place. You cannot edit while status is Updating.

How to Create a Schema​

Create schema

  1. On the Schema tab, click Create Schema.
  2. Under Schema, enter a Name (required) and optional Description.
    • Name must be alphanumeric, may include underscores, and must start with a letter (e.g., SupplierData).
    • Schema names must be unique within the workspace. Names are compared irrespective of casing (for example, InvoiceData and invoicedata are treated as the same name).
  3. Under Output Dataset, optionally enter a Name and Description.
  4. Optionally click Validate Dataset to confirm the output dataset name is available in your default Amorphic domain.
  5. Click Continue.
  6. Add Fields, Groups, and Tables (or upload a prepared schema).
  7. Click Save Schema.

If you do not enter an output dataset Name, ADI derives one from the schema name. ADI creates the schema and a pending output dataset, then registers the columns. Wait until status is Available before you include the schema in a run.

warning

The schema name cannot be changed after creation. You can still update the description and entries. The Output Dataset fields appear only when you create a schema, not when you edit one.

Schema Structure​

The schema supports three building blocks:

TypePurposeExample
FieldA single extracted valueInvoice_Number, Invoice_Date, Total_Amount
GroupA named set of related child fields extracted togetherVendor_Details with children Name, Address; Shipping_Details with children Carrier, Tracking_Number
TableA repeating structure with columns - one output row per item found in the documentLine_Items with columns Description, Quantity, Unit_Price, Amount

An invoice PDF, for example, contains one Invoice_Number, one set of Vendor_Details, and several Line_Items rows - one for each billed product or service.

For each schema item you can configure:

  • Type - Field, Group, or Table
  • Key Name - Name used for this value in the extracted schema output. See Naming Rules.
  • Description - Optional text that tells extraction what to pull for this key from each document.
  • Data Type - Required for Fields and for Group children / Table columns
  • Precision and Scale - Required when Data Type is DECIMAL (see below)
  • Default Value - Optional value used when extraction does not find a match (must match the data type, including DECIMAL precision and scale)
  • Critical - Always requires human review, regardless of confidence score

Supported Data Types​

  • VARCHAR
  • INTEGER
  • DECIMAL - Numeric values with a fixed total size. When you select DECIMAL, set Precision and Scale in Decimal Settings (see DECIMAL precision and scale).
  • BOOLEAN (true or false)
  • DATE (YYYY-MM-DD)
  • TIMESTAMP (YYYY-MM-DD HH:MM:SS or ISO 8601)

DECIMAL precision and scale​

Amounts, rates, and similar values use DECIMAL so extraction and the output table share the same numeric contract.

SettingMeaning
PrecisionTotal digits allowed (1 to 38). Default is 18.
ScaleDigits after the period (0 up to the precision). Default is 4.

Decimal Settings

  1. Add or edit a Field, Group child, or Table column.
  2. Set Data Type to DECIMAL.
  3. Open Decimal Settings.
  4. Enter Precision and Scale, then save the settings.
  5. Optionally set a Default Value. The default must fit DECIMAL(precision, scale).

On View Schema, a DECIMAL type shows Precision (total digits), Scale (after the period), and a sample value that fits those bounds.

Field​

Use a Field for a single scalar value.

  1. Click Add Field.
  2. Enter a Key Name.
  3. Select a Data Type.
  4. If the data type is DECIMAL, complete Decimal Settings as described above.
  5. Optionally add a description, default value, and mark the field as Critical.

Group​

Use a Group when several related values belong together.

  1. Click Add Group.
  2. Enter a group Key Name and optional description.
  3. Click Add Child to add child fields under the group.
  4. For each child, set key name, data type, and optional default value, description, and critical flag. For a DECIMAL child, complete DECIMAL precision and scale.

Table​

Use a Table for repeating rows with a fixed set of columns.

  1. Click Add Table.
  2. Enter a table Key Name and optional description.
  3. Click Edit columns / Add Column to define the table columns.
  4. For each column, set name, data type, and optional default value, description, and critical flag. For a DECIMAL column, complete DECIMAL precision and scale.

Tables require at least one column, and every column must have a name and data type before you save.

Naming Rules​

Key names (and child/column names) must:

  • Start with a letter or underscore
  • Contain only letters, digits, and underscores
  • Not use reserved Redshift keywords
  • Not use reserved ADI system column names (adi_file_name, adi_parent_file_name, amorphic_file_name, adi_updated_on)

Output column names must be unique within a schema, regardless of capitalization. For example, Amount and amount are treated as the same name. Group children and Table columns use the output column name parent__child (double underscore). A Field named invoice__total therefore conflicts with a Group or Table named invoice containing a child or column named total.

How to Build or Upload a Schema​

  1. In the schema builder, add Fields, Groups, and Tables as needed.
  2. Optionally click View as JSON to inspect the current structure.
  3. You can Upload Schema from a prepared JSON or CSV file instead of building everything in the UI.
  4. You can click Download Sample (or Download CSV / Download JSON) in the UI to download a sample template.
  5. Add at least one entry, then click Save Schema.
tip

Give each field, group, and table a clear Description. Descriptive text helps the extraction models understand what to look for and improves judgement during extraction.

On edit, you can change the description and entries. You cannot rename the schema.

Sample Schema Formats​

You can use the following minimal examples to prepare a schema file for upload:

{
"entries": [
{
"key_type": "Field",
"key_name": "invoice_number",
"data_type": "VARCHAR",
"description": "Invoice number",
"critical": true
},
{
"key_type": "Field",
"key_name": "total_amount",
"data_type": "DECIMAL",
"precision": "18",
"scale": "4",
"description": "Total invoice amount",
"default_value": "0.00",
"critical": true
},
{
"key_type": "Group",
"key_name": "vendor_details",
"description": "Vendor contact details",
"children": [
{
"name": "vendor_name",
"data_type": "VARCHAR",
"description": "Name of vendor",
"critical": true
}
]
},
{
"key_type": "Table",
"key_name": "line_items",
"description": "Invoice line items",
"columns": [
{
"name": "item_name",
"data_type": "VARCHAR",
"description": "Item description",
"critical": false
},
{
"name": "quantity",
"data_type": "INTEGER",
"description": "Item quantity",
"default_value": "1",
"critical": false
},
{
"name": "amount",
"data_type": "DECIMAL",
"precision": "18",
"scale": "4",
"description": "Line amount",
"critical": false
}
]
}
]
}

How to Edit a Schema​

Edit schema

  1. Open the Schema tab.
  2. Click the schema name, or choose Edit.
  3. Update the description and/or entries.
  4. Click Save Schema.

Edit is disabled while status is Updating. After save, status returns to Updating until the output dataset change finishes, then Available (or Failed).

How to Delete a Schema​

  1. Open the Schema tab.
  2. Choose Delete for that schema.
  3. Confirm the deletion.
warning

Deletion cannot be undone. You cannot delete a schema while it is Updating or while a run is in progress for the workspace.

Limits and Important Behavior​

  • Nesting is limited to two levels (top-level entry → child field or table column).
  • The total number of schema entries (including children and columns) is capped at 1590.
  • Saving entries registers or updates the schema’s own output dataset, derived from the schema name.
  • A schema must be Available before you can include it in a run.
  • The same PDF can be extracted against more than one schema in the same run. Review Queue and published data are scoped to that schema.
Info

Define each schema so its output table matches the data you need. You can update an Available schema later; wait for Updating to finish before you run again.