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

# Agentic parse to markdown

> Parse a document on the Agentic tier, pick an effort preset, and read the markdown, tables and per-block confidence it returns

**Nodes used:** [Parse](/guides/nodes/parse) (`mode: "agentic"`)

The Agentic tier is the same Parse node with `mode` set to `agentic`. It parses in several steps and spends the most work on dense tables, so it is the tier to reach for when the Standard output on a complex layout is not good enough.

## The graph

<CodeGroup>
  ```json Graph theme={null}
  {
    "name": "Agentic parser",
    "nodes": [{ "id": "parse_1", "type": "parse", "mode": "agentic", "effort": "mid" }],
    "edges": []
  }
  ```

  ```python Python theme={null}
  import os
  from anyformat.sdk import Client

  client = Client(api_key=os.environ["ANYFORMAT_API_KEY"])

  workflow = client.workflow("Agentic parser").parse(mode="agentic", effort="mid").create()
  ```

  ```typescript TypeScript theme={null}
  import { Anyformat } from "@anyformat/sdk";

  const af = new Anyformat({ apiKey: process.env.ANYFORMAT_API_KEY! });

  const workflow = await af.workflow("Agentic parser").parse({ mode: "agentic", effort: "mid" }).create();
  ```
</CodeGroup>

`effort` is an Agentic-only knob:

| `effort`   | Trade-off                                                           |
| ---------- | ------------------------------------------------------------------- |
| `low`      | Several times cheaper. More errors on dense or low-contrast tables. |
| `mid`      | The default. Balanced.                                              |
| `accurate` | Highest fidelity. Slowest and most expensive.                       |

`prompt_hint` also applies, for example `"the second column is a date"`. `figure_enhancement` is ignored on this tier.

## Run and read

Agentic runs are slower than Standard: 37 s for a one-page invoice against 28 s, and minutes for a long document. Give `wait()` a bigger budget.

<CodeGroup>
  ```bash curl theme={null}
  curl -X POST "https://api.anyformat.ai/v3/workflows/$WORKFLOW_ID/upload/run/" \
    -H "Authorization: Bearer $ANYFORMAT_API_KEY" \
    -F 'files=@report.pdf'
  # -> 202 {"run_id": "...", "status": "queued"}

  # Read the run. Repeat until "status" is "processed".
  curl "https://api.anyformat.ai/v3/runs/$RUN_ID/" \
    -H "Authorization: Bearer $ANYFORMAT_API_KEY"
  ```

  ```python Python theme={null}
  result = workflow.run("report.pdf").wait(timeout=600)

  print(result.parse.parse_confidence)
  for block in result.parse.blocks:
      if block.type == "table":
          print(block.id, block.parse_confidence, len(block.rows or []), "rows")
  ```

  ```typescript TypeScript theme={null}
  import { readFile } from "node:fs/promises";

  const file = new File([await readFile("report.pdf")], "report.pdf", { type: "application/pdf" });
  const run = await workflow.run(file);
  const result = await run.wait({ timeoutMs: 600_000 });

  console.log(result.parse?.parseConfidence);
  for (const block of result.parse?.blocks ?? []) {
    if (block.type === "table") console.log(block.id, block.parse_confidence, block.rows?.length ?? 0, "rows");
  }
  ```
</CodeGroup>

## What comes back

The Agentic tier on a one-page invoice, trimmed. The shape is the same as every other tier; only the work behind it differs.

```json theme={null}
{
  "id": "06a8d903-9bb2-70e3-8000-c15378b47b7c",
  "status": "processed",
  "results": {
    "document_packet_id": "06a8d903-9a05-7184-8000-d34b711c8ef0",
    "verification_url": "https://app.anyformat.ai/workflows/.../files/...",
    "parse": {
      "markdown": "<a id=\"p1_b0\"></a>\n\nINVOICE\n\n<a id=\"p1_b1\"></a>\n\nInvoice #: INV-2026-9001\nIssue date: 2026-02-20\n...\n\n<a id=\"p1_b5\"></a>\n\n<table><thead><tr><th data-cell-id=\"r0c0\">Description</th><th data-cell-id=\"r0c1\">Qty</th> ...",
      "text": "INVOICE\nInvoice #: INV-2026-9001 ...",
      "parse_confidence": 75.0,
      "layout_confidence": 0.6,
      "blocks": [
        { "id": "p1_b0", "type": "header", "page": 1, "parse_confidence": 100.0, "content": "INVOICE", "rows": null },
        { "id": "p1_b5", "type": "table", "page": 1, "parse_confidence": 85.9, "content": "<table>...</table>",
          "rows": [
            [{ "cell_id": "r0c0", "text": "Description" }, { "cell_id": "r0c1", "text": "Qty" }, { "cell_id": "r0c2", "text": "Unit price" }, { "cell_id": "r0c3", "text": "Amount" }],
            [{ "cell_id": "r1c0", "text": "Matrix Extensible Action-Items" }, { "cell_id": "r1c1", "text": "8" }, { "cell_id": "r1c2", "text": "$246.87" }, { "cell_id": "r1c3", "text": "$1,974.96" }]
          ] },
        { "id": "p1_b6", "type": "table", "page": 1, "parse_confidence": 31.0, "content": "<table>...</table>", "rows": [ "..." ] }
      ]
    },
    "classifications": [],
    "splits": [],
    "extractions": [],
    "edits": []
  }
}
```

## Reading the confidence

* `blocks[].parse_confidence` is the number to act on. It is 0 to 100 per block. In the sample above the line-item table scored 86 and the totals block, which the tier read as a second table, scored 31. That is the block to send to review.
* `parse.parse_confidence` is the document roll-up, weighted by the characters in each block. A long low-scoring table pulls it down more than a short heading pulls it up.
* A block that no model scored comes back with `parse_confidence: null`. Treat `null` as "not scored", not as zero.

## Tips

* Try Standard first. Move a document type to Agentic only when its tables come back wrong. The [Parse node](/guides/nodes/parse) page lists the credits per page for each tier.
* Start at `effort: "mid"`. Go to `accurate` for scanned, low-contrast or very wide tables; drop to `low` for clean digital documents where you want the multi-step pass without the cost.
* `rows` on a `table` block gives you the cells as a grid. Read that instead of parsing the `<table>` HTML.
* Add an Extract node after the Parse node to turn the same tables into typed fields. See [Bank statement processing](/examples/bank-statement-processing).

## Next steps

<CardGroup cols={2}>
  <Card title="Parse node" icon="file-lines" href="/guides/nodes/parse">
    Every knob on the node
  </Card>

  <Card title="Parse-only workflow" icon="layer-group" href="/examples/parse-only-workflow">
    The same graph on Flash, Fast and Standard
  </Card>

  <Card title="Get run" icon="reply" href="/api-reference-v3/runs/get">
    The full run envelope
  </Card>

  <Card title="Coding assistant" icon="robot" href="/guides/coding-assistant">
    The anyformat skill for Claude Code and other agents
  </Card>
</CardGroup>
