# Extraction prompts
Source: https://docs.file.ai/extract/extraction-prompts

> Write field titles and descriptions that fileAI extracts reliably.

AI Schemas

# Extraction prompts

Copy pageCopy page

Write field titles and descriptions that fileAI extracts reliably.

Copy pageCopy page

fileAI fills each schema field by reading its title and description, so the description works as the field’s extraction prompt. A clear, specific description is the most direct way to improve a field that comes back wrong or empty. Before rewriting a prompt, check that the file itself reads well: a digitally generated PDF with selectable text beats a low-resolution scan. See [Prepare your files](/ingest/supported-files#prepare-your-files).

## 

[​

](#how-it-works)

How it works

Every field in an [AI Schema](/extract/ai-schemas) has a `title`, 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 `description` on a field with `PATCH /v1/files/schema`, then re-fill the file with `PATCH /v1/files/schema/rerun`.

## 

[​

](#guidelines)

Guidelines

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

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

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](/extract/data-types).

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

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

A short example of the expected output, such as “e.g. INV-2025-0042”, helps the model match the shape you want.

## 

[​

](#example)

Example

Field title

Weak description

Strong description

`Total amount`

Total

The final amount due including tax, from the line labelled “Total” or “Amount due”. Number only, no currency symbol.

`Contract date`

Date

The date the contract was signed by both parties, not the date it was drafted.

`Delivery status`

Status

Current delivery status. One of: shipped, pending, delayed.

## 

[​

](#related)

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.

[Previous](/extract/schema-locking)[

Data types

The field types a schema can use, and the shape each value takes in the API.

Next

](/extract/data-types)

⌘I

## On this page

*   [How it works](#how-it-works)
*   [Guidelines](#guidelines)
*   [Example](#example)
*   [Related](#related)
