SYSTEM ONE MODEL INTELLIGENCE DIRECTORY|Decisions, Not Strings ∵ ⩆
Status: ONLINE
Last updated:
AGENTIC PATTERNS & STANDARDS

The Dual-System AI Agent Pattern: Unifying Fast Gating and Deep Reasoning

Why monolithic LLMs struggle in autonomous execution loops, and how decomposing perception, decision gating, and text generation creates robust, cost-effective production systems.

01 // The Problem with Monolithic LLM Loops

Autonomous agents built entirely on autoregressive frontier LLMs (such as GPT-4o, Claude 3.5 Sonnet, or Gemini 1.5 Pro) repeatedly encounter four structural failure modes:

1. Latency Accumulation

Every step in an agent workflow requires 2 to 5 seconds to generate tokens. A 30-step workflow takes over two minutes just waiting for API tokens to stream.

2. Compounding Schema Drift

Even with structured outputs, autoregressive generation carries a non-zero error rate. Buried three layers deep in execution, a single malformed parameter terminates the run.

3. Token Budget Depletion

Calling a 70B+ parameter model for simple binary checks (e.g. "Did the bash command succeed?") wastes 95% of operational budgets on routine classification.

4. Hallucinatory Overconfidence

Traditional models cannot signal when they are uncertain. They invent plausible rationales instead of escalating ambiguous edge cases to supervisors.

02 // Cognitive Mapping: Kahneman System 1 and System 2

Cognitive psychologist Daniel Kahneman established that human cognition relies on two complementary systems: System 1 (fast, effortless, associative) and System 2 (slow, deliberate, analytical).

Cognitive AttributeSystem 1 (TypeSafe Jev)System 2 (Frontier LLMs)
Execution Speed70–200ms2,000–8,000ms
Output MechanismParallel decision samplingAutoregressive token generation
Confidence MetricCalibrated probability (0.0 to 1.0)Uncalibrated or subjective verbalizer
Ideal Agent RoleGating, routing, scoring, parameter checkCode writing, essay drafting, complex multi-hop logic

03 // Production Implementation Blueprint

Below is the standard dual-system loop implemented in TypeScript. The agent uses Jev for sub-second action verification and routes to GPT-4o only when confidence dips below the established threshold.

dual-system-agent.ts
TYPESCRIPT
          import { TypeSafeClient } from '@typesafe/sdk';
import OpenAI from 'openai';

const jev = new TypeSafeClient({ apiKey: process.env.TYPESAFE_API_KEY });
const gpt = new OpenAI();

interface AgentState {
  currentUrl: string;
  domSummary: string;
  goal: string;
  stepCount: number;
}

export async function stepAgent(state: AgentState) {
  // Step 1: System 1 fast decision pass (~100ms)
  const decision = await jev.evaluate({
    state: {
      url: state.currentUrl,
      dom: state.domSummary,
      goal: state.goal
    },
    query: {
      action: ['CLICK_SEARCH', 'SCROLL_DOWN', 'CLICK_NEXT_PAGE', 'ESCALATE_TO_REASONING'],
      confidence_threshold: 0.88
    }
  });

  // Step 2: High-confidence fast-path execution
  if (decision.confidence >= 0.88 && decision.choice !== 'ESCALATE_TO_REASONING') {
    return {
      agentTier: 'SYSTEM_1_JEV',
      action: decision.choice,
      confidence: decision.confidence,
      cost: 0.00008
    };
  }

  // Step 3: Deliberate System 2 escalation
  const deliberatePlan = await gpt.chat.completions.create({
    model: 'gpt-4o',
    messages: [
      {
        role: 'system',
        content: 'You are the deliberate reasoning supervisor. Resolve ambiguous state.'
      },
      {
        role: 'user',
        content: JSON.stringify({ state, lowConfidenceChoice: decision })
      }
    ]
  });

  return {
    agentTier: 'SYSTEM_2_GPT',
    action: deliberatePlan.choices[0].message.content,
    confidence: 1.0,
    cost: 0.0125
  };
}
        

04 // Field Validation & Developer Notes

D
Diogo Almeida (TypeSafe AI)@typesafeai
Sep 15, 2026
Official
"Jev is the first frontier model built for automation rather than chat. Input tokens are priced at $0.042 per million tokens ($42 per billion). Output tokens are free because decisions are sampled in parallel."

Context: Official launch paper and system announcement for the first System One Model.