AI Agent Engineering: Integrating Fast and Slow Thinking

    Reliable AI agents need more than fluent responses: they must complete multi-step tasks with verifiable evidence, recoverable failures, and controlled costs. This article explains how to combine fast and slow execution paths, define task acceptance criteria, evaluate agent behavior, and establish production controls while assessing sparse activation through cost per successful task.

    For complex office and software development workflows, the value of language models is shifting from generating a single answer to completing tasks under multiple constraints. Practical usefulness depends on whether a model can keep making progress and produce actionable conclusions when information is incomplete, tool results are unreliable, and outputs must be verifiable.

    Fast thinking supports low-latency responses and format compliance. Slow thinking supports retrieval planning, cross-checking, and exception handling. Both need to work within the same execution loop rather than exist as disconnected product capabilities.

    Define the Task Before Building the Agent

    A well-defined agent task needs a goal, permitted information sources, completion criteria, stopping conditions, and a fallback strategy for failure.

    Consider a task such as comparing pricing across major model APIs and recommending a usage plan. A tidy table is not enough. Every populated cell must be traceable to a source, missing values must be explicitly marked as unknown, and recommendations must state their assumptions, including daily request volume, the input-to-output ratio, and whether caching or batch discounts apply. Any unverifiable number should remain unresolved rather than be replaced with a plausible estimate.

    This is inherently a multi-step task:

    1. Plan the scope of retrieval.
    2. Call search or documentation tools.
    3. Extract the required fields.
    4. Normalize units.
    5. Resolve differences in how sources define or report values.
    6. Generate the comparison table.
    7. Make judgments based on explicit assumptions.

    If any step turns “not found” into “probably,” the final recommendation loses credibility. System instructions and tool protocols should therefore prohibit fabricated prices, parameters, and performance figures. When information cannot be found, leave the field unfilled or mark it as unknown, and describe the scope of the search.

    Coordinate Fast and Slow Execution Paths

    The fast path is suitable for intent recognition, slot filling, simple rewriting, and format validation. It offers low latency and manageable costs. The slow path is better suited to multi-hop retrieval, conflict resolution, extended tool sequences, and decisions involving trade-offs.

    Not every request needs the full reasoning workflow. A routing policy can distinguish among them:

    • Send low-risk requests that can be validated locally through the fast path.
    • Require the slow path for requests involving external facts, monetary amounts, permissions, or irreversible actions.
    • Automatically escalate fast-path outputs that fail validation—for example, because fields are missing, units are inconsistent, or citations are absent—instead of returning the draft directly.

    An illustrative execution loop looks like this:

    1. state = init(goal, constraints)
    2. while not done(state) and steps < limit:
    3. plan = reason(state) # Slow path: decide what to verify next
    4. obs = act(plan.tool, plan.args)
    5. state = update(state, obs)
    6. if contradict(state):
    7. state = repair(state) # Recheck sources; never overwrite silently
    8. return answer_with_evidence(state)

    The goal is not to maximize the number of steps. Each step should produce an observable result, and the state should be replayable. Users should receive conclusions with supporting evidence, while internal execution traces remain available for auditing.

    Common Failure Modes and Countermeasures

    A common failure in retrieval tasks is not an inability to search, but the use of fluent prose to conceal gaps after searching. Bind evidence to individual fields: do not populate a numeric value without a citation. When sources conflict, present their differences rather than selecting whichever value seems more believable.

    Another failure is stopping midway to ask for confirmation. Clarifying questions can be necessary in interactive products, but when the goal, comparison criteria, and permissions are already sufficient, the model should continue and consolidate its assumptions at the end. Completion criteria should explicitly prevent the agent from pushing decisions back to the user when it already has enough information to proceed.

    Recommendations can also become either excessively cautious or unjustifiably decisive. Separate them into three layers:

    • Facts: State only verifiable data.
    • Inference: Explain assumptions and sensitivity—for example, whether a different input-to-output ratio would reverse the conclusion.
    • Action: Provide conditional recommendations.

    This avoids both vague “any option will do” advice and the selection of a single provider when the available data is incomplete.

    Sparse Activation and Cost

    Architectures such as mixture-of-experts models separate total parameter capacity from computation per inference: a model can store substantial knowledge while activating only part of its computation during a forward pass.

    A smaller active parameter footprint generally favors lower latency and inference cost, but capacity does not automatically translate into agent capability. Capability depends on whether routing directs relevant computation to suitable subnetworks and whether post-training covers tool use, long-horizon consistency, and appropriate refusal behavior.

    Do not select a model based only on total or active parameter counts. More useful metrics, measured on equivalent tasks, include:

    • End-to-end latency.
    • Number of tool round trips.
    • First-attempt success rate.
    • Proportion of hallucinated fields.
    • Whether failures are recoverable.
    • Total cost per successful task, including model calls, retrieval, and human review.

    Savings from sparse activation are only one cost component. If rework and manual correction increase, overall costs may rise.

    Evaluate Behavior, Not Writing Style

    Use a fixed task set covering retrieval and synthesis, structured extraction, multi-step execution, conflict handling, and refusal to fabricate information.

    Define automatically checkable rules for each sample in advance. These can cover required fields, units, unknown-value markers, citation counts, and whether the agent reaches conclusions beyond its authority. Reserve human review for aspects that rules cannot adequately assess, such as whether a recommendation is consistent with its assumptions.

    When comparing models or prompts, keep tools, retrieval corpora, temperature, maximum step counts, and budgets consistent. Otherwise, improvements described as “faster” or “more reliable” cannot be attributed meaningfully.

    For regression testing, prioritize reductions in specific failure types rather than relying only on average scores.

    Establish Production Controls

    Production systems should place the model within an explicit control layer that includes tool allowlists, parameter schema validation, timeouts and step limits, secondary confirmation for sensitive operations, comprehensive logs, and traceable citations.

    Object storage holds source materials, message queues support asynchronous steps, container platforms run tool sandboxes, and logging, monitoring, and alerting detect abnormal retries and cost spikes. These are general infrastructure capabilities, not features dependent on a particular model’s proprietary interface.

    When using cloud-based model services or agent orchestration, the integration layer should abstract provider differences through:

    • A consistent message format.
    • A consistent citation protocol.
    • Consistent usage and billing accounting, with input, output, tool usage, and cache hits recorded separately.

    When the underlying model changes, the evaluation set and acceptance thresholds should remain unchanged. This prevents a single impressive interaction from driving platform decisions.

    Conclusion

    Practical agent capability comes from a closed execution loop, not a fluent demonstration. Integrating fast and slow thinking—and gaining speed from sparse activation—becomes scalable only when evidence requirements are enforced, failures are recoverable, and costs are measured per successful task.

    The sound engineering sequence is to establish task criteria, evaluation, and auditing first, then assess parameter scale and routing strategies.