Skip to main content

Introduction

AXON is a domain-specific language designed for AI agent orchestration. Unlike traditional programming languages, AXON uses cognitive primitives rather than mechanical constructs—there are no loops, variables, or assignments. Instead, you define personas, contexts, flows, and semantic constraints.

File Structure

An AXON program consists of top-level declarations:

Comments

AXON supports single-line comments using //:

Identifiers

Identifiers follow standard programming conventions:
  • Start with a letter or underscore
  • Contain letters, numbers, and underscores
  • Case-sensitive
  • Examples: MyPersona, legal_expert, _privateFlow

Literals

String Literals

Strings are enclosed in double quotes:

Numeric Literals

Boolean Literals

Duration Literals

Durations use numeric values with suffixes:
Valid suffixes: ms, s, m, h, d

Collections

Lists

Lists are enclosed in square brackets:

Structured Types

Structured types use curly braces:

Operators and Symbols

Delimiters

  • { } — Block delimiters for definitions
  • ( ) — Parameter and argument lists
  • [ ] — List literals and collections

Punctuation

  • : — Field assignment separator
  • , — List and parameter separator
  • . — Dotted references (e.g., Extract.output)
  • ? — Optional type marker (e.g., Opinion?)

Special Operators

  • -> — Function return type or conditional action
  • .. — Range operator (e.g., 0.0..1.0)
  • <> — Generic type parameters (e.g., List<Party>)

Comparison Operators

Used in validation rules and conditionals:

Declaration Keywords

These keywords introduce top-level declarations:

Flow Control Keywords

These keywords are used within flow definitions:

Field Keywords

Common fields used in blocks:

Run Modifiers

Modifiers for run statements:

Type Annotations

Basic Types

Generic Types

Optional Types

Range-Constrained Types

Refined Types

Dotted References

Reference outputs from previous steps:

Expression Patterns

Single References

Multiple Inputs

Bracketed Lists

Common Patterns

Define and Execute

Multi-Step Processing

Conditional Logic

Style Conventions

Naming Conventions

  • Types and Personas: PascalCase (LegalExpert, RiskScore)
  • Flows and Steps: PascalCase (AnalyzeContract, Extract)
  • Fields and parameters: snake_case (confidence_threshold, max_tokens)
  • Identifiers in lists: lowercase when representing concepts (offensive, harmful)

Formatting

Next Steps

  • Persona — Define AI agent identities
  • Context — Configure execution environments
  • Flow — Build cognitive pipelines
  • Types — Understand AXON’s type system