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

# Custom Extractors

> Create AI-powered extractors for project-specific data points

## Overview

Custom extractors let you define your own AI extraction tasks to pull specific data points from contracts. Unlike the built-in extractions (parties, dates, royalties, etc.), custom extractors are tailored to your organization's unique needs.

## Accessing Custom Extractors

1. Open your project's **Drive**
2. Click the **More Options** menu (⋮) in the toolbar
3. Select **Manage Extractors**

## Creating an Extractor

<Steps>
  <Step title="Create New Extractor">
    Click the **+** button to create a new extractor. Enter a name that describes what you're extracting (e.g., "Contract Code", "Signing Tool").
  </Step>

  <Step title="Write Description">
    Describe what you want to extract in plain language. Be specific about:

    * What data to look for
    * Where it typically appears in contracts
    * How to handle edge cases
  </Step>

  <Step title="Define Output">
    Specify the output format using a simple schema. For example:

    ```
    - log_code: [extracted value]
    ```
  </Step>

  <Step title="Choose Context">
    Select what the extractor should analyze:

    * **File title and content** - Uses both filename and contract text
    * **File title only** - Only examines the filename
    * **File content only** - Only examines the contract text
  </Step>

  <Step title="Provide Examples">
    The system automatically selects your 3 most recent contracts. For each contract, provide the expected extraction result. These examples train the extractor.
  </Step>

  <Step title="Start Testing">
    Review your configuration and click **Start** to begin testing. Testing typically takes approximately 15 minutes.
  </Step>

  <Step title="Run Extractor">
    After training completes, run the extractor against your contracts. It will process all existing contracts in the project and automatically run on every newly uploaded contract going forward.
  </Step>
</Steps>

## Writing Good Descriptions

The description is the most important part of your extractor. Write clear, specific instructions.

### Example: Contract Code

```
Task: Extract the log code from the start of the file name.

Instructions:
- The code always appears at the start of the file name and continues until just before the year.
- If a code is found, return only the part before the year.
- If no valid code is found, return nothing.
```

### Example: Signing Tool

```
Task: Extract the contract signing method information from contracts.

Instructions:
- The signing tool is usually mentioned in the page header, footer or near the signature block of the contract.
- If the signing tool is mentioned, return the name of the signing tool.
- If the signing tool is not mentioned, check for physical signatures.
- If physical signatures are mentioned, return "Physical signature".
- If neither are mentioned, return nothing.
```

### Description Best Practices

| Do                                   | Don't                                       |
| ------------------------------------ | ------------------------------------------- |
| Be specific about where data appears | Use vague instructions like "find the code" |
| Explain edge cases and fallbacks     | Assume the AI knows your conventions        |
| Describe the expected format         | Leave output format ambiguous               |
| Include inline examples (see below)  | Rely solely on the contract-based examples  |

## Providing Examples

Good examples are critical for training accurate extractors. There are two ways to provide examples:

### Examples Step (Contract-Based)

The system automatically selects a few of your recent contracts for the Examples step. For each contract, provide the expected extraction result. These real-world examples help the system understand your specific contract formats.

**Tips for contract-based examples:**

* Review the auto-selected contracts and verify they're representative
* Be consistent with your output format across all examples
* Double-check that your expected outputs are accurate

### Examples in the Description

You can include simple input/output examples directly in your description text. This is especially useful for showing the expected format and handling of edge cases.

```
Task: Extract the contract reference code.

Instructions:
- The code appears at the start of the file name before the year.
- Return only the code portion.

Examples:
- "PARDO_2024_Recording_Agreement.pdf" → log_code: "PARDO"
- "ABC123_2023_License.pdf" → log_code: "ABC123"  
- "Contract_2024.pdf" → (no code found, return nothing)
```

**Best practices for inline examples:**

* Include 2-4 examples covering common cases
* Show at least one edge case (e.g., missing data, unusual format)
* Use the exact output format you defined
* Keep examples simple and representative

## Managing Extractors

The top bar of the Manage Extractors dialog shows all your extractors as tabs, displaying each extractor's name and status. From here you can:

* **Switch between extractors** - Click any tab to view/edit that extractor
* **Create new extractors** - Click the **+** button to add a new extractor
* **Delete extractors** - Use the menu on any extractor tab to remove it

### Extractor Statuses

| Status     | Description                                                    |
| ---------- | -------------------------------------------------------------- |
| **Draft**  | Extractor is being configured (description, examples, testing) |
| **Active** | Extractor is trained and ready to run                          |

## Using Extraction Results

Once extractors have run, you can use the results throughout the platform:

* **Contract details** - View extraction results in the [Extractors](/projects/contracts/contract-details/structured-data/extractors) section of any contract
* **Custom views** - Add extractor columns to your [Drive views](/projects/contracts/drive/views) to see results at a glance across all contracts
* **Exports** - Include extractor results in your [data exports](/projects/contracts/drive/exports) for reporting and analysis

## Limits

* Maximum **5 extractors** per project
* Testing takes approximately **15 minutes** per extractor

## Best Practices

<AccordionGroup>
  <Accordion title="Start simple">
    Begin with a straightforward extraction task. Once you understand how the system works, tackle more complex extractions.
  </Accordion>

  <Accordion title="Use specific language">
    The more specific your description, the better the results. Include exact formats, locations in documents, and handling for edge cases.
  </Accordion>

  <Accordion title="Iterate on descriptions">
    If results aren't accurate, refine your description rather than creating a new extractor. Small wording changes can significantly improve accuracy.
  </Accordion>

  <Accordion title="Choose the right context">
    If data is in the filename, use "File title only" for faster, more accurate extraction. Use "File content only" when filenames aren't relevant.
  </Accordion>
</AccordionGroup>

<Note>
  Your data is never used to train external AI models. All testing is performed using an internal system specific to your project.
</Note>
