How it works
Every field in an AI Schema has atitle, a type and a description. fileAI sends the description to the extraction model as the instruction for that field; when a field has no description, its title is used instead. You write prompts in two places:
- In the app: click the sparkle icon next to a field in the AI Schema tab, describe how the field should be captured, then click Run and Save.
- Over the API: set
descriptionon a field withPATCH /v1/files/schema, then re-fill the file withPATCH /v1/files/schema/rerun.
Guidelines
Be explicit and specific
Be explicit and specific
Name exactly what you want. Instead of “Extract important details”, write “The invoice number printed in the header, labelled ‘Invoice No.’ or ‘Inv #’”.
Refer to fields by their schema titles
Refer to fields by their schema titles
When one description mentions another field, use the title as it appears in your schema, such as
Customer name, not “name” or “client”.Say what the allowed values are
Say what the allowed values are
For a fixed set of answers, list them: “Delivery status: one of shipped, pending, delayed.” Better still, make the field an
enum with those values. See Data types.Set the format you expect
Set the format you expect
For dates: “The date received, as YYYY-MM-DD.” For yes/no questions: “Is the payment confirmed? Answer true or false.”
Resolve ambiguity
Resolve ambiguity
If a document has several candidates, say which one you mean: “Contract date: the date the contract was signed, not the date it was created.”
Give an example value
Give an example value
A short example of the expected output, such as “e.g. INV-2025-0042”, helps the model match the shape you want.
Example
Related
AI Schemas
Edit fields in the app or over the API.
Data types
Pick the right type so values come back in the right shape.