Skip to main content

Loops

Loops are the atomic unit of the Better Data platform: governed workflows with actor attribution, guard enforcement, evidence, and an audit trail.

What is a loop?

A loop is a finite state machine with governed transitions. Every transition:
  • Names the actor responsible (human | automation | ai-agent)
  • Evaluates guard policies before the transition is allowed
  • Attaches structured evidence (documents, scans, confidence scores)
  • Emits an immutable audit event (who / what / when / correlation id)
Guards are enforced in the runtime and policy layer — not by prompt instructions alone.

Agents and Loop Engine (C12)

Agents (in the commerce sense) are not a separate product or autonomous AI platform. They use Loop Engine to govern decisions after Registry discovery and Gateway execution — the same control plane as human and automation actors.
  • Never describe agents as an “agent system” separate from the gateway, or as a standalone agent product.
  • Always tie agent behavior to Registry → Gateway → Loop Engine and, for illustration, Commerce Demo governed mode or Build an agent.

Hosted loop engine

Better Data operates a hosted loop runtime at loops.betterdata.co. Compared to self-hosting @loop-engine/sdk, hosted adds:
  • Multi-tenant organization isolation
  • Metering aligned to loop outcomes
  • Industry Pack policy overlays
  • TenantCapabilitySnapshot-driven RBAC
  • Drift detection workers
  • Outbox relay for cross-module delivery
  • Managed upgrades and SLA
OSS: loopengine.io · @loop-engine/sdk
Hosted: Hosted Loop Engine · hello@betterdata.co

Loop types in the CCO platform

Loop IDModuleWhat it governs
scm.procurementSCMPO lifecycle, receipts, invoice alignment
scm.fulfillmentSCMReservation → pick/pack/ship
scm.qualitySCMInspection, deviation, disposition
scm.replenishmentSCMDemand-driven reorder
dcm.demandDCMDemand signals and replenishment triggers
dcm.orderDCMOrder confirmation, allocation, shipment
dcm.returnsDCMRMA, receipt, credit, restock
Canonical IDs and events ship in @betterdata/loop-definitions.

Actors and guards

Each transition declares:
  • allowedActors — who may initiate or approve
  • guards — e.g. confidence thresholds, human-only steps, evidence-required gates
When a guard fails, the loop does not advance; the runtime records the denial for audit.

Audit trail

Each transition emits a LoopTransitionedEvent-shaped record: actor, signal, from/to state, evidence payload, timestamp, correlationId.
The hosted platform aggregates these into operational dashboards and compliance exports.
Audit trail

Self-host vs hosted

OSSHosted
Runtime@loop-engine/sdkloops.betterdata.co
Contactloopengine.iohello@betterdata.co