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

# Agentic Modes

> AI-powered accuracy improvements for text, tables, and figures

Agentic mode adds a vision-language model review layer to catch errors that single-pass OCR misses. You enable it per content type using scopes.

## Basic Usage

<CodeGroup>
  ```python Python theme={null}
  result = client.parse.run(
      input=upload.file_id,
      enhance={
          "agentic": [
              {"scope": "text"},
              {"scope": "table"},
              {"scope": "figure", "advanced_chart_agent": True}
          ]
      }
  )
  ```

  ```javascript Node.js theme={null}
  const result = await client.parse.run({
    input: upload.file_id,
    enhance: {
      agentic: [
        { scope: 'text' },
        { scope: 'table' },
        { scope: 'figure', advanced_chart_agent: true }
      ]
    }
  });
  ```

  ```bash cURL theme={null}
  curl -X POST https://platform.reducto.ai/parse \
    -H "Authorization: Bearer $REDUCTO_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "input": "reducto://your-file-id",
      "enhance": {
        "agentic": [
          {"scope": "text"},
          {"scope": "table"},
          {"scope": "figure", "advanced_chart_agent": true}
        ]
      }
    }'
  ```
</CodeGroup>

Each scope is independent. Enable only what you need.

<Note>
  Agentic modes are available in the Python SDK, Node.js SDK, and via cURL. The Go SDK does not yet support agentic modes.
</Note>

## Text Scope

Adds a second OCR pass using a vision-language model to correct text extraction errors.

<CodeGroup>
  ```python Python theme={null}
  enhance={"agentic": [{"scope": "text"}]}
  ```

  ```javascript Node.js theme={null}
  enhance: { agentic: [{ scope: 'text' }] }
  ```

  ```bash cURL theme={null}
  "enhance": {"agentic": [{"scope": "text"}]}
  ```
</CodeGroup>

**What it fixes:**

* Handwritten notes and signatures
* Small or faded text
* Special characters and mathematical notation
* Mixed fonts and styles

**Custom prompts** apply only to form regions (key-value fields like "Name: John Doe"), not body text:

<CodeGroup>
  ```python Python theme={null}
  enhance={"agentic": [{"scope": "text", "prompt": "Extract all dates in MM/DD/YYYY format"}]}
  ```

  ```javascript Node.js theme={null}
  enhance: { agentic: [{ scope: 'text', prompt: 'Extract all dates in MM/DD/YYYY format' }] }
  ```

  ```bash cURL theme={null}
  "enhance": {"agentic": [{"scope": "text", "prompt": "Extract all dates in MM/DD/YYYY format"}]}
  ```
</CodeGroup>

## Table Scope

Uses a VLM to reconstruct table structure after initial extraction.

<CodeGroup>
  ```python Python theme={null}
  enhance={"agentic": [{"scope": "table"}]}
  ```

  ```javascript Node.js theme={null}
  enhance: { agentic: [{ scope: 'table' }] }
  ```

  ```bash cURL theme={null}
  "enhance": {"agentic": [{"scope": "table"}]}
  ```
</CodeGroup>

**What it fixes:**

* Merged cells (rowspan/colspan)
* Nested or multi-level headers
* Tables with missing or faint borders
* Rotated text in cells

**Custom prompts** guide the reconstruction:

<CodeGroup>
  ```python Python theme={null}
  enhance={"agentic": [{"scope": "table", "prompt": "Preserve currency symbols. Align rows by date."}]}
  ```

  ```javascript Node.js theme={null}
  enhance: { agentic: [{ scope: 'table', prompt: 'Preserve currency symbols. Align rows by date.' }] }
  ```

  ```bash cURL theme={null}
  "enhance": {"agentic": [{"scope": "table", "prompt": "Preserve currency symbols. Align rows by date."}]}
  ```
</CodeGroup>

## Figure Scope

Enables enhanced figure processing. Without additional options, it uses more powerful models and better classifies figures as charts vs. images. Note: `summarize_figures` must also be enabled for this configuration to be activated.

<CodeGroup>
  ```python Python theme={null}
  enhance={"agentic": [{"scope": "figure"}]}
  ```

  ```javascript Node.js theme={null}
  enhance: { agentic: [{ scope: 'figure' }] }
  ```

  ```bash cURL theme={null}
  "enhance": {"agentic": [{"scope": "figure"}]}
  ```
</CodeGroup>

To extract numerical data from charts as structured tables, enable `advanced_chart_agent`:

<CodeGroup>
  ```python Python theme={null}
  enhance={"agentic": [{"scope": "figure", "advanced_chart_agent": True}]}
  ```

  ```javascript Node.js theme={null}
  enhance: { agentic: [{ scope: 'figure', advanced_chart_agent: true }] }
  ```

  ```bash cURL theme={null}
  "enhance": {"agentic": [{"scope": "figure", "advanced_chart_agent": true}]}
  ```
</CodeGroup>

| Option                 | What it does                                   |
| ---------------------- | ---------------------------------------------- |
| `advanced_chart_agent` | Extracts numerical values as structured tables |
| `prompt`               | Custom instructions for figure processing      |

For details on chart types and the extraction pipeline, see [Chart Extraction](/configs/parse/chart-extraction).

## Figure Summarization (Default)

To generate generic text descriptions of images and figures, enable `summarize_figures`:

<CodeGroup>
  ```python Python theme={null}
  enhance={"summarize_figures": True}  # This is the default
  ```

  ```javascript Node.js theme={null}
  enhance: { summarize_figures: true }  // This is the default
  ```

  ```bash cURL theme={null}
  "enhance": {"summarize_figures": true}
  ```
</CodeGroup>

This is lightweight and on by default. It makes visual content searchable but doesn't extract numerical data. Note: this must be enabled in addition to figure scope for enhanced figure summarization to be activated.

**To disable it:**

<CodeGroup>
  ```python Python theme={null}
  enhance={"summarize_figures": False}
  ```

  ```javascript Node.js theme={null}
  enhance: { summarize_figures: false }
  ```

  ```bash cURL theme={null}
  "enhance": {"summarize_figures": false}
  ```
</CodeGroup>

## When to Use What

| Situation                  | Configuration                                       |
| -------------------------- | --------------------------------------------------- |
| Clean, digital-native PDFs | Skip agentic entirely                               |
| Documents with handwriting | `{"scope": "text"}`                                 |
| Complex financial tables   | `{"scope": "table"}`                                |
| Charts you need searchable | Default `summarize_figures` is enough               |
| Charts you need data from  | `{"scope": "figure", "advanced_chart_agent": True}` |
| All of the above           | Combine all three scopes                            |

## Cost and Latency

Each scope adds processing time and cost. For cost-sensitive workloads:

* `table` scope alone handles the most common accuracy issues
* `text` scope is most valuable for handwritten content
* `figure` scope with `advanced_chart_agent` is expensive, so use only when you need numerical data from charts
