Core AI Decision Engine • Cloudflare Workers AI Edge Driver

System 1 Intuition for Modern Laravel Apps.

Replace open-ended conversational generation and fragile JSON prompts with typed decision primitives (Noul, Choice, Score). Evaluated in sub-seconds at the edge against arbitrary application states.

$ composer require obelaw/systemone obelaw/systemone-clef
driver: cloudflare (@cf/cloudflare/clef)
use Obelaw\SystemOne\Facades\SystemOne;
use Obelaw\SystemOne\Primitives\Noul;
use Obelaw\SystemOne\Primitives\Choice;
use Obelaw\SystemOne\Primitives\Score;

// 1. Pass arbitrary application state (string, array, or Eloquent model)
$response = SystemOne::state('Customer logged in from 3 distinct countries in 10 minutes with 2 failed MFA attempts.')
    // 2. Target Cloudflare Workers AI edge driver (default in config)
    ->driver('cloudflare')
    // 3. Query typed decision primitives simultaneously
    ->ask('is_anomaly', Noul::make('Is this login pattern suspicious?'))
    ->ask('action', Choice::make('Recommended mitigation', [
        'allow'     => 'Allow session silently',
        'challenge' => 'Send push notification MFA',
        'block'     => 'Block session and freeze access',
    ]))
    ->ask('severity', Score::rubric('Escalation tier', ['Low', 'Medium', 'High', 'Critical']))
    ->run();

// 4. Consume calibrated probabilities in milliseconds
if ($response->isPositive('is_anomaly', 0.85)) {
    $action     = $response->value('action');     // "challenge"
    $confidence = $response->confidence('action'); // 0.94
    $severity   = $response->value('severity');   // 3.8 / 4.0
}
Cloudflare Workers AI Roundtrip: 68ms Zero GPU instances • Edge Inference
<100ms
Edge Latency
3
Typed Primitives
0
Hallucinations
100%
Offline Testable
Live Decision Engine Lab

Test Primitives in Real Time

Pick a real application scenario, select your execution driver, and test how SystemOne calculates calibrated probability distributions in milliseconds.

Cloudflare Edge Gateway
54ms latency
Binary Likelihood (Noul)

Is this login pattern suspicious?

Decision Outcome FLAGGED SUSPICIOUS
Calibrated Probability 0.94 / 1.00
Strict typed contract evaluation API Docs
Typed Mathematics

The Three Decision Primitives

Every business decision boils down to likelihood, categorization, or rating. SystemOne encapsulates these into three formal primitives.

Binary Likelihood

Noul

Evaluates affirmative/negative statements and computes a calibrated Bernoulli probability between 0.0 and 1.0.

Noul::make('Is transaction fraud?')
  • Calibrated probability float
  • isPositive(threshold) checks
  • Anomaly, fraud & compliance flags
Categorical Routing

Choice

Resolves decisions across distinct options with criteria rubrics. Emits top pick, confidence, and complete probability distributions.

Choice::make('Route', ['billing', 'tech'])
  • Associative criteria rubrics
  • Full probability distribution
  • Ticket triage & plan recommendations
Bounded Ratings

Score

Computes continuous scores across bounded numerical boundaries or maps state against ordered rubric scales.

Score::range('Risk 1-10', 1, 10)
  • Numerical ranges (min / max)
  • Ordered rubrics (Low → Critical)
  • Lead scoring & priority indexing
Architectural Contrast

The Paradigm Shift

Why transactional software architectures need structured decision primitives instead of conversational chat prompts.

Fragile Pattern

Conversational Prompting

  • Hallucinations & drift: Invented values and unsupported keys when edge cases occur.
  • JSON Parsing Failures: Unexpected markdown backticks, conversational preambles, or broken syntax break deserializers.
  • Heavy Latency: Autoregressively generating 250 tokens takes 1,200ms to 3,500ms per request.
  • Costly Token Waste: Hundreds of tokens spent on repetitive prompt framing and JSON formatting instructions.
SystemOne Pattern

Typed Decision Primitives

  • Strict Schema Guarantees: Primitives return mathematical types: float likelihoods, bounded scores, or enumerated keys.
  • Calibrated Distributions: Full softmax probability outputs reveal model confidence on every choice.
  • Sub-100ms Edge Speed: Edge routing executes decision evaluations close to users in milliseconds.
  • Atomic Multi-Questions: Evaluate 10 distinct questions concurrently in a single network round-trip.
Developer Experience

Fluent Builder API

Chain state contexts, select execution drivers, declare typed questions, and execute deterministic evaluations in a single round-trip.

01

State Injection

Pass arbitrary context data: a string narrative, associative array, or Eloquent model instance.

SystemOne::state($order)
02

Driver Selection

Target Cloudflare Workers AI edge driver explicitly or rely on default configuration in clef.php.

->driver('cloudflare')
03

Typed Questions

Chain multiple primitives (Noul, Choice, Score) evaluated concurrently.

->ask('flag', Noul::make(...))
04

Calibrated Response

Inspect probabilities with isPositive(), confidence metrics, and raw driver payloads.

$res->isPositive('flag', 0.8)
Official Edge Driver

Cloudflare Workers AI as Default Driver

SystemOne is driver-agnostic, with obelaw/systemone-clef providing the official production driver (->driver('cloudflare')). Decisions execute across Cloudflare’s global 300+ city edge network with sub-100ms latency, zero GPU provisioning, and zero cold starts.

300+ Global Anycast Cities

Requests route to the geographically closest Cloudflare edge node, eliminating cross-region latency.

Dual Model Architecture

Switch seamlessly between @cf/cloudflare/clef (complex evaluation) and clef-flash (ultra low-latency triage).

Configured in Seconds

Set CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in .env — Cloudflare is selected as the default driver automatically.

Read Cloudflare Clef Driver Setup Guide
Cloudflare Edge Driver Benchmark Live Simulation
DNS + Anycast TLS Handshake 12ms
Edge Worker Cold Start 0ms (Zero)
Inference (@cf/cloudflare/clef) 54ms
DecisionResponse Hydration 2ms
Total Execution Latency 68ms

Pluggable Driver Architecture

SystemOne drivers implement DriverInterface, enabling flexible runtime swapping.

Official Default

Cloudflare Driver

obelaw/systemone-clef

Zero-ops edge AI via Cloudflare Workers AI. Scaled globally across 300+ data centers with fractional-cent pricing and sub-100ms round trips.

->driver('cloudflare')

Custom / Local Drivers

Ollama, vLLM, On-Premise

Bring your self-hosted inference runtimes or private GPU clusters behind the standard driver contract for internal data compliance.

->driver('ollama')

In-Memory Mock Driver

Pest & PHPUnit Offline

Simulate decision evaluations in your automated test suite with zero network calls, zero latency, and zero Cloudflare token costs.

SystemOne::extend('test', ...)
Execution Driver Latency Infrastructure Token Cost Primary Use Case
Cloudflare Driver (Clef)
obelaw/systemone-clef
<68ms (Edge) Serverless (300+ cities) Fractions of a cent Production web & SaaS apps
Ollama / vLLM Driver
Custom DriverInterface
~150ms - 500ms Self-Hosted GPU daemon Hardware amortized Air-gapped & on-premise logic
In-Memory Mock Driver
SystemOne::extend('test')
0ms (Instant) Zero (In-Memory PHP) $0.00 (Zero tokens) Automated Pest & PHPUnit CI
Production Implementations

Real-World Use Cases

From checkout fraud to customer support triage, SystemOne drives mission-critical decision logic across applications.

Transaction & Fraud Shield

Evaluate high-velocity transactions, IP mismatches, and purchase sizes in real-time. Block compromised cards and challenge suspicious checkouts without interrupting legitimate users.

Noul::make('Is this payment transaction fraudulent?')

Automated Ticket Routing & Triage

Classify incoming customer inquiries across departments (billing, technical, sales) and compute urgency rubric scores (Low to Critical) before an agent even opens the inbox.

Choice::make('Department', [...]) + Score::rubric('Urgency', [...])

Inbound Lead ICP Qualification

Score demo requests and signups instantly based on company size, job title, and message intent to route high-value accounts directly to enterprise account executives.

Score::range('ICP Fit Score 1-10', 1, 10)

Dynamic Workflow Approval Gates

Auto-approve expense reports, warranty returns, and refund requests that fall within safe compliance bounds, while flagging borderline items for human review.

response->isPositive('auto_approve_eligible')
Answers & Details

Frequently Asked Questions

Everything you need to know about Obelaw SystemOne architecture and usage.

What is Obelaw SystemOne?

SystemOne is the modular Core Decision Engine for the Obelaw AI ecosystem. Inspired by behavioral psychology (System 1 fast, intuitive thinking), it replaces unpredictable conversational LLM prompts with typed decision primitives evaluated deterministically against application state.

How is SystemOne different from standard LLM prompts?

Standard LLMs output unstructured text or loose JSON with high latency, hallucinations, and non-deterministic schemas. SystemOne evaluates structured primitives (Noul for binary likelihoods, Choice for categorical routing, Score for bounded rubrics) that produce calibrated probability distributions and reliable, typed values in milliseconds.

What are the three decision primitives?

SystemOne ships with three core primitives: 1) Noul (Bernoulli/binary likelihood questions returning a 0.0-1.0 probability); 2) Choice (categorical classification with criteria rubrics returning top pick, confidence, and probability distribution); and 3) Score (bounded numeric ranges or ordered rubric tiers like Low, Medium, High, Critical).

What AI models and drivers power SystemOne?

SystemOne is driver-agnostic with Cloudflare Workers AI as its official default driver via obelaw/systemone-clef (@cf/cloudflare/clef and @cf/cloudflare/clef-flash) for ultra-low latency edge inference without managing GPU infrastructure. You can also implement custom drivers for local models (Ollama, vLLM) or test mock drivers.

How do I configure Cloudflare as my driver?

Install obelaw/systemone-clef, publish the config via php artisan vendor:publish --tag='systemone-clef-config', and add your CLOUDFLARE_ACCOUNT_ID and CLOUDFLARE_API_TOKEN in your .env file. Cloudflare is enabled as the default driver automatically, or you can explicitly chain ->driver('cloudflare') on any decision request.

Can I run multiple decision questions in a single request?

Yes. You can chain as many primitives as needed using ->ask('key', $primitive) or ->questions([...]). All questions evaluate concurrently in a single round-trip against the same context state.

How do I test SystemOne decisions in my Laravel test suite?

Because SystemOne drivers implement DriverInterface, you can test with zero token costs and zero latency using Laravel's native Http::fake() or by extending SystemOne with in-memory mock drivers in Pest and PHPUnit.

Ready to Make Edge AI Decisions in Laravel?

Install Obelaw SystemOne today and build robust, deterministic decision logic with sub-100ms edge speed.