Skip to Content

Your Modular AI Stack

Loopstack is a TypeScript framework based on NestJS for building AI agents and durable AI workflows - build for professional use.

Open SourceTypeScriptNestJSStudio & CLI GitHub
support.service.ts
const { workflowId } = await this.workflowRunner.run(
  ReviewTicketWorkflow,
  { ticketId },
);

What You Build

Build stateful AI agents and workflows that call your tools, coordinate sub-agents, and pause for human input.

How It Works

Compose complex AI systems from modular building blocks

{}
my.workflow.ts
@Workflow()
export class MyWorkflow extends BaseWorkflow {

  // inject any service or tool here

  @Transition({ from: 'start', to: 'step1done' })
  async handleStep1(state, ctx) {
    // any code for step 1
  }

  @Transition({ from: 'step1done', to: 'end' })
  async handleStep2(state, ctx) {
    // any code for step 2
  }
}

Workflows

Workflows are TypeScript state machines with explicit states and transitions. Inject tools, call LLMs, and create structured documents within transitions. Take different paths depending on the result, run steps in parallel, or pause for a human to respond. A single step can run another workflow or an AI agent. Every step is checkpointed, so failures resume right where they left off.

Learn more

Integrate into your app

Trigger workflows from anywhere in your NestJS app: a controller, a queue consumer, or a scheduled job.

escalation.scheduler.ts
@Cron(CronExpression.EVERY_30_MINUTES)
async sweepStaleTickets() {

  const { workflowId } = await this.workflowRunner.run(
    TriageTicketWorkflow,
    { status: 'stale' },
  );

}
Run via Cron, webhooks, queues, or any service Subscribe to streamed output Hand off to browser interface

Interact and run
from Terminal

npm i -g @loopstack/cli — and every workflow is a command. Runs stream live: transitions, LLM tokens, tool calls, and human-in-the-loop prompts answered right in your terminal.

~ loopstack
$ loopstack run triage-ticket --arg ticket=1042
▸ analyze_ticket
⚒ fetch_ticket {"id":1042}
→ #1042 · "Login timeouts since 2.4.1" · prio: high
assistant:
Auth latency spike after the 2.4.1 rollout — affects EU
tenants. Severity: high.
analyze_ticket (2.4s)
waiting_for_approval (19ms)
Escalate to engineering?
[y]es / [n]o: y
waiting_for_approval
escalated:
true
run completed in 4.9s
CI-ready with JSON output & exit codes Operable by AI agents Attach to any running workflow

Interact and run
from Studio

Run, debug, and organize automations in the built-in frontend. Forms, documents, and live progress render from your workflow's config — no frontend code required.

app.loopstack.ai/runs/9f2e41c8
triage-ticket#42
Completed
Ticket #1042 — “Login timeouts since 2.4.1”
fetch_ticket
#1042 · EU tenants · priority: high
Auth latency spike after the 2.4.1 rollout — affects EU tenants. Severity: high.
Waiting for approval

Escalate ticket #42 to on-call engineering? Severity was classified high.

Approved
Run completed · 4.9s
Built-in React frontend Visual: diagrams, documents, live progress Extensible with widgets & custom forms

Features

Everything built in — pick a card to explore it in depth.

Ready to Build?

Start a new app or drop Loopstack into your existing NestJS project.

Read loopstack.ai/llms.txt, then help me build a Loopstack project and my first AI workflow

Works in Claude Code, Cursor, or any coding agent.

Supported by:

IFB Innovations StarterAethos - Center of gravity for responsible AI