AI Agents · Ai

Reasoning Patterns in AI Agents

Reasoning Patterns in AI Agents is the work that defines the next phase of enterprise software. ERP systems hold the most valuable business data in the company — customers,.

John Kihiu12 min read

Reasoning models — Claude with extended thinking, OpenAI's o-series — trade latency and cost for a visible chain of intermediate steps before the final answer. For ERP agents, that trade is worth making on a narrow set of tasks and a waste of money on the rest. Knowing which is which matters more than any prompt trick.

What the extra thinking actually buys

Extended reasoning helps on tasks with multiple interacting constraints where the model benefits from working through branches before committing: reconciling a discrepancy across three related documents, deciding how to allocate a partial payment across open invoices under a specific aging policy, or diagnosing why a GL batch won't post from a stack of validation errors. These are tasks where a wrong first guess compounds, and the model visibly checking its own intermediate steps reduces that. It does not help on tasks that are lookups, formatting, or single-step classification — routing a support ticket to a category, or extracting a PO number from an email, gains nothing from extended thinking and just adds latency.

The cost and latency are real

Reasoning tokens are billed and they add seconds to minutes of latency depending on the model and effort setting. Putting a reasoning model in the hot path of a synchronous user-facing action — someone waiting on a screen for a response — is usually the wrong call; put it behind an async job or a queue instead, where a 20-second turnaround is invisible. Reserve the fast, non-reasoning model for anything with a person staring at a spinner.

Match the model to the failure cost, not the task's apparent complexity

A task can look complicated (long input, many fields) but be a single deterministic lookup underneath, or look simple (one sentence) but require weighing conflicting constraints. Route on whether a wrong answer is expensive to unwind, not on input length.

The visible trace is a debugging tool, not a justification

Extended thinking output is genuinely useful for debugging — when an agent makes a wrong call, the trace often shows exactly where its reasoning went sideways, which a bare final answer never would. But don't expose the raw trace to end users as "why the AI decided this." It's a record of the model's token-level exploration, not a guaranteed-faithful explanation of its true decision process, and treating it as an audit trail for compliance purposes overstates what it actually is.

PYTHON · CONDITIONAL REASONING ROUTE
def resolve_payment_allocation(payment, open_invoices, sync=True):
    if len(open_invoices) <= 1 or payment.amount >= sum(i.balance for i in open_invoices):
        # trivial case: no allocation decision to reason about
        return allocate_simple(payment, open_invoices)

    # multiple invoices, partial payment, aging policy applies: worth the reasoning budget
    if sync:
        raise ValueError("Route multi-invoice partial allocation to async queue")
    return llm.complete(model="claude-reasoning", thinking_budget="medium",
                         prompt=build_allocation_prompt(payment, open_invoices))

Verify the output the same way, regardless

A reasoning model's answer is not more trustworthy than a non-reasoning model's answer just because it thought longer — it still needs the same validation layer: does the proposed GL account exist, does the allocation sum to the payment amount, is the suggested vendor match above a confidence threshold. Extended thinking reduces the rate of certain error classes, it doesn't eliminate the need to check the output against the system's actual constraints before acting on it.

When a rules engine beats both

If the "reasoning" task actually reduces to a fixed decision tree — payment allocation under a specific aging policy is usually exactly this — a deterministic rules engine will be faster, cheaper, fully auditable, and consistent in a way a reasoning model, however good, is not guaranteed to be run over run. Reach for a reasoning model when the constraints genuinely vary case to case in ways that are hard to enumerate in advance; reach for rules when they don't.

Task shapeRight tool
Single-step lookup/classificationFast non-reasoning model
Fixed decision tree, enumerable rulesDeterministic rules engine
Multi-constraint reconciliation, varies per caseReasoning model, async
User-facing, latency-sensitiveAvoid reasoning models in the sync path

Wrapping up

Reasoning models earn their cost on genuinely multi-constraint problems that vary case to case and can tolerate async latency — not on lookups, not on anything a rules engine already handles better, and not in a synchronous user-facing path. Use the visible trace to debug, not to justify decisions to auditors, and validate the output the same way you would from any other model.

John Kihiu
Acumatica ERP Developer · Laravel Engineer

Independent software engineer in Nairobi specialising in Acumatica customisations, Laravel backends, and tax fiscalisation integrations across East and Southern Africa.