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: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:| Keyword | Purpose |
|---|---|
persona | Define an AI agent identity |
context | Define execution environment |
anchor | Define hard constraints |
memory | Define semantic memory store |
tool | Define external capability |
type | Define semantic type |
flow | Define cognitive pipeline |
intent | Define atomic semantic instruction |
run | Execute a flow |
import | Import declarations from modules |
Flow Control Keywords
These keywords are used within flow definitions:| Keyword | Purpose |
|---|---|
step | Named cognitive step |
probe | Targeted extraction |
reason | Chain-of-thought reasoning |
validate | Validation checkpoint |
refine | Adaptive retry logic |
weave | Semantic synthesis |
use | Invoke external tool |
remember | Store to memory |
recall | Retrieve from memory |
if / else | Conditional branching |
Field Keywords
Common fields used in blocks:| Keyword | Usage |
|---|---|
given | Input specification |
ask | Instruction or question |
output | Output type specification |
for | Target specification (probe) |
into | Destination (weave) |
against | Schema reference (validate) |
about | Topic specification (reason) |
from | Source specification (recall) |
where | Constraint predicate |
Run Modifiers
Modifiers forrun 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)
