Durable multi-agent workflows

LLM workflows that remember what they’ve already paid for.

Rulvar is an embeddable TypeScript engine for multi-agent work that survives crashes, edits, and redeploys—without re-running completed calls.

pnpm add @rulvar/rulvar
resume / review-pr-42
126 ms
00
workflowreview-pr
replayed
01
agentcorrectness
replayed
02
agenttest coverage
replayed
03
agentfinalize
replayed
journal match sha256: 18c2…91e7

A library, not a platform.

Code, not graphs.

Guarantees, not hints.

01 / Invariants

The unit of trust is
a guarantee.

Rulvar’s architecture is built around properties that hold through every run—not optimistic conventions your application has to police.

01

Content-addressed journal

Never pay twice.

Completed effects replay byte-identically from disk. Insert, reorder, or remove a step—unrelated work stays valid and free.

Read about the journal ↗
02

Immutable USD ceiling

Hard budgets, not hints.

Admission control, a per-turn guard, and a live abort ceiling bound every run. Exhaustion returns typed partial results and a complete cost report.

See budget guarantees ↗
03

Per-invocation routing

Vendor-neutral by construction.

The core imports no provider SDKs. Route each role to the right model—even mix providers safely within a single agent.

Explore providers ↗
04

Hermetic by default

Testable to the byte.

Fake adapters, redacted VCR cassettes, and replay-strict runs turn agent workflows into fast, deterministic CI tests.

Testing guide ↗

02 / Orchestration

Three ways to decide.
One way to execute.

Change who authors the control flow without changing the guarantees underneath.

DETERMINISTIC TYPESCRIPT

You write the workflow.

Ordinary async TypeScript over typed ctx primitives. The most direct path when your control flow is known.

engine.run(workflow, args)
Human script
01Runtimetyped agent loop
02Journaldurable replay
03Budget pathhard USD ceiling

One event stream. One cost report. One replay model.

Compare orchestration modes

03 / Embeddable first

Your process.
Your infrastructure.

Rulvar is a dependency, not a destination. Add it to a Node.js application and keep your own deployment, storage, tools, and providers.

  • No server required
  • No database required
  • No control plane

review.ts

import {
  createEngine, defineWorkflow,
  anthropic, JsonlFileStore
} from '@rulvar/rulvar';

const engine = createEngine({
  adapters: [anthropic()],
  stores: {
    journal: new JsonlFileStore({
      dir: '.rulvar/journal'
    })
  }
});

const review = defineWorkflow(
  { name: 'review-pr' },
  async (ctx, diff) => ctx.parallel([
    () => ctx.agent(`Review: ${diff}`),
    () => ctx.agent(`Test: ${diff}`)
  ])
);

const run = engine.run(review, diff, {
  runId: 'review-42',
  budgetUsd: 5
});
ESM · Node.js 22.12+ TypeScript

04 / Resume

Same run.
Zero new spend.

rulvar / review-42 ● live

$ pnpm tsx review.ts

run:start review-42 budget $5.00

agent:end correctness $0.0214

agent:end test-coverage $0.0179

run:end ok $0.0393

$ pnpm tsx resume.ts

run:start review-42 resumed

agent:end correctness replayed

agent:end test-coverage replayed

run:end ok 3 hits · 0 misses · $0.0000 new

The workflow body executes again. The journal answers completed effects; only a genuine miss becomes a live provider call.

Open source · Apache-2.0

Make the workflow
reliable by construction.