Skip to content

IDP Build Schema

Type: idp-build-schema  ·  Package: IDP Activities v1.18.0  ·  Output: object

Turns a taxonomy into the JSON Schema that AI Extract consumes. For each field it asks for two things: the interpreted value, and the literal text from the document it comes from — which is what IDP Ground later uses to locate it.

ParameterEditorDescription
taxonomyJSONThe taxonomy: a path to a .json file, or the object itself.

Returns an object holding the JSON Schema, ready to hand straight to AI Extract.

It describes one type of document, not one layout. That is where the business case lives: the visual layer changes from one hospital to the next, the meaning does not. A single hoja-de-vida-equipo-biomedico.json serves all of them.

{
"documentType": "hoja-de-vida-equipo-biomedico",
"description": "Record of a biomedical device. The layout varies between hospitals.",
"fields": [
{
"name": "serial",
"type": "string",
"description": "The device's serial number, exactly as printed",
"minConfidence": 0.95
},
{
"name": "brand",
"type": "string",
"description": "The device's brand or manufacturer",
"minConfidence": 0.6
}
]
}
KeyRequiredWhat it is
documentTypeyesIdentifier for the type of document.
descriptionnoWhat this document is. Passed to the model as context.
fields[].nameyesThe field’s name in the result.
fields[].typenostring (default), number, integer, boolean, date or table.
fields[].descriptionyesWhat this field is.
fields[].minConfidencenoConfidence required to accept it. Default 0.8.
fields[].fieldsonly on tableThe table’s columns.

A field of type table is a field that repeats: one row per occurrence in the document. It is what lets you pull out a maintenance history, a parts list, or anything with N entries.

{
"name": "maintenance",
"type": "table",
"description": "The device's maintenance history",
"fields": [
{ "name": "date", "type": "date", "description": "Date of the maintenance", "minConfidence": 0.8 },
{ "name": "kind", "type": "string", "description": "Preventive or corrective", "minConfidence": 0.7 },
{ "name": "technician", "type": "string", "description": "The technician's name", "minConfidence": 0.7 }
]
}

Columns are declared like any other field, with their own description and their own minConfidence — because a date and a technician’s name are not read with the same reliability. The table itself carries no minConfidence: it is not verified as a whole, it is verified cell by cell.

minConfidence is the confidence required to accept a field without a person looking at it. Higher means stricter.

It is per field on purpose. A serial number is alphanumeric with no linguistic redundancy: it is exactly where OCR fails, and where being wrong is expensive — so it demands near-certainty (0.95). A brand is always read correctly and context corrects it anyway, so demanding the same would only send work to review that doesn’t need it (0.6).

One threshold for the whole document sends everything to review and kills the ROI.

IDP Build Schema taxonomy = = asset("taxonomies/device-record.json") → output: schema
AI Extract credential = = credential("anthropic-key")
prompt = = doc["text"]
schema = = schema
→ output: extraction
  • IDP Ground — the next step: locate and validate what was extracted.
  • AI Extract — the model call that uses this schema.