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

# Classify

> Classify documents by content type using rules or AI similarity.

The classify node sends each document page to a specific output branch based on its content. Use it to sort incoming documents by type, topic, or any other classification criteria before applying downstream processing.

## When to use classify

* You receive **mixed document types** through one trigger and need to apply different processing to each.
* Different document types call for different extract schemas. Classifying upstream lets each branch use a focused schema instead of one mega-schema covering everything.
* You want to drop or quarantine documents that don't fit any expected type. Use the `other` output for unmatched pages.
* Use [filter](/nodes/filter) instead when you're narrowing one document to a subset of its pages, and [split](/nodes/split) when one upload holds several documents that each need their own run.

For mode selection, criteria writing, and confidence tuning, see [classify best practices](/nodes/classify-best-practices).

## Configuration

| Field                    | Type            | Required           | Description                                                                                                      |
| ------------------------ | --------------- | ------------------ | ---------------------------------------------------------------------------------------------------------------- |
| **Mode**                 | select          | Yes                | Classification method: `Rules` or `AI`                                                                           |
| **Routing Rules**        | rule editor     | When mode is Rules | Conditions that determine which output branch each page follows                                                  |
| **Target Pipelines**     | pipeline picker | When mode is AI    | Pipelines to match pages against. Only pipelines with a [Forward Trigger](/nodes/forward-trigger) are selectable |
| **Confidence Threshold** | number          | When mode is AI    | Minimum similarity score (0–1). Pages below it route to the `other` output. Defaults to `0.7`                    |
| **Force OCR**            | toggle          | No                 | Forces OCR processing on the document before classification, even when it contains selectable text               |

### Modes

#### Rules

Define conditions that match page content or page numbers. Each rule maps to a different output edge. Rules accept **Contains text**, **Not contains text**, and **Page numbers**.

#### AI

Uses AI embedding similarity to match pages against reference documents in your target pipelines. Select one or more **Target Pipelines**. Each target pipeline must have a [Forward Trigger](/nodes/forward-trigger) with reference documents so Ingestly can compare incoming pages against it.

Set the **Confidence Threshold** to control how strict the match must be. Pages with a similarity score at or above the threshold are forwarded to the matching pipeline; pages below fall through to the `other` output so you can handle them separately.

## Inputs and outputs

**Allowed inputs:** Filter, split, parse. Classify reads the page text parse produces, so it cannot connect straight to a trigger.

**Output:** Pages routed to the matching output edge, or to the `other` edge if no classification matched.

## Credits

See [credits](/admin/credits) for pricing. Rules mode costs **0.5 credits per page**; AI mode costs **0.2 credits per page**. Generating embeddings on the [forward trigger](/nodes/forward-trigger) when you upload reference documents is billed separately at 0.2 credits per page per reference document.

## Related

<CardGroup cols={2}>
  <Card title="Classify best practices" icon="list-check" href="/nodes/classify-best-practices">
    Pick a mode, write criteria, and tune confidence
  </Card>

  <Card title="Conditional routing guide" icon="book" href="/guides/conditional-routing">
    Patterns for branching pipelines on document type
  </Card>

  <Card title="Forward trigger" icon="share-from-square" href="/nodes/forward-trigger">
    Configure reference documents for AI classification
  </Card>

  <Card title="Extract action" icon="sparkles" href="/nodes/extract">
    Extract data after classifying by document type
  </Card>
</CardGroup>
