Agent programming language

Write agent programs that
outlive the process.

ALGAL is a programming language for long-running agents. Programs are data: they pause for an approval, resume on a new machine, replay from recorded effects, and evolve by proposing, evaluating, and adopting better versions of themselves.

Open source · MIT license · TypeScript and Rust runtimes · macOS, Linux, and algal.cloud

release-review.algal.json · one run, 73 processesThe process VM
algal process create alpha release-review.algal.json --args alpha.args.json --dir ./store
status: ready        generation: 0
algal process tick alpha --dir ./store
status: suspended    generation: 1     waiting for approval
The process ends. Nothing stays running.
algal mailbox send $APPROVALS approve.json --idempotency-key $KEY --dir ./store
delivered once
algal process schedule --max-ticks 8 --dir ./store
ticks: 1             resumed from the record
algal process verify alpha --dir ./store
ok: true             receipts: 2     model calls: 0

2 model decisions0 repeated after resume4 receipts verified offlineRun report

ALGAL is a programming language for agents that run for weeks. A program is data the host can inspect: it pauses for an approval, resumes after a restart, and replays from recorded effects. Programs propose, evaluate, and adopt better versions of themselves, so the software accumulates competence instead of starting over.

Ben Guo

Ask your agent to set it up: algal.computer

What it does

Keep a task running
across interruptions.

A program stops for an approval, the process exits, and another machine continues from the record.

Pause and resume. The dashed steps are read from the record, not run again.

One program

Turn an email
into a drafted reply.

One model call reads the email, a plain match picks the task, and a second call drafts the reply.

reply.algalSource
program reply(email: text) -> text {
  budget { max_agent_calls: 2 }

  let intent = decide "What does this email need?" using email
    as choice {
      help: "Help with a problem",
      sales: "Information before buying",
      other: "Anything else"
    }

  let task = match intent.value {
    help => "Draft a helpful support reply.",
    sales => "Draft a concise sales reply.",
    other => "Draft a clarifying question."
  }

  return generate task using email
}
Generated reply program graph: email flows into a typed decision, a pure decision check and match, then generation. Email also flows directly into generation as explicit context.
Select a step to inspect its inputs and output.

How it works

Your host sets the tools,
models, and limits.

The program is data. Your host grants its tools and budgets and records every effect.

  1. CheckBudgets are read before anything runs.
  2. RunCalls use only what the host grants.
  3. RecordEach step lands in a durable store.
  4. ReplayThe record verifies offline.

Measured

Every run
can be replayed offline.

The release-review program waited for an approval, exited, and resumed in a new process.

  • 0decisions repeated after resume
  • 4receipts verified offline
  • 0model calls needed to verify
  • 73separate processes in one run
Source: vm-demo-report.json, written by bun scripts/vm-demo.ts.

Programs that improve

Programs write programs.
Your host picks which to keep.

A program (an organism, in the specification) proposes a candidate. Your host scores it and keeps the winner.

Propose, evaluate, adopt. The filled candidate seeds the next generation.

Get started

Install one binary.
Run your first program.

One native binary for macOS and Linux. The built-in approval demo needs no model account.

macOS

Terminal
curl -fsSL https://algal.computer/install.sh | sh
Apple silicon

Compared

If you run Temporal, Restate,
Inngest, or LangGraph.

Here the workflow is data a host can inspect, hash, and run.

If you useALGAL differs in
Temporal or RestateThe workflow is a hashed program, not host code.
InngestA step is a typed model decision or a pure expression.
LangGraphThe graph cannot call your process; the host grants every tool.
A plain agent loopThe run pauses for people, exits, and resumes elsewhere.