Loop Engine model
Loading
Loading
Open Infrastructure · Apache-2.0
Loop Engine gives AI finite states, deterministic guards, and structured feedback. Not improvisation - control.
Install only what you govern.
System context
Loop Engine is the execution and control layer inside a larger operational stack. It does not replace your data warehouse, ERP, or application UI. It sits where decisions become actions, enforces bounded transitions, and records evidence on every state change.
In practice: signals detect change, decision logic selects next action, Loop Engine executes inside explicit guardrails, evidence is captured for each transition, and the resulting feedback improves future decisions. This pattern is used in production systems, including the Better Data platform.
Loop Engine model
Better Data system model
Loop Engine anchors the execution boundary while preserving full transition evidence.
Used with Commerce Gateway
Loop Engine governs actions that are executed through Commerce Gateway. It is a control layer for policy, guards, and audit — not a standalone automation tool that replaces your gateway or operators.
Commerce Agent pattern (illustrative — a composition, not a separate product):
Agent → Registry (discover) → Gateway (execute) → Loop Engine (govern) → Recorded outcome
Related from Better Data
Loop Engine stays standalone and OSS-first. Cross-module architecture updates, hosted path guidance, and launch context are published on the Better Data blog.
AI works best when decisions are bounded, outcomes are measurable, and every action leaves evidence. Loop Engine provides that structure.
Human, automation, AI agent - the actor model treats all three identically. No action is anonymous. Every transition has attributed evidence.
Each closed loop emits structured training signals. Forecasts improve. Lead times sharpen. The system gets better automatically.
Integrations
Adapters plug into the control layer — Loop Engine is not a generic “do anything” automation runner. Pair with Commerce Gateway when commerce execution needs the same guardrails.
Sonar grounds research with citations; Loop Engine runs the governed incident FSM; PagerDuty delivers human review and escalation. End-to-end audit trail on every step.
OpenClaw is the agent that acts. Loop Engine is the runtime that governs what it's allowed to do.
Wrap any Vercel AI SDK tool call with structural approval gates and audit trails. Drop-in compatible with useChat and streamText.
AI agent actions page your on-call engineer. No new approval UI - your team already lives in PagerDuty.
AI actor decisions with full governance — confidence scoring, prompt attribution, and hard guard enforcement at the runtime level.
Same governance model for GPT-4o and o-series — identical guard enforcement, same audit trail, drop-in alongside Claude in multi-model loops.
Governed AI actors via xAI's Grok API — OpenAI-compatible format, same guard enforcement as other adapters.
Google Gemini as a governed Loop Engine actor — native Google AI SDK, Gemini 1.5 Pro and 2.0 Flash supported.
Grounded web retrieval with cited sources for Loop steps that need verifiable, real-time information — regulatory lookups, supplier news, compliance research.
Stateful approval checkpoints and auditable loop orchestration for n8n automations.
Loop Engine governance hooks for long-running Temporal workflows and human gates.
Quick start
import { LoopBuilder } from '@loop-engine/sdk'
const approval = LoopBuilder
.create('expense.approval', 'finance')
.state('SUBMITTED')
.state('APPROVED', { isTerminal: true })
.state('REJECTED', { isTerminal: true })
.initialState('SUBMITTED')
.transition({ id: 'approve', from: 'SUBMITTED', to: 'APPROVED', actors: ['human'] })
.transition({ id: 'reject', from: 'SUBMITTED', to: 'REJECTED', actors: ['human'] })
.outcome({ id: 'expense_approved', valueUnit: 'expense_approved', description: 'Expense approved', measurable: true })
.build()@loop-engine/sdk
High-level entry point for loop systems.
@loop-engine/core
Canonical types and model contracts.
@loop-engine/runtime
Loop engine execution lifecycle.
@loop-engine/dsl
YAML and builder loop definition APIs.
@loop-engine/events
Event contracts and event bus types.
@loop-engine/guards
Built-in and custom guard registry.
@loop-engine/actors
Actor model and attribution helpers.
@loop-engine/observability
Metrics, timelines, replay.