Call an agent like a function: a hands-on guide to Chaos Intelligence
Most agent frameworks make the model the program: a prompt, a loop, a pile of tool calls. Chaos Intelligence flips that around. Ordinary functions do the exact work, and an agent is just another value you can pass around, call, and compose — in the same syntax, in the same file. This guide proves the core of that idea on your own machine: unpack the project, run the bundled program, and build three small programs that return 42, 49, and 42 again — all without a model, an API key, or a network connection.
./chaos run, and three small programs prove the idea offline: a function that squares 7, a program that doubles JSON input, and a function passed as a value. A live agent call is optional, needs a provider key, and is never required for the language itself.- Who: Cattmonkey — the Chaos Intelligence project on GitHub.
- What: A programming language and development environment in which agents are callable values, alongside ordinary functions, goal-driven bots, and programs that return interactive pages.
- When: Created on GitHub on October 23, 2026; version 0.154.4 was released on October 24, 2026.
- Traction: 202 GitHub stars at the time of writing — in its first four days.
- Licence: Chaos Intelligence Source-Available License — No AI Training, Version 1.0 (not an OSI open-source licence).
- Requirements: Python 3.9 or newer; the project ZIP does not include Python. Pure computation needs no model, API key, GPU, or network connection.
Here is the pitch, stripped of marketing: if an agent is a value, you can do everything with it that you do with a function. Pass it as an argument. Return it from another function. Call it only when the last expression of your program says so. That is a genuinely different shape from the usual agent loop, where the model sits at the centre and everything else is a tool bolted on. Whether that shape survives contact with a real, messy project is a separate question — but the language part of it is small enough to test in ten minutes, and that is what this guide does.
One honesty note up front: I ran every offline command below on Linux with Python 3.12.3, and every output shown is the output I got. I did not run a live model call — that needs a provider key I did not set up for this guide — so the agent section below is documented from the project's own README and docs, not from a run, and it is labelled as such.

What you'll need
- Python 3.9 or newer. This guide ran on Python 3.12.3 on Linux; macOS works the same way, and Windows uses
.\chaos.cmdwherever this guide writes./chaos. - About 10 MB of disk for the project ZIP (5.0 MB downloaded) plus whatever the optional IDE setup installs later.
- No account, no API key, no GPU, and no network connection for Steps 1–5. The download itself is the only network step.
- A terminal and a text editor. Nothing else is installed globally: the project ZIP carries its own runtime.
Step 1: Download and unpack the project ZIP
Chaos Intelligence ships as a project ZIP on its releases page, not as a package you install into your system Python. Grab the latest release and unpack it into a fresh directory:
curl -fsSL -o Chaos-Project.zip https://github.com/Cattmonkey/ChaosIntelligence/releases/latest/download/Chaos-Project.zip
unzip -q Chaos-Project.zip -d chaos-project
cd chaos-project
Inside you should find chaos, chaos.cmd, chaos.py, chaos.project.json, and main.chaos. That set is the whole project: the launcher, the runtime, and the bundled program. If chaos.py or main.chaos is missing, you unpacked the wrong asset — go back to the releases page and pick Chaos-Project.zip, not the source tarball or the wheel.
Step 2: Run the bundled program
The bundled program is the language's hello world, and it is deliberately boring:
./chaos run
42
That is the whole output. The bundled main.chaos computes 42, and the last expression of a Chaos program is its result — there is no print ceremony, no entry-point boilerplate. If you get an error about Python here, check python3 --version first: the ZIP does not bundle a Python interpreter, and the launcher looks for one you already have.
Step 3: Write a program, check it, then run it
Create hello.chaos:
fn square(x: Int) -> Int { x * x }
{message: "Hello, Chaos", answer: square(7)}
Three things to notice. fn defines a function, with a type annotation that acts as a runtime contract. Records use {key: value}. And the last expression — the record — is the program's result. Now check it before running it:
./chaos check hello.chaos
./chaos run hello.chaos
{"valid": true, "entry": "hello.chaos", "files": ["hello.chaos"], "dependencies": {"hello.chaos": {}}, "exports": {"hello.chaos": []}, "macroExports": {"hello.chaos": []}, "version": "0.154.4"}
{"message": "Hello, Chaos", "answer": 49}
check parses the program and reports its module dependencies and exports without executing anything; run executes it and writes the final result to stdout. Keeping those two apart matters later: you can validate a program that talks to a model without paying for a call. Formatting is a third, separate operation — ./chaos fmt hello.chaos prints the formatted source to stdout without overwriting your file.
Step 4: Pass input in as JSON
Chaos programs can read a single input value. Create double.chaos:
fn double(x: Int) -> Int { x * 2 }
double(input)
./chaos run double.chaos --input-json 21
42
The input is JSON, not a bare string: 21 is valid JSON, so it works, but a string input must be written as a JSON string. That is a small gotcha worth knowing before you wire a shell script around it. The result, again, is just the last expression's value.
Step 5: Pass a function as a value
This is the step the whole project is about. Create twice.chaos:
fn twice(f: Function, x) { f(f(x)) }
fn add_one(x: Int) -> Int { x + 1 }
twice(add_one, 40)
./chaos run twice.chaos
42
twice takes a function and a value, and applies the function twice. Nothing here involves a model. The point is the plumbing: functions are values you can pass, and the language treats that as ordinary, not special. Now the agent version uses exactly the same call shape:
agent teacher {
provider: "model",
role: "planner",
prompt: "Explain the programming concept with one short example.",
tools: [],
maxSteps: 3
}
teacher("What is a closure?")

Declaring the agent does not call a model — only the final expression does. That is the design claim that makes the rest of the system composable: you can build a pipeline of planning, execution, and review steps as values, and nothing runs until you call it. To actually run an agent, configure a provider first with ./chaos configure --models or on the project's /control page in the web IDE, keeping credentials out of source code. Model requests may incur provider charges, and this guide did not run one — treat the agent snippet above as documented syntax, not a verified run.
Step 6: Open the web IDE (optional)
The command line is the whole language, but the project also ships a browser IDE for editing, running, and inspecting execution events. From your project directory:
./chaos setup --yes
./chaos
Per the docs, setup installs the IDE and documentation dependencies into the project (not into your global Python), and the bare ./chaos launch prints the actual local address and opens the workspace for the current directory — it does not fix a port. Inside, you edit files, run the entry program, and watch public execution events in the output pane. The IDE is a view over the same project, not a separate product: the files on disk are the source of truth. If you only care about the language, skip this step entirely — Steps 1–5 are complete without it.

What you built
Three programs and one mental model. The bundled program returns 42. hello.chaos returns a record with a message and a computed answer. double.chaos turns JSON input into a result. twice.chaos shows a function travelling as a value — and the agent snippet shows the same shape with a model on the other end. None of it needed an account, and none of it phoned home. That offline core is the part of Chaos Intelligence you can evaluate today, in full, for free.
The honest limits
First, maturity. This is a four-day-old public project at version 0.154.4 with 202 stars: the version number looks large, but the public history is days long, and you should expect rough edges, breaking changes, and thin answers to hard questions. Second, documentation language: the English README covers the core well, but much of the deeper documentation — including the getting-started guide — is in Chinese, so non-Chinese readers will lean on the English README, the examples, and machine translation for the rest. Third, the licence: this is source-available, not open source in the OSI sense, and the licence is explicitly a no-AI-training licence — read it before building anything commercial on top of it. Fourth, the agent story is still a promise in this guide, not a measurement: without a live provider run, there is no latency, cost, or quality number to report, and goal-driven bots and live pages are documented features, not things this tutorial exercised. Finally, the usual agent caveat applies in full: giving a model tools and a goal does not make its output correct, and the language's clean call shape does not remove the need to validate what the model returns.
Frequently asked questions
Do I need a model API key to use Chaos Intelligence?
No — not for anything in Steps 1–5. Pure computation runs offline with no model, key, or network connection. You need a provider key only when you actually call an agent, and model requests may incur provider charges.
Does it work on Windows and macOS, or only Linux?
It works on all three, with Python 3.9 or newer. macOS and Linux use ./chaos; Windows PowerShell uses .\chaos.cmd. The project ZIP does not include Python, so install that first on any platform.
Is Chaos Intelligence open source?
No, not in the OSI sense. It is released under the Chaos Intelligence Source-Available License — No AI Training, Version 1.0. You can read and use the source under that licence, but check its terms before building commercial work on it.
Sources
- Chaos Intelligence on GitHub — github.com/Cattmonkey/ChaosIntelligence (project description, creation date, star count, licence, and release v0.154.4).
- Chaos Intelligence, English README — the language pitch, the
twiceandteacherexamples, and the model-configuration notes. - Chaos Intelligence, getting-started guide — the project ZIP flow,
check/run/fmt/replcommands, JSON input, and the web IDE setup. - Chaos Intelligence releases — v0.154.4, released October 24, 2026, including the Chaos-Project.zip asset used here.