Max
BDI agents with a neural engine: models perceive, logic decides, and every answer comes with its plan, its norms and its trace.
In use by Turing, Litush, Katharsis, Make and Mail
Max
Max is MLambda’s agent language (.max) and the runtime its agents run on. A Max agent follows the
belief–desire–intention (BDI) architecture: it holds what it believes, wants what it desires, commits to an
intention and carries out a plan. What is new is the split of the work:
- Neural models perceive. A plan calls models by name (Neuron’s local models, or Claude and Gemini in the cloud) to read a message, hear a sound, see a picture, classify, embed or draft.
- Logic decides. What the agent is owed, licensed, has achieved or has broken is derived by a Shin theory compiled from the agent and the Hilbert experts it imports. No model decides what is allowed.
So an agent can be fluent without being reckless. The sample airline assistant cannot do what Air Canada’s chatbot did in Moffatt v. Air Canada: it cannot promise a refund the policy does not license, because the promise is a derived norm, not a sentence a model wrote.
An agent
artifacts {
chat general { provider env("MAX_CHAT", "gemma-3-1b") }
decide reader { provider env("MAX_DECIDE", "laya") }
embed general { provider env("MAX_EMBED", "embeddinggemma-300m") store "memory/airline" }
hear ears { transcribe env("MAX_HEAR", "WhisperTinyEncoder") }
}
context policies(general) { "data/policies.md" }
chat Read(message: Text) : general {
ask read(message)
returns { asks: [Act] }
map { each a in asks => believe asks(a) }
}
plans {
Understand = {
heard ← Listen(message.sound)
b ← query Bookings where reference in heard
match b {
row(r) => believe booking(r)
none => skip
}
Read(message)
believe understood
}
}
- Beliefs are data: typed records, the agent’s state.
- Intentions are the decision to run a plan, read from the state by rules.
- Plans are the actions: they call the models and change the state with
believeandforget. Reading the message is itself a plan, and the agent deliberates again after every plan. - A map is Shin laws: a model’s answer is asserted as facts, and each arm is a law from those facts to a belief.
- Sortals are a lattice.
Grandparent ⊑ CloseKin ⊑ Kin, so a policy written forKincovers a grandmother. Amatchis checked for exhaustiveness and reachability through the lattice.
The compiler
The Max compiler turns each .max into three things at build time: a Hilbert theory (its norms), its
deliberation engine and an Aleph agent. Its checks are Shin rules too: a word a model kind does not have, a
name no step bound, a match that leaves a sort unanswered, a prompt whose keys disagree with its template. Each is
a coded error (MX0301 to MX0330) that stops the build.
At run time
A host lists the models it carries once, as a kit, and asks:
answer = agentAsk (airlineAgent kit ".") (Message "My grandmother died; can I get the bereavement fare?" [])
-- answer.turnReply, answer.turnIntention, answer.turnNorms, answer.turnBeliefs, answer.turnTrace
The answer is the reply, the plan carried out, the norms that hold, the beliefs, and a trace of every model call. A kit names no model: a setting does, and a model no link serves is a stated refusal, never a silent fallback. Agents form societies: Turing’s analysis is a society with one agent per level of the backlog.
Where Max decides
- Turing: the analysis and design agents.
- Litush: six agents (Judge, Planner, Refactorer, Guard, Handoff, Reporter) that polish code.
- Katharsis: the Flow agent that acts or waits at each step of a release.
- Make: the assistant that proposes a flow from a sentence.
- Mail: how far the guard looks at a message.
- Playground: a society that decides when each stage of a comparison runs.