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 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
} {
"success": true,
"driver": "cloudflare",
"model": "@cf/cloudflare/clef",
"latency_ms": 68,
"result": {
"answers": {
"is_anomaly": 0.94,
"action": {
"value": "challenge",
"confidence": 0.94,
"probabilities": {
"challenge": 0.94,
"block": 0.05,
"allow": 0.01
}
},
"severity": {
"index": 3,
"label": "Critical",
"score": 3.8
}
}
}
} use Obelaw\SystemOne\Facades\SystemOne;
use Obelaw\SystemOne\Primitives\Noul;
use Illuminate\Support\Facades\Http;
// Zero token costs with native Laravel HTTP faking
it('evaluates suspicious access deterministically', function () {
Http::fake([
'https://api.cloudflare.com/*' => Http::response([
'success' => true,
'result' => [
'answers' => ['is_anomaly' => 0.96],
],
]),
]);
$response = SystemOne::state('Rapid international travel velocity')
->driver('cloudflare')
->ask('is_anomaly', Noul::make('Is anomalous?'))
->run();
expect($response->isPositive('is_anomaly'))->toBeTrue();
}); Test Primitives in Real Time
Pick a real application scenario, select your execution driver, and test how SystemOne calculates calibrated probability distributions in milliseconds.
Is this login pattern suspicious?
The Three Decision Primitives
Every business decision boils down to likelihood, categorization, or rating. SystemOne encapsulates these into three formal primitives.
Noul
Evaluates affirmative/negative statements and computes a calibrated Bernoulli probability between 0.0 and 1.0.
- Calibrated probability float
-
isPositive(threshold)checks - Anomaly, fraud & compliance flags
Choice
Resolves decisions across distinct options with criteria rubrics. Emits top pick, confidence, and complete probability distributions.
- Associative criteria rubrics
- Full probability distribution
- Ticket triage & plan recommendations
Score
Computes continuous scores across bounded numerical boundaries or maps state against ordered rubric scales.
- Numerical ranges (min / max)
- Ordered rubrics (Low → Critical)
- Lead scoring & priority indexing
The Paradigm Shift
Why transactional software architectures need structured decision primitives instead of conversational chat prompts.
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.
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.
Fluent Builder API
Chain state contexts, select execution drivers, declare typed questions, and execute deterministic evaluations in a single round-trip.
State Injection
Pass arbitrary context data: a string narrative, associative array, or Eloquent model instance.
Driver Selection
Target Cloudflare Workers AI edge driver explicitly or rely on default configuration in clef.php.
Typed Questions
Chain multiple primitives (Noul, Choice, Score) evaluated concurrently.
Calibrated Response
Inspect probabilities with isPositive(), confidence metrics, and raw driver payloads.
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.
Pluggable Driver Architecture
SystemOne drivers implement DriverInterface, enabling flexible runtime swapping.
Cloudflare Driver
obelaw/systemone-clefZero-ops edge AI via Cloudflare Workers AI. Scaled globally across 300+ data centers with fractional-cent pricing and sub-100ms round trips.
Custom / Local Drivers
Ollama, vLLM, On-PremiseBring your self-hosted inference runtimes or private GPU clusters behind the standard driver contract for internal data compliance.
In-Memory Mock Driver
Pest & PHPUnit OfflineSimulate decision evaluations in your automated test suite with zero network calls, zero latency, and zero Cloudflare token costs.
| 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 |
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.
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.
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.
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.
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.