Skip to content

AAL Introduction

Start with an agent you can run.

AAL (Agent Abstraction Language) lets you define what an agent accepts, what it does and what it returns. Start with a small greeting program: give it a name and receive a greeting. No model or API key is needed.

Prepare the compiler

Install Rust 1.85 or newer and run these commands. Run subsequent lessons from the same repository directory. Model and tool adapters may require newer Rust versions; see the repository README.

Terminal
git clone https://github.com/Brain-Cell-Coding/Agent-Assembly-Language.git
cd Agent-Assembly-Language
cargo run --locked --bin aalc -- --help

Complete example

Save the example as introduction.aal

introduction.aal
agent Tutorial is Agent
  public
    ability run(name: String) -> String effects()
      return "Hello, {name}!"
Download .aal

Syntax explained

  1. agent declares an agent; an ability under public is a callable entry point.

  2. name: String types the parameter; -> String types the result; return supplies it.

  3. effects() declares no external effects. Run this example locally in the AAL repository without an EasyNet Runtime.

Build and run

Terminal
cargo run --locked --bin aalc -- check introduction.aal

cargo run --locked --bin aalc -- build introduction.aal -o introduction.aalc

cargo run --locked --bin aalc -- run introduction.aalc \
  --agent Tutorial --ability run \
  --args '{"name":"EasyNet"}' \
  --state-dir .aal-tutorial/introduction --invocation introduction-1

Run with a fresh state directory. The returned value is shown below; the CLI also prints execution information.

Expected result
"Hello, EasyNet!"

Try it yourself

Replace name with your own name and run with a new invocation ID. The greeting should use your input.

Language source and specification