Skip to Content
Agentlang is open source now!
Introduction

Welcome to Agentlang

Agentlang is a declarative programming abstraction designed for building reliable and autonomous agents. Traditional agent development often relies solely on natural language instructions to describe behavior—an approach that, while expressive and intuitive, introduces ambiguity that compromises reliability. Agentlang resolves this challenge by allowing developers to enrich those natural language instructions with high-level declarative models of the underlying business domain. Through a set of simple yet powerful constructs, it bridges the gap between unstructured reasoning and structured logic. This hybrid paradigm, known as Agentic Reliability Modeling, integrates the accessibility of natural language with the rigor of formal specification, producing agents that are more consistent, predictable, and robust in real-world contexts.

Agentic Reliability Modeling

AgentLang offers a robust set of tools for not just developing agents, but also for modeling the various aspects of your agents’ behavior - unambiguously, but still effortlessly - to make them reliable and autonomous.

Key concepts:

First-class AI Agents
Flows
Decisions
Directives
Scenarios
Glossary
Structured output and scratchpad
Input Template
Agentic Reliability Modeling

Agentlang for App Development

As a high-level declarative programming language, Agentlang is the ideal choice for modeling intelligent, event-driven systems composed of agents, entities, workflows, and knowledge structures. It provides a unified way to describe data models, reactive logic, and reasoning behavior in a single coherent syntax.

At its core, Agentlang combines three paradigms:

  1. Declarative data modeling — for defining persistent and transient domain structures through entity and record definitions.
  2. Reactive workflows — for describing business and system logic that reacts to events, performs data operations, and triggers external effects.
  3. Agent orchestration — for defining autonomous or human-aligned agents that reason, communicate, and act based on workflows, scenarios, and contextual knowledge.

An Agentlang program (or module) is typically structured as a collection of definitions:

  • entity: Represents persistent data stored in the system.
  • record: Defines lightweight, transient data structures such as messages or request payloads.
  • relationship: Declares typed connections between entities — such as “contains” or “between” relationships.
  • event: Defines signals that trigger workflows or state transitions.
  • workflow: Describes reactive logic in an imperative style, supporting pattern matching, CRUD operations, and integrations with external JavaScript modules.
  • agent: Declares autonomous or interactive agents with specific roles, reasoning prompts, tools, and behavior scenarios.
  • flow: Defines directed graphs that orchestrate how agents and workflows interact within a process.
  • decision: Encapsulates rule-based or case-based logic for deterministic outcomes.
  • directive, scenario, glossary: Provide per-agent or per-domain guidance, examples, and terminology for reasoning consistency.

Agentlang is designed to be human-readable, machine-executable, and AI-integrable. Its syntax allows domain experts to express system logic at a semantic level — while its runtime or compiler translates these definitions into operational systems capable of persistence, messaging, and intelligent interaction.

Design Philosophy

Agentlang’s design is guided by the following principles:

  • Declarative over imperative — express what the system should do, not how it should do it.
  • Events as first-class citizens — all state changes and interactions are modeled through explicit events.
  • Composability — entities, workflows, and agents can be composed and reused across modules.
  • AI-native — the language integrates natively with large language models (LLMs) and external JavaScript tools, making it suitable for hybrid AI applications.
  • Clarity and safety — strong schema semantics, explicit annotations, and type-safe references help prevent runtime errors.

Example

Below is a minimal Agentlang module that demonstrates entities, events, and workflows:

module acme.erp entity Employee { email Email @id, name String, salary Decimal } event giveIncrementToEmployee { employeeEmail Email, increment Decimal } workflow giveIncrementToEmployee { {Employee {email? giveIncrementToEmployee.employeeEmail, salary = salary + salary * giveIncrementToEmployee.increment}} }

This program declares:

  • an Employee entity,
  • an event that carries a salary-increment instruction,
  • and a workflow that updates the employee’s salary reactively when the event occurs.

Beyond Data and Logic

Agentlang extends beyond traditional dataflow or ORM languages — it supports agents capable of autonomous reasoning:

agent employeeIncrement { role "Decide increments", instruction "Based on {{totalSales}} for {{employeeEmail}}, decide increment", tools [acme.core/giveIncrementToEmployee] }

Here, an employeeIncrement agent uses contextual data to determine salary increments and triggers the workflow as an action.

Agentlang brings together data models, event systems, and intelligent agents. It aims to unify the modeling of knowledge, logic, and behavior — enabling developers, analysts, and AI systems to collaborate within a shared formal language.

Agentlang is a bridge between Code and Low-code/No-code

Agentlang has an expressive JSON-like data-oriented syntax. This unique characteristic of Agentlang makes it possible for developers to concurrently use multiple ways of building, as in,

  • Traditional coding: The complete life-cycle of an Agentlang project (design, coding, debugging and deployment) can be managed using your favorite text editor and the Agentlang command-line tool. Agentlang models are expressed in a simple and intuitive data-oriented syntax, enabling easy integration with existing plain-text processing tools.

  • No-code building (visual programming): Fractl Design Studio, our no-code builder, allows Agentlang applications to be designed visually. Code blocks in Agentlang can be directly represented as visual elements in Design Studio, without any translation, and vice versa. It also provide an accessible browser-based interface for all aspects of project management. Design Studio is tightly integrated with the fractl.io  platform which automates all aspects of deploying and managing planet-scale SaaS applications.

  • Generative AI: The very-high-level, declarative nature of Agentlang is a phenomenal fit for LLM-driven code generation. The Gen-AI built-into Design Studio can generate ready-to-deploy applications from pure-text descriptions of the business problem.

Agentlang applications run on Node.js  as well as in the web-browser. This means an Agentlang app can leverage on the large universe of JavaScript libraries.

As the next step, please proceed to install Agentlang on your machine and play with simple programs.

Last updated on