Skip to Content
Agentlang is open source now!
Installation

Install Agentlang

To run Agentlang locally, you need to install the Agentlang CLI  tool.

npm install -g agentlangcli

Or install locally:

npm install agentlangcli

You may also use pnpm if you prefer:

pnpm install -g agentlangcli

hello, world

Now we shall proceed to create a very simple Agentlang app. To create the app, please type the following command:

agent init hello

This will create a directory called hello with the basic files required by an Agentlang project. Our first Agentlang app is going to be very simple - it returns the message “hello, world”. It’s overkill to use a powerful language like Agentlang to write a hello-world app, but that’s good enough to test our installation and to familiarize ourselves with the basic developer workflow.

An Agentlang app is made-up of modules. The hello app also has one module called hello.core in the file src/core.al. Open this file in your favorite text editor and update it to look like,

src/core.al
module hello.core record Message { content String } @public workflow sayHello { { Message { content "hello, world" } } }

You can now run the model as,

agent run

Use the following HTTP POST request to test the application:

curl --location --request POST 'http://localhost:8080/hello.core/sayHello' \ --header 'Content-Type: application/json' \ --data-raw '{}'

You should see the following response:

{"Message": {"content":"hello, world"}}

With Agentlang setup and working properly, you can now explore the language further by proceeding to the quick start guide on Agents.

Last updated on