Schema Builder
Schema Builder lets you describe what information you want to get and how it should be organized: a name, a description and the list of fields with their type. That description is called a schema.
You connect it to an extraction component, such as Trustcall Extractor, so an AI model knows exactly which data to pull from a text.
When to use it
- Specify which details to pull from each invoice: supplier, date, amount and taxes.
- Define the fields of a contact (name, company, phone, email) to extract them from email signatures.
- Prepare several schemas, one per document type, and let the extractor pick the right one.
- Keep in one place the definition of the data your team extracts again and again.
Configuration
| Field | What it does |
|---|---|
| Model Name | The schema’s name, for example Invoice or Contact. Use a short, clear name: the AI model takes it into account. |
| Model Description | What the schema represents, in one or two sentences. It helps the model understand what to look for. |
| Model Fields | The schema’s fields. Press Edit Argument Schema to open the editor and use Add Argument to add each field. |
In the editor, each field has these columns:
| Column | What it means |
|---|---|
| Name | The field name, for example total_amount. |
| Description | What the field contains. It is required and it’s what the model reads to know what to look for. |
| Type | The kind of value: string (text), integer (whole number), number (number with decimals), boolean (yes or no), array (list), object (group of fields) or any. |
| Default | Value used if the data isn’t found. |
| Required | Whether the field must always be present. |
The editor has two views: Table Schema, to edit the fields in a table, and JSON View, to see or paste the full definition.
Output
The component has two outputs:
- Schema: the schema, ready to connect to the Schemas input of Trustcall Extractor.
- JSON: the schema definition as structured data, useful to review it or pass it to another component.
Example
The accounts team wants to record the invoices that arrive by email. It creates a Schema Builder with Model Name Invoice, Model Description “Main details of a supplier invoice” and four fields: supplier (string), date (string), total_amount (number) and invoice_number (string). It connects Schema to a Trustcall Extractor, which pulls those four details from each invoice.
Good practices
- Write specific descriptions for each field, for example “Total amount including taxes, without currency symbol”. The clearer it is, the better the model extracts.
- Use one Schema Builder per type of information you want to extract.