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

# Structured extraction profiles

> Define the schema, prompt context, page limit, and deterministic checks for structured document extraction.

## Prerequisites

The structured extraction feature must be available. Open **Admin settings → AI Document Processing → Extraction profiles**. Use `ai.extractionprofiles.view` to inspect profiles and `ai.extractionprofiles.manage` to maintain them.

A profile describes the JSON data an extraction request should return. It is different from the [document classification tree](/document-classification/introduction), which chooses a document type and suggests indexing keywords. Editing an extraction profile does not automatically assign it to an upload-classification branch.

## Define a profile

Choose **Add profile** and configure:

| Field          | Purpose                                                                   |
| -------------- | ------------------------------------------------------------------------- |
| Name           | Unique, case-insensitive identifier used to select the profile            |
| Description    | Explain the document family and intended use                              |
| Prompt context | Instructions clarifying what to extract and how to interpret the document |
| Max pages      | Page cap for text extraction/OCR; empty uses the extraction default       |
| JSON schema    | An object with at least one property describing the required output       |
| Validators     | A JSON array of deterministic checks against extracted data               |

Give fields precise descriptions. A field called `reference` with no explanation is ambiguous when a document contains an invoice number, customer number, and payment reference.

A minimal schema could be:

```json theme={null}
{
  "type": "object",
  "properties": {
    "invoiceNumber": {
      "type": "string",
      "description": "The invoice number printed by the supplier, not the customer or payment reference"
    }
  },
  "required": ["invoiceNumber"]
}
```

This is a schema example, not a guarantee that an AI model will always extract the right value. Check the actual document and the returned validation results.

<Frame caption="The Invoice reference profile declares its expected JSON result and extraction context.">
  <img src="https://mintcdn.com/nobly/vtIE7VxmxD31SQoh/images/guides/extraction.png?fit=max&auto=format&n=vtIE7VxmxD31SQoh&q=85&s=a4a26498cc54bcb6c8ef72689a212a42" alt="The Invoice reference profile declares its expected JSON result and extraction context." width="1440" height="1000" data-path="images/guides/extraction.png" />
</Frame>

## Add deterministic checks

The supported validators include:

| Validator   | Checks                                                                  |
| ----------- | ----------------------------------------------------------------------- |
| `sumEquals` | Whether item amounts agree with a total, allowing a specified tolerance |
| `format`    | A field against a pattern                                               |
| `checksum`  | Supported CVR or CPR checksum rules                                     |
| `lookup`    | Membership in a supplied set of values                                  |
| `compare`   | A comparison with another field                                         |

Validator paths refer to the extracted object. Dot paths reach nested fields; an array segment such as `items[]` applies to its items. Use the parameter names shown in the editor's help for each validator.

Validators improve the evidence for a result; passing a format or checksum check does not establish that a value belongs to the correct person or document.

## Save and verify

Choose **Save changes**, then call the structured extraction operation with this profile in your test environment. Include a typical document, a document missing an expected field, and one with inconsistent totals or another intended validation failure. Check page limits against documents whose required information appears near the end.

The settings screen edits profiles; it does not itself run an extraction test. Use the consuming integration and the environment's API contract to verify the result.

## Change or delete a profile

Review integrations that select a profile by name before renaming or removing it. **Delete all** removes the entire configured profile collection; requests naming those profiles will fail until the required profiles exist again.

## Where to read next

<Card title="AI agents and shared settings" icon="sliders" href="/ai-administration/agents-and-settings" horizontal>
  Configure chat agents, context boundaries, tools, quick prompts, model choices, and request limits.
</Card>
