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.
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.
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.
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
}
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.
- CheckBudgets are read before anything runs.
- RunCalls use only what the host grants.
- RecordEach step lands in a durable store.
- 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
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.
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
curl -fsSL https://algal.computer/install.sh | shLinux
curl -fsSL https://algal.computer/install.sh | shWindows
curl -fsSL https://algal.computer/install.sh | shCompared
If you run Temporal, Restate,
Inngest, or LangGraph.
Here the workflow is data a host can inspect, hash, and run.
| If you use | ALGAL differs in |
|---|---|
| Temporal or Restate | The workflow is a hashed program, not host code. |
| Inngest | A step is a typed model decision or a pure expression. |
| LangGraph | The graph cannot call your process; the host grants every tool. |
| A plain agent loop | The run pauses for people, exits, and resumes elsewhere. |