Skip to main content

Template Design Tips

The quality of your extraction template directly affects the quality of your results. Here are proven practices.

Naming fields

Be specific

Instead ofUse
"Date""Invoice Date"
"Amount""Total Amount Due"
"Name""Customer Full Name"
"Number""Purchase Order Number"

Specific names eliminate ambiguity when the AI encounters multiple similar fields in a document.

Use consistent naming

Pick a naming convention and stick with it:

  • invoice_number, invoice_date, invoice_total (snake_case)
  • Invoice Number, Invoice Date, Invoice Total (Title Case)
  • Avoid mixing conventions within the same template

Writing descriptions

The description field is your chance to guide the AI. Use it for ambiguous fields:

FieldWithout descriptionWith description
"Amount"AI might grab subtotal, tax, or total"The final total amount due after all discounts and taxes, in the document's currency"
"Address"AI might grab billing or shipping"The shipping address where goods should be delivered, not the billing address"
"Date"AI might grab issue date, due date, or delivery date"The date the invoice was issued, not the payment due date"

Choosing field types

Use the most specific type available:

TypeWhen to useWhat it ensures
NumberFinancial amounts, quantitiesReturns numeric value, not "USD 500"
DateAny date fieldReturns consistent date format
BooleanYes/no questionsReturns true/false, not "Yes"/"No"
ArrayLists (line items)Returns array of items, not concatenated text
ObjectGrouped data (address)Returns structured nested data
TextEverything elseReturns as-is

Template iteration

  1. Start with Auto-detect — process a sample document with no template to see what the AI finds
  2. Create your template based on what fields matter to you
  3. Test on 2-3 documents — run extraction and review results
  4. Refine — add descriptions, adjust field names, change types based on results
  5. Scale — once results are consistent, use for batch processing

Common pitfalls

  • Too many fields — the AI does better with 10-20 focused fields than 50 broad ones
  • Overlapping fields — "Name" and "Full Name" in the same template confuse the AI
  • No descriptions on ambiguous fields — if a field could mean two things, add a description
  • Wrong types — using Text for a Number field means you get "$1,500.00" instead of 1500.00