2.4 compatibility in Nexa 3.0
This page describes the retained 2.4 language/runtime path. Sources without a version declaration use this path. Start new Open Programs with Nexa 3.0; compare contracts in the migration guide.
Use the 2.4 compatibility path¶
Run a program without a model, then compile an Agent. These pages use the released Nexa v3.0.0.
1. Install the runtime¶
Use Git, Python 3.10+ and uv. Obtain the release source in your working directory and install its locked dependencies:
Release tag v3.0.0 points to the verified commit 2743796.
git clone --branch v3.0.0 --depth 1 https://github.com/Nexa-Language/Nexa.git
cd Nexa
uv sync --locked
uv run nexa --version
Confirm the output is Nexa v3.0.0. Run the remaining commands from this source directory.
2. Run your first program¶
Save this as hello.nx. Compilation and execution need no credentials. The result is 12.
flow main {
first = 3;
print(first * 4);
result = first * 4;
}
uv run nexa validate hello.nx --json
uv run nexa run hello.nx
validate returns structured diagnostics; run compiles and executes the program. uv run nexa build hello.nx writes the generated hello.py for inspection.
3. Define an Agent¶
Save this as analyst.nx. It is a complete declaration module and compiles without contacting a model.
agent Analyst {
prompt: "Work from evidence. State assumptions explicitly."
timeout: 120
max_tool_calls: 4
}
uv run nexa build analyst.nx
uv run nexa inspect analyst.nx --format json
Before execution, complete First provider setup: create secrets.nxs with an endpoint and model ID, and supply a key through the environment or hidden input. See Provider protocols for protocol choices. The next command uses the configured environment to make a model request and checkpoint the run in .nexa/runs.sqlite3.
uv run nexa agent analyst.nx Analyst "Explain the supplied evidence" --timeout 120
A successful run returns status: completed. Tools requiring approval return waiting_approval; follow Approval and resume. Diagnose other stops with Execution and budgets.
4. Continue building¶
- Read Language basics and Tools and Protocols.
- Save and recover tasks with checkpoints.
- Use the toolchain to work with Nexa Code or VS Code.
- Check the 2.4 migration checklist when upgrading.
Source and validation · compilation / execution
A complete Agent flow¶
This full compatibility example compiles locally; executing it requires a configured model.
agent Analyst {
prompt: "Work from evidence."
timeout: 120
}
flow main {
result = Analyst.run("Explain.");
verify result satisfies string;
}