# Document and Image Extractions

### Getting Started

Create a Document and Image Extraction by going to the AI tab of your account and clicking **Create Extraction**.

1. Give your extraction a name
2. Select **Documents & Images** as the format

### Query Types

Use AI-driven natural language to query your documents for information.

<details>

<summary>Single Value</summary>

Returns a single value that matches the query.

**Configuration Fields:**

* **Entity** (Required) - The name of the value you want to extract
* **Details** (Optional) - Additional information that can help describe the value in the document or image
* **Save To** (Optional) - The field the extracted value will be saved to

**Optional Settings:**

* **Format** - Specify the expected format of the data. Defaults to **Free-Form** which allows you to specify custom examples
* **Examples** - Provide sample values to guide the AI extraction process
* **Rules** - Define validation checks or data transformations (e.g., "Return the date as YYYY-MM-DD")

**Advanced Settings:**

* **Page Filter** - Control which pages are processed for this specific query:
  * **Filter** - Text field that creates entries when you press Enter. Specify words or expressions that must appear on a page
  * **Exclude** - Text field that creates entries when you press Enter. Enter words or expressions that cannot appear on a page
  * **Start Page** - Set the starting page number for extraction
  * **End Page** - Set the ending page number for extraction
  * **Custom AI Page Filter Query** - Advanced natural language filtering for complex page selection criteria
* **Save File Name** - When enabled, saves the name of the source file where the value was extracted from

</details>

<details>

<summary>Multiple or Related Values</summary>

Returns groups of values that match the query.

**Configuration Fields:**

* **Multiple Occurrences** (Toggle) - Enabled by default. Allows the AI to return multiple values from the document or image. If disabled, the AI will only return a single group of entities
* **Query Details** (Optional) - Additional information that can help describe the entire group of entities
* **Entity** (Required) - The name of the value you want to extract
* **Details** (Optional) - Additional information that can help describe the value in the document or image
* **Save To** (Optional) - The field the extracted value will be saved to

You can add multiple entities to a single query using the **Add Entity** button.

**Optional Settings:**

* **Format** - Specify the expected format of the data. Defaults to **Free-Form** which allows you to specify custom examples
* **Examples** - Provide sample values to guide the AI extraction process
* **Required** (Toggle) - When enabled, if the AI doesn't find a value for the required entity, it won't return the group of entities
* **Unique** (Toggle) - If the AI determines the entity has already been extracted, it won't return duplicate groups of entities
* **Rules** - Define validation checks or data transformations for the extracted values

**Advanced Settings:**

* **Group Name** - Specify a custom name for the group of entities (e.g., "Stocks")
* **Page Filter** - Control which pages are processed for this specific query:
  * **Filter** - Text field that creates entries when you press Enter. Specify words or expressions that must appear on a page
  * **Exclude** - Text field that creates entries when you press Enter. Enter words or expressions that cannot appear on a page
  * **Start Page** - Set the starting page number for extraction
  * **End Page** - Set the ending page number for extraction
  * **Custom AI Page Filter Query** - Advanced natural language filtering for complex page selection criteria
* **Save File Name** - When enabled, saves the name of the source file where the value was extracted from

</details>

<details>

<summary>Yes or No</summary>

Returns **Yes** or **No** based on the query.

**Configuration Fields:**

* **Entity** (Required) - The name of the value you want to extract
* **Details** (Optional) - Additional information that can help describe the value in the document or image
* **Save To** (Optional) - The field the extracted value will be saved to

**Advanced Settings:**

* **Page Filter** - Control which pages are processed for this specific query:
  * **Filter** - Text field that creates entries when you press Enter. Specify words or expressions that must appear on a page
  * **Exclude** - Text field that creates entries when you press Enter. Enter words or expressions that cannot appear on a page
  * **Start Page** - Set the starting page number for extraction
  * **End Page** - Set the ending page number for extraction
  * **Custom AI Page Filter Query** - Advanced natural language filtering for complex page selection criteria
* **Save File Name** - When enabled, saves the name of the source file where the value was extracted from

</details>

<details>

<summary>Page Numbers</summary>

Returns the page numbers that are relevant to the query.

**Configuration Fields:**

* **Entity** (Required) - The name of the value you want to extract
* **Details** (Optional) - Additional information that can help describe the value in the document or image
* **Save To** (Optional) - The field the extracted value will be saved to

**Advanced Settings:**

* **Save File Name** - When enabled, saves the name of the source file where the value was extracted from

</details>

### Managing Queries

* Use the **Add Query** button to create additional extraction queries
* Each query can be expanded or collapsed using the arrow controls
* Use the trash icon to delete unwanted queries
* Queries can be reordered using the drag handles
* Each query has its own Optional Settings and Advanced Settings that apply only to that specific query


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.feathery.io/platform/document-intelligence/supported-document-types/document-and-image-extractions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
