|
| 1 | +# Loop Engine |
| 2 | + |
| 3 | +Loop Engine is an open-source runtime for constrained, observable, and improvable |
| 4 | +operational loops. |
| 5 | + |
| 6 | +It helps teams model enterprise processes as finite-state control systems that can |
| 7 | +be operated by humans, automation, and AI. |
| 8 | + |
| 9 | +Created by [Better Data](https://betterdata.co). |
| 10 | + |
| 11 | +## What it is |
| 12 | + |
| 13 | +The Loop Engine gives AI and automation structure, boundaries, and feedback - not |
| 14 | +improvisation. Every process is a bounded state machine. Every action has an |
| 15 | +attributed actor. Every completed loop emits structured training data. |
| 16 | + |
| 17 | +- **Portable loop definitions** - define any process as a bounded state machine |
| 18 | +- **Deterministic guards** - enforce policy before AI or automation can act |
| 19 | +- **First-class actor model** - human, automation, and AI actions are all attributed |
| 20 | +- **Structured events** - every transition emits training-quality data |
| 21 | +- **Self-learning loops** - closed loops generate improvement signals automatically |
| 22 | + |
| 23 | +## Quick start |
| 24 | + |
| 25 | +```bash |
| 26 | +npm install @loopengine/sdk |
| 27 | +``` |
| 28 | + |
| 29 | +```typescript |
| 30 | +import { createLoopEngine } from "@loopengine/sdk"; |
| 31 | + |
| 32 | +const engine = createLoopEngine({ store: memoryStore() }); |
| 33 | + |
| 34 | +await engine.start({ |
| 35 | + loopId: "scm.procurement", |
| 36 | + aggregateId: "PO-2026-0012" |
| 37 | +}); |
| 38 | + |
| 39 | +await engine.transition({ |
| 40 | + aggregateId: "PO-2026-0012", |
| 41 | + transitionId: "confirm_po", |
| 42 | + actor: { type: "human", id: "drew.kim@example.com" }, |
| 43 | + evidence: { approved: true, method: "3-way-match" } |
| 44 | +}); |
| 45 | +``` |
| 46 | + |
| 47 | +## Packages |
| 48 | + |
| 49 | +| Package | Purpose | |
| 50 | +|---------|---------| |
| 51 | +| @loopengine/core | Domain model types - zero dependencies | |
| 52 | +| @loopengine/dsl | YAML/JSON loop authoring, parsing, validation | |
| 53 | +| @loopengine/runtime | State machine executor | |
| 54 | +| @loopengine/guards | Deterministic policy checks | |
| 55 | +| @loopengine/signals | Event-to-signal detection | |
| 56 | +| @loopengine/events | Canonical event schema | |
| 57 | +| @loopengine/actors | Actor model + AI actor constraints | |
| 58 | +| @loopengine/observability | Loop history, timelines, metrics | |
| 59 | +| @loopengine/sdk | Friendly developer interface (start here) | |
| 60 | +| @loopengine/registry-client | Fetch loop definitions from a registry | |
| 61 | +| @loopengine/ui-devtools | React devtools panel | |
| 62 | +| @loopengine/adapter-memory | In-memory store (testing/dev) | |
| 63 | +| @loopengine/adapter-postgres | PostgreSQL persistence | |
| 64 | +| @loopengine/adapter-kafka | Kafka event bus | |
| 65 | + |
| 66 | +## Examples |
| 67 | + |
| 68 | +See [examples/mini](./examples/mini) for lightweight runnable examples. |
| 69 | +For complete reference implementations, see [loop-examples](https://github.com/loopengine/loop-examples). |
| 70 | + |
| 71 | +## Documentation |
| 72 | + |
| 73 | +[loopengine.dev](https://loopengine.dev) |
| 74 | + |
| 75 | +## License |
| 76 | + |
| 77 | +MIT |
0 commit comments