> This page is for version v2026-02-09 (default).
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Field Names and Prompt Crafting

> Complete guide to designing effective extractors, including schema definition, field configuration, and prompt engineering best practices.

> **Note**
>
> **Start with Composer for automated optimization!**\
>
>
> Before manually tuning your extractor, check out the [Composer optimizer](/optimization/composer) which can automatically improve your field descriptions and extraction rules using Extend's AI agent. After running Composer, refer to these best practices for additional manual refinements and edge cases.

## Schema Fundamentals

### Field/Property Naming Conventions

Field names are an important part of extend's extraction model, so keep some of these guidelines in mind:

| Tip                                                  | ✓ Good                                                             | ✗ Bad                                  |
| ---------------------------------------------------- | ------------------------------------------------------------------ | -------------------------------------- |
| Use descriptive, consistent names                    | `customer_email`, `provider_email`                                 | `email`                                |
| Avoid abbreviations                                  | `invoice_number`                                                   | `inv_num`                              |
| Standardize property name formatting                 | `snake_case`, `camelCase`                                          | `Complex field name, with punctuation` |
| Group related fields with consistent prefixes/titles | `selling_agent_email`, `selling_agent_phone`, `selling_agent_name` | `email`, `phone`, `agent_name`         |

### Field Descriptions

**Write clear, direct, and detailed descriptions**

> **Success**
>
> "The unique invoice number printed at the top of the document. For extend invoices, this will often appear with the prefix EX\_."

> **Error**
>
> "Invoice number"

**Include extra context:**

* Note any formatting requirements\*
* Mention where the field typically appears, if known

\* *Formatting can be suggested in field descriptions, but we often recommend implementing custom logic on your own platform.*

### Field Types

> **Note**
>
> For complete details on all available field types and their configurations, see the [Custom Field Types](/extraction/schema#custom-field-types) documentation.

Choosing the right field type for your data structure can help improve accuracy.

**When to use arrays:**

* Multiple similar items (line items, addresses, phone numbers)
* Extracting repeated data from tables
* Lists that can vary in length

**Other custom field types:**

* `date` - For date/time values with automatic ISO format conversion
* `currency` - For monetary amounts with amount and currency code
* `signature` - For signature detection with printed name, date, and signing status

### Extractor Architecture Decisions

**Unified vs Multiple Extractors**

One of the most common questions is whether to create one unified extractor or multiple specialized extractors for a document type.

**Use a unified extractor when:**

* Documents have consistent structure and field requirements
* All fields are typically present in most documents
* You want simpler maintenance and deployment

**Use multiple extractors when:**

* Processing different document types in the same workflow (e.g., splitting an invoice and associated checks from a single PDF)
* You need different confidence processing rules for different documents
* You want to optimize performance for specific document patterns

---

## Prompt Crafting

Effective prompt engineering is crucial for maximizing both extraction coverage and accuracy. Every extractor will have some unique nuance to it, but these tips should provide a solid foundation to build on.

### Core Principles

**Be Clear, Direct, and Contextual**

Write prompts as if explaining to a new employee with no context about the business or document. Include what the data will be used for and provide clear examples.

**Example:**

```json
{
  "description": "Extract the invoice number, which is typically a
    unique identifier starting with 'INV-' followed by numbers, found 
    in the header section of the document. For Extend invoices, this 
    will often appear with the prefix 'EX_'. Extract exactly as 
    written, including any prefixes or formatting."
}
```

**For complex extractions, use sequential instructions:**

```json
{
  "description": "Extract the total amount due from this invoice. 
    
    Steps: 
      1) Locate labels like 'Total:', 'Amount Due:', or 'Balance Due:' 
      2) Extract the complete monetary value including currency symbol 
      3) Include decimal places exactly as shown (e.g., '$1,250.00')"
}
```

### Common Prompting Mistakes

**Vague Instructions:**

> **Error**
>
> "Extract important information"

> **Success**
>
> "Extract the invoice number located at one of the top corners of the document."

**Missing Context:**

> **Error**
>
> "Extract the date"

> **Success**
>
> "Extract the invoice date (when the invoice was issued), not the due date or any other dates in the document"

**Inconsistent Formatting:**

> **Error**
>
> "Extract total amount. Use dollar sign."

> **Success**
>
> "Extract the total amount in the format it appears in the document (e.g., '\$1,250.00' or '1250.00'). Include currency symbols and decimal places exactly as shown"

## Related Topics

* See [Configuration](/extraction/configuration) for chunking, merging, and other extraction options
* For latency optimization strategies, see [Latency Optimization](latency-optimization)