toren-run
v0.1.18
Published
Durable agent runtime: long-running AI agents on a Postgres event log, in your own cloud. Survives kill -9; a resumed run never re-pays a completed model call.
Maintainers
Readme
Toren
Toren runs agents that work for days and survive anything.
Toren is an open-source runtime for process-shaped agents: work measured in hours and days, not seconds. Agents run as durable processes on an append-only Postgres event log. They survive crashes, deploys, restarts, and a literal kill -9, and they run in your cloud.
- A resumed run never re-pays for a completed model call. Every LLM and tool call is recorded the moment it completes; on resume, finished steps replay from the log instead of the provider. Crash-tested with a kill matrix that murders the process after every single database write and asserts exactly-once billing.
- One deployment, many process agents.
toren dev --dir crews/serves a whole fleet. Each agent crew gets its own isolated event-log schema, the API routes runs by agent, and the console shows every crew. - A built-in console.
toren devserves a web console: live runs, full event timelines, one-click approvals, API-key management. It prints a pre-authenticated link at startup. - Zero-compute parking. Approvals, timers, and long waits hold no worker, no container, no poll loop. A run waiting three days for a human costs nothing.
- One dependency locally, your AWS in production. The whole runtime needs nothing but Postgres. The same agent deploys to Fargate + SQS + RDS with one Terraform module, into a fresh VPC or the one you already have.
- Two-layer execution. Agentic task loops (the model owns control flow) composed by deterministic workflows with parallel waves, record/replay, and surgical invalidation on edits.
Website: toren.run · Docs: toren.run/docs
Quickstart
npx toren-run@latest init my-crew
cd my-crew
npm install
docker compose up -d db
npx toren dev(The npm package is toren-run; the binary it installs is toren.)
Then trigger a run, kill the worker mid-flight, and watch it resume without re-paying a token. The full walkthrough is in the quickstart.
From source
pnpm install
docker compose up -d db
pnpm test # 94 tests, including the crash kill-matricesThe monorepo: packages/core (event log, replay, leases, workflows), packages/cli (toren command + HTTP API), packages/client (TypeScript SDK), packages/console (built-in web console), infra/terraform-aws (AWS deployment, greenfield or bring-your-own VPC/Postgres), examples/, and docs/.
Deploy to AWS
toren deploy-aws --region eu-central-1 --plan-onlyOne Terraform module; every part is optional: reuse your existing VPC, Postgres, and load balancer, or let it create everything. See Deploy to AWS.
License
Apache-2.0. The runtime, CLI, SDK, and deployment tooling are open source, forever.
