Skip to content
The Borz language

Two first-class constructs. One .borz source file.

Declare pure LLM agents with a model, persona, and typed interface. Write actors that compile to several targets — native binary (supported), and experimental DENSE and WASM backends (DEMIX is not available yet) — without changing the program. Both constructs share one typed message bus.

classifier.borz spec v0.13
import "std/string" as *

msg Classify:
    text: str

actor Classifier:
    @persistent var label:      str = "unknown"
    @persistent var call_count: i64 = 0

    on msg Classify:
        call_count = call_count + 1
        infer:
            system: "Classify the topic in one word."
            user:   msg.text
            target: label
        response(label, f"[{call_count}] {to_upper(label)}")
3
compile targets
Pending
warm dispatch · bare-metal figure pending
13+
verified examples

Two typed building blocks.

agent — pure LLM persona Claude · ollama · gemma4
agent AnomalyNarrator:
    model:  local:ollama:gemma4:12b
    memory: rolling(turns: 5)

    system: """
        Financial anomaly analyst.
        Two-sentence narrative + action:
        block | hold | approve.
    """

    tools:   [ MerchantDB.Lookup ]
    accepts: [ NarrateAnomaly ]
    emits:   [ AnomalyReport ]
actor — deterministic, several targets native · DENSE · WASM
actor RiskActor:
    @persistent var flagged: i64 = 0

    on msg ScoredTransaction:
        if msg.risk_score > 0.85:
            flagged = flagged + 1
            # typed send → the agent above
            send AnomalyNarrator <- NarrateAnomaly(
                tx_id:      msg.tx_id
                merchant:   msg.merchant
                risk_score: msg.risk_score
            )
Two building blocks

One language. Two kinds.

agent and actor are distinct first-class constructs in the same .borz source file. The compiler checks both sides of every handoff between them.

agent
pure LLM agent
Claude · ollama · gemma4

A first-class Borz construct defining a pure LLM persona: persona prose, a mandated model and host, a declared toolset, memory, and a typed message interface. The whole agent is inference — it does not call an LLM, it runs as one.

  • →Model-portable: pin to claude:opus, local:ollama:gemma4:12b, or any compliant host
  • →Typed interface: declares which message types it handles; compiler rejects wrong-shape callers
  • →Memory: rolling-window or persistent conversation — declared in source, managed by Clan Control
  • →Tools: declared capabilities per agent; the policy hook checks them where it is installed
Never DENSE

Agents have no handler bodies and no state variables. The compiled artifact is a validated JSON manifest. DENSE constraints do not apply.

actor
deterministic compiled code
native · DENSE · WASM

Isolated compiled Borz code with typed messages, sequential handlers, and persistent state. The compiler enforces isolation — no shared variables, no global state. May call infer for one typed LLM step (agentic actor) — still an actor, still deterministic core.

  • →Write once: the same source targets several backends — change the flag, not the program; constructs a backend cannot support are refused at compile time, not miscompiled
  • →@persistent state: on the native target, only @persistent variables survive a restart; DENSE keeps them in a canonical state codec
  • →DENSE target: flat ELF, 2 MiB cap; experimental target
  • →On Epher: any actor can be deployed there; the optional @deterministic marker adds a compile-time determinism check
Agentic actor ≠ agent

An actor that calls infer is an agentic actor. Its control logic is still Borz source code. It is not a pure LLM agent.

One typed message bus

Agents and actors communicate over the same typed message system. An actor sends a typed message to an agent — the agent processes it as an LLM call and sends a typed reply back. The compiler checks both sides of every contract at build time.

RiskActor (DENSE) → NarrateAnomaly → AnomalyNarrator (gemma4) → AnomalyReport → AuditActor (DENSE)
What comes next

Write actors. Build a Clan.

Borz actors are the code-driven members of a Borz Clan — running alongside AI agents on one unified substrate. Once you write actors in Borz, you can deploy them directly into a Clan via Clan Control.