> ## Documentation Index
> Fetch the complete documentation index at: https://docs.penbox.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Penbox Agent for Document Intelligence Templates

> Define what to extract from documents

A Document Intelligence Template tells Penbox what to extract from a document: a list of fields, each with a type and an optional hint. Penbox Agent builds and refines these templates.

<img
  src="https://mintcdn.com/penbox/o5VpncWuJRX2Pa5-/images/Penbox%20Agent%20prompt%20-%20DI%20Template.png?fit=max&auto=format&n=o5VpncWuJRX2Pa5-&q=85&s=ace79e1dbc335d029815b043555f6be4"
  alt="Document Intelligence Template prompt example"
  className="mx-auto"
  style={{
maxWidth: "500px",
width: "100%",
display: "block",
margin: "0.5rem auto",
}}
  width="1185"
  height="222"
  data-path="images/Penbox Agent prompt - DI Template.png"
/>

## What you can do

**Extraction fields**

* Add, rename, remove, or reorder fields.
* Set the field type: `text`, `number`, `date`, or `list` (a repeatable group of sub-fields, like line items on an invoice).
* Add a hint. A short instruction that disambiguates the extraction ("use the issue date, not the expiry date" or "the number printed at the bottom of the card").
* For list fields, define the sub-fields the extraction produces for each item.

**Keys**

Penbox Agent generates a snake\_case `key` for each field when you do not provide one. The key is the identifier you reference elsewhere in Penbox, for example from a Case Template that uses this Document Intelligence Template on a file field.

## Example prompts

> "Add the fields needed to extract data from an ID card."

> "Add a list field `line_items` with description, quantity, unit price, and total."

> "Add a hint to the issue date field so it picks the issuance date, not the expiry date."

> "Rename `invoice_number` to `ref_number`."

## Where these templates are used

Once a Document Intelligence Template exists in your workspace, attach it to a file field inside a Case Template. Penbox Agent recognizes "use the workspace template" or "use the invoices template" and wires it up. See [Penbox Agent for Case Templates](/agent/templates/case-templates#ai-extraction).

## What Penbox Agent does not do here

* Does not run the extraction on a document for you. Testing happens in the Document Intelligence Template's test interface.
* Does not invent fields you did not ask for. When the document type is ambiguous, Penbox Agent asks which fields you want.

***

## Next Steps

<CardGroup cols={2}>
  <Card title="Case Templates" icon="file-lines" href="/agent/templates/case-templates">
    Use a Document Intelligence Template inside a Case Template
  </Card>

  <Card title="Form Templates" icon="rectangle-list" href="/agent/templates/form-templates">
    Configure inline AI extraction on a form file field
  </Card>

  <Card title="Penbox Agent overview" icon="sparkles" href="/agent/introduction">
    What Penbox Agent does across Penbox
  </Card>

  <Card title="Live Cases" icon="folder" href="/agent/live-cases">
    Penbox Agent on running cases
  </Card>
</CardGroup>
