Skip to main content

Phase 2: Planner

The Planner reviews the grid's gap patterns and produces a typed strategy for each remaining empty cell. The Planner uses Anthropic Claude Sonnet to analyze the source document alongside the schema field definitions, any already-resolved values from Phase 1, and reference table codes when available. This context-aware approach allows the AI to use related extracted values as clues for finding dependent data points.

The Planner analyzes which cells are still empty after Phase 1 and selects the most efficient action for each. Simple calculations like Total = Unit Price x Quantity use the compute strategy without any AI calls, while truly missing data triggers an extract that re-reads the source document with targeted instructions. You can inspect the Planner's chosen strategy for every field on the Strategy Panel of the job detail page.

Job Detail — Planner Strategy Panel

The strategy panel shows the Planner's typed action plan — visible on the job detail page.

Planner actions

ParameterTypeDescription
computeformulaCalculate from existing grid values (e.g., Total = Unit Price x Quantity). Safe expression evaluator, no eval().
transfercopyCopy from a semantically equivalent grid field.
extractAI readRe-read the source document with specific instructions. Batched, 5 concurrent.
skipn/aField cannot be filled, with reasoning.

Phase 2 processes documents with grouped extraction calls — schema fields are divided into batches of up to 10 fields per call to balance extraction quality with throughput. For each document, the Planner sends the document text along with the schema field definitions and any already-resolved values from Phase 1 as context. This context-aware approach means the AI can use related values (like a contract start date) to more accurately extract dependent values (like the end date). For example, if Phase 1 resolved "Contract Start Date" to 2025-01-15 via a registry transfer, and the "Contract End Date" cell is still empty, the Planner receives the start date as context and can search the document for a corresponding end date with higher precision — producing a more accurate result than extracting the end date in isolation.

For fields backed by a reference table, Phase 2 includes the table's codes and labels directly in the extraction prompt so the AI picks canonical codes rather than free-text labels. This tight integration between reference tables and AI extraction produces cleaner output that requires fewer corrections. Fields with fewer than 50 reference entries get the full table in the prompt; larger tables are handled by the Phase 3 lookup cascade instead.

Example strategy entries (Strategy Panel, job detail page)
[
  {
    "field": "total_amount",
    "action": "compute",
    "expression": "unit_price * quantity",
    "confidence": 0.95
  },
  {
    "field": "payment_terms",
    "action": "extract",
    "reasoning": "No existing value or computable relationship found"
  }
]

Phase 2 uses prompt caching to reduce costs on multi-group extraction calls. For each document, the first group call writes the document content to the Anthropic cache, and subsequent group calls read from it. This primer-then-parallel dispatch pattern reduces per-document costs by 60-80% compared to uncached extraction. The caching is transparent — you do not need to configure anything. Cache entries persist for 5 minutes on the Anthropic side, so iterating on the same documents within that window benefits from warm cache hits at even lower cost.

If a field has a manual instruction, the Planner will always use extract — never skip. Human-written instructions are treated as authoritative.

The Planner works only on the cells that Phase 1 left empty, which is why its cost scales with gaps rather than with the size of your schema. A schema whose fields map cleanly onto Core and Proven registry fields leaves the Planner little to do, while a schema full of new, unmapped fields leans heavily on it. Watching the share of llm_extract cells in the strategy yield across several jobs is a simple way to see whether registry growth is moving work out of Phase 2 and into the cheaper Phase 1.

Planner output is never final on its own. Every value it produces flows into Phase 3, where the reference table lookup cascade re-normalizes free-text answers to your codes and cross-field checks flag implausible combinations, and then into Phase 4, which re-reads remaining gaps with the full grid as context. The confidence gate still applies throughout: a Planner value can fill an empty cell, but it can never overwrite a cell that Phase 1 already filled with high confidence.

The Planner is the Phase 2 extraction AI of a Job. It is not the Agent: the Agent is the Cmd+I copilot. Some machine identifiers, such as the agent_derived resolution type, keep their older names for compatibility.

Frequently asked questions

What strategies does the Phase 2 Planner use?+
Four strategies: compute (calculate from grid values), transfer (copy from equivalent field), extract (re-read document with AI), and skip (field cannot be filled).
Can the Planner skip a field with manual instructions?+
No. Fields with manual instructions always use the extract strategy. Human-written instructions are treated as authoritative and never skipped.
How many fields does the Planner process per AI call?+
Schema fields are grouped into batches of up to 10 fields per extraction call. This balances extraction quality with throughput — smaller groups help the AI focus on each field without losing recall.
How does Phase 2 handle reference table fields?+
For fields backed by a reference table with fewer than 50 entries, Phase 2 includes the full table of codes and labels in the AI prompt so the model picks canonical codes rather than free-text labels. Larger tables are handled by the Phase 3 lookup cascade instead, keeping the prompt size bounded and cost predictable.
Why do some cells show the resolution type agent_derived?+
agent_derived is the frozen machine value for a cell the Planner filled in Phase 2. The name predates the rename of the Phase 2 AI to "Planner" and stays unchanged so existing integrations keep working. In the UI and in these docs the step is called the Planner.