A language + application VM for agent work

Agent work that
survives a pause.
Evidence that stays.

Draft a proposal. Close the terminal. Review it tomorrow.
ALGAL retains the work, waits for your authority, and keeps a history you can verify without calling the model again.

Try the native VM
  1. 01 / retainKeep the exact proposal

    The first command exits. Evidence, result, and pending approval remain.

  2. 02 / decideApprove it later

    Your command authorizes the exact local report. The model cannot approve itself.

  3. 03 / verifyTake the history with you

    Replay the evidence file offline, without the original store or model.

algal demo start ./my-reviewWalk through every step

One native executable. The default demo uses a clearly labeled deterministic decision fixture. Optional on-device Apple generation is a separate workflow. macOS Apple silicon and Linux x86_64 prereleases.

Useful work, with a clear finish line

Choose the job.
Keep the result.

Use ALGAL when the work around a model matters: a human decision, a restart, independent checks, or a reviewable history.

Change review · Native VM

Draft privately.
Publish only what you approve.

Turn a small set of change notes and check results into a retained proposal. Leave it waiting, then approve that exact report in a new invocation. Denial publishes nothing.

You keep: the input evidence, proposal, decision, and local publication.

Run the fixture workbench Use the real on-device Apple model
Coding repair · Bun host

A coding attempt ends.
The checks decide what follows.

Admit a source revision and fixed acceptance commands. Retain the proposed patch, check that exact patch, and produce a review packet. An uncertain launch stays unresolved instead of quietly starting again.

You keep: the patch digest, source binding, check outcomes, and custody record.

Run the deterministic repair episode Understand adapter reconciliation
Execution audit · Either runtime

Share the history.
Verify it elsewhere.

Export a bounded execution capsule. Verification needs no model or credentials and works after the source store is moved away. Altered hashed records and missing dependencies fail verification.

Inspect retained prompts, outputs, and capability strings before sharing; the export does not redact them.

You keep: one portable file and a verified process head.

Export and verify a history See what the evidence proves
Support workflows · Readable source

Route the request.
Reuse the part that works.

Classify an email, execute only its selected response branch, and use the same draft helper over a bounded inbox. Each effect receives declared context; inactive branches make no model calls.

You keep: reusable program artifacts, ordered results, and replayable receipts.

Inspect three recorded routing paths Explore the reusable inbox

Also included: a read-only PR shepherd that waits for CI and collects revision-bound evidence without model calls. Live coding providers require separate host configuration and qualification. All use cases, commands, and adoption boundaries

Build the program your work needs

Readable intent.
Executable structure.

Start with a narrow decision and an explicit budget. Compose programs as values; inspect the diagram and recorded execution as the workflow grows.

reply.algalOne program. Two views.
01 / Read the intentSource
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
}

A decision. A pure match. A draft.
The model sees the context you declare. The program makes the limits visible.

2 executor attempts, at most0 model calls in match
02 / See the structureExpand
Generated reply program graph: email flows into a typed decision, a pure decision adapter and match, then generation. Email also flows directly into generation as explicit context.
Source names explain the work; exact cell IDs remain visible. The graph includes the pure decision check.

Executable source, not pseudocode. The Bun compiler lowers .algal into the existing algal.organism.v1 format. Both runtimes execute the compiled manifest.

One executable meaning

Read it. Run it.
Ask what happened.

A diagram comes from the program. An execution overlay comes from its receipt. The views stay connected to the artifact they explain.

  1. 01

    Write a program

    Immutable values, explicit model effects, exhaustive choices, and declared budgets.

    .algal source
  2. 02

    Compile its structure

    A deterministic compiler produces a typed manifest and a source-map sidecar. Diagrams come from that manifest.

    .algal.json + diagram
  3. 03

    Keep the evidence

    Receipts record execution. Replay checks the orchestration against recorded external answers.

    receipt + verification

Replay checks execution consistency. It does not establish that a model answer is true or attest that a provider performed an operation.

Follow one execution

Only the chosen
branch runs.

Choose a recorded decision. Support and sales each draft a reply with the declared email context. Human review returns a fixed message. Inactive branches stay visible—and skipped.

Scripted execution; no live model callroute.algal
Recorded choice · help

Support

Actual returned value

I can help with that. What happens when you try to sign in?

Executor attempts
2of 2 allowed
Inactive draft branches skipped
1
CommittedSkippedExpand all cells
Source-derived routing graph for the recorded help decision. 2 executor attempts completed; 1 inactive draft branch was skipped. All exact cells remain visible.
Receipt sha256:d22379d7548983bf072c1f13e698d5748da73e609f1e5580cf9b182cd682579eDownload receipt Scripted answers
Recorded choice · sales

Sales

Actual returned value

Tell me about your team and I can suggest a plan that fits.

Executor attempts
2of 2 allowed
Inactive draft branches skipped
1
CommittedSkippedExpand all cells
Source-derived routing graph for the recorded sales decision. 2 executor attempts completed; 1 inactive draft branch was skipped. All exact cells remain visible.
Receipt sha256:b43387ba0265fbe4193b3a347b58f73a1621f1d7fe1dca94c2ebacf31d651a9cDownload receipt Scripted answers
Recorded choice · other

Human review

Actual returned value

Needs a human review.

Executor attempts
1of 2 allowed
Inactive draft branches skipped
2
CommittedSkippedExpand all cells
Source-derived routing graph for the recorded other decision. 1 executor attempts completed; 2 inactive draft branches were skipped. All exact cells remain visible.
Receipt sha256:32d0c11cc6e14825724316a91c2f39fc0ddc65fb88ba25253b79f45de5da5245Download receipt Scripted answers
Read the program behind all three runs
program route(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"
    }

  return match intent.value {
    help => generate "Draft a helpful support reply." using email,
    sales => generate "Draft a concise sales reply." using email,
    other => "Needs a human review."
  }
}

Compiled manifest · Source map · Shared input

Each view comes from an actual runtime receipt generated and replay-checked during the site build. The selector changes which receipt you inspect; it does not run a model in your browser.

A useful program becomes a building block

Write it once.
Use it across an inbox.

Import a local helper, call it for one preview, then apply it to a bounded list. The same compiled child handles every email with the tone you pass explicitly.

The caller · inbox.algal

import draft from "./draft.algal"

program inbox(sample: text, emails: json) -> json {
  budget { max_agent_calls: 4 }

  let preview = call draft using {
    email: sample, tone: "helpful"
  }
  let replies = each draft over email in emails
    using { tone: "helpful" } max_items 3

  return { preview: preview, replies: replies }
}

The reusable helper · draft.algal

program draft(email: text, tone: text) -> text {
  budget { max_agent_calls: 1 }
  return generate "Draft a reply using the requested tone."
    using { email: email, tone: tone }
}
The limit composes1 preview + 3 emails × 1 child call

4 executor attempts maximum. Replies keep input order; items execute sequentially.

check reports 2 source files · 1 child level required. Structural bounds, not a cost forecast.

Actual program / call + eachExpand
Generated inbox graph with one named child call for a preview and a bounded each cell for up to 3 emails. Both use the same digest-addressed draft program.
Each child boundary pins the helper's compiled digest. The downloadable bundle includes the caller and its full child closure.
Inspect the recorded results 3 replies · 4 attempts · replay checked

Scripted executions; no live model calls

  1. I can help you sign in. What happens when you enter your email?
  2. I can help update your delivery address. Has the order shipped?
  3. Your invoice is available under Billing in your account.
Empty inbox? No child applications.

The empty-list run returns [] for replies and uses 1 executor attempt for the separate preview. Empty-list receipt

Open one child call Original receipt · exact invocation

Scripted executions; no live model calls

Follow a call into its helper. Each view shows only that email’s recorded cell states, with the root receipt and invocation path retained.

Email 1 · one recorded invocation

I can help you sign in. What happens when you enter your email?

b2-replies-each/i0 · draft.algal

Exact draft helper graph and recorded cell states for email 1, bound to the original inbox receipt.
Expand child graph

Email 2 · one recorded invocation

I can help update your delivery address. Has the order shipped?

b2-replies-each/i1 · draft.algal

Exact draft helper graph and recorded cell states for email 2, bound to the original inbox receipt.
Expand child graph

Email 3 · one recorded invocation

Your invoice is available under Billing in your account.

b2-replies-each/i2 · draft.algal

Exact draft helper graph and recorded cell states for email 3, bound to the original inbox receipt.
Expand child graph
Catch a mistake before a run Imported helper · unknown binding

A helper refers to emial when its input is named email. The compiler points to the expression and the import that led there.

Actual compiler output · no program execution

PARSE_FAILED: unknown name emial
At helpers/draft.algal:5:11
Imported from main.algal:1:1 -> ./helpers/draft.algal
5 |     using emial
  |           ^^^^^

Change emial to email and this example compiles. Use --diagnostic-format text to read errors in the terminal, or json for tools.

Find the source of a failure Second item · exact file and line

A pure batch calculation divides by zero in its second item. The report points to the expression in ratio.algal and its caller. The first item completed; the third never started. No model calls.

Algal failed · digest-bound (not replay verification)
Receipt: sha256:b5255ea95739e5b93e2745d7bfd60b68046f413fbb86f72dfb08a8e029b613f9
Manifest: sha256:4da29e11e19de47a2ced05ca4e2c80832d2f9a2aba93da74e611dc1eea202fa3
Source: sha256:b9064efdd18d4115f9675279636cdf94f1ef3151f1eb3839338128297f2e75de

failure · EXPR_FAILED · result-each/i1/b1-fraction
Recorded message: expr {"code":"EXPR_DIV_ZERO","op":"div"}
At ratio.algal:4:18 (fraction) [expression]
  let fraction = sample.numerator / sample.denominator
Called from ratios.algal:6:10 (return) [each index 1]
Focused graph for the failed second ratio calculation, highlighting the division expression and retaining its root receipt binding.

The same core, more ambitious programs

Start small.
Grow deliberately.

Refine a draft. Suspend for approval. Apply a child program to a collection. Propose a new program. Every effect and boundary has a place in the graph.

Bounded refinement

Improve it.
Check it.
Know when to stop.

An editor rewrites a draft. A critic returns ship or revise. A repeat cell carries the draft into the next round, up to 4 rounds.

The final verdict still matters. Reaching the round limit returns the last outputs; it does not turn revise into success. The graph sends that result to hold.

The boundary is part of the program4 rounds maximum

Each round contains an editor and a critic. The parent's attempt budget also bounds nested execution.

Inspect the manifest
Actual program / repeat + guarded branchesExpand
Generated refinement graph. Draft enters a repeat cell bounded to 4 rounds. Its final verdict selects ship or hold through explicit guards.
The loop is a bounded child operation. The outer dataflow graph stays acyclic.
Durable approval

Pause the work.
Keep the progress.

A model reviews evidence and proposes a recommendation. The process can suspend while a child program waits for a host-supplied approval message.

On resume, a pure check requires both an approve decision and a matching release identifier before the publication effect becomes eligible.

Authority remains with the hostRecommend → wait → authorize

This example publishes a report to a local mailbox. The model does not approve or deploy a release.

Run the durable process demonstration
Actual program / tools + durable childExpand
Generated release review graph: evidence feeds recommendation, a proposal is recorded, the child waits for approval, and an authorization expression guards publication to a local mailbox.
Data dependencies retain the order. Mailbox capabilities are admitted by the host.
Bounded composition

One useful program.
A collection of questions.

The each cell applies a pinned child program to each question, up to 8 items. A pure function joins the answers.

The child's interface makes it reusable. Its content digest fixes which program is being called. The parent bounds how much work the collection can create.

Fan-out is explicit structure8 items maximum

Independent work is visible in the graph. This does not promise concurrent execution or a wall-clock speedup.

Inspect the manifest
Actual program / each + collectionExpand
Generated question swarm graph: a list of questions enters an each cell with maxItems 8, then answers flow to the pure join.v1 function.
A reusable child is an artifact with a declared interface, not an invisible prompt template.
Programs as values

A program can
propose its successor.

A designer produces a child manifest as data. A bounded spawn operation admits and runs it, and its digest is appended to a persistent population slot.

That is the starting point for a habitat. Foundry and civilization workflows evaluate candidates on declared cases; host selection decides what to retain or promote.

Proposal is not promotionInspect → evaluate → select

The graph shown records a proposed child's digest. It does not itself prove improvement or promote a winner.

Explore measured populations and lineage
Actual program / spawn + persistent slotExpand
Generated habitat graph: a goal reaches a designer agent that proposes a child manifest; spawn runs the admitted child, then its digest joins population history and is written to a slot.
Execution explains what a program did. Evaluation and lineage explain why a version was retained.

These are generated views of existing executable manifests. Readable source covers values, decisions, generation, conditional branches, local imports, named calls, and bounded each; repeat, waits, and evolution remain available through the manifest API.

From one program to a measured population

Growth needs
a selection rule.

Better programs come from evidence. Keep the candidate, its evaluation, and the host's decision connected—so growth has a history you can inspect.

  1. 01 / proposeCandidate artifacts

    Model-produced plans or manifests

  2. 02 / admitTyped, bounded programs

    Host compilation and checks

  3. 03 / measureEvaluation evidence

    Declared cases and work limits

  4. 04 / selectRetain or promote

    Host policy and recorded lineage

Conceptual lifecycle of the existing foundry and civilization workflows. This is not a recorded run or a promise that a candidate improves.

Start with the working VM

One executable.
A review you can return to.

Download and verify a native prerelease. The built-in workbench needs no checkout, Bun, Cargo, credentials, or web server. Use a fresh directory for each demo.

Download the prerelease

Checksums, install instructions, and platform support

Terminal · after installationRetain / review / prove
# Inspect the installed build identity
algal doctor

# Leave a real process waiting for your decision
algal demo start ./my-review
algal demo inspect ./my-review

# Open my-review/report.html for the exact decision command

# Kill owned VM children and check their recovery
algal demo prove ./crash-laboratory

Inspect crash-laboratory/proof.json: approved once, denied without publication, completed writes reused after a read crash, and an uncertain write blocked from redispatch. Fixture decisions; real processes, journals, and verification.

Choose the right boundary

Start with a bounded
workflow you own.

ALGAL fits local review queues, checked coding episodes, reusable judgment pipelines, and inspectable evidence. A single unstructured prompt may need less machinery. Existing durable workflow engines may already meet your recovery needs.

This is an application VM prerelease. Packages are unsigned and unnotarized. Hosts still own tool permissions, external-effect reconciliation, storage operations, and any required OS isolation. Multi-tenant service operation, distributed custody, and global quotas are unfinished.

Receipts check execution consistency, not factual truth or provider attestation. Unknown external writes are not made exactly-once by replay. The adoption guide explains these boundaries before you connect a real system.

Ready to author? Compile your first readable program

01

Pure core, explicit effects

Immutable values and deterministic expressions carry the structure. Models, tools, and durable state have visible boundaries.

02

Bounds before execution

Programs declare limits. The host owns admitted functions, providers, tools, and capabilities. A manifest grants no OS isolation.

03

Evidence you can inspect

Content-addressed programs and receipts connect source, structure, and execution. Measure quality on the workload that matters.