What is AXON?
AXON is a compiled language that targets LLMs instead of CPUs. It has a formal EBNF grammar, a lexer, parser, AST, intermediate representation, multiple compiler backends (Anthropic, OpenAI, Gemini, Ollama), and a runtime with semantic type checking, retry engines, and execution tracing. It is not a Python library, a LangChain wrapper, or a YAML DSL.AXON is currently in alpha status (v0.4.0) with 731 passing tests. The language is under active development.
A Real Example
Here’s a complete AXON program that analyzes legal contracts:Architecture Overview
AXON follows a traditional compiler architecture:12 Cognitive Primitives
AXON’s language constructs map directly to how AI models think:persona
Cognitive identity of the model
context
Working memory / session config
intent
Atomic semantic instruction
flow
Composable pipeline of cognitive steps
reason
Explicit chain-of-thought
anchor
Hard constraint (never violable)
validate
Semantic validation gate
refine
Adaptive retry with failure context
memory
Persistent semantic storage
tool
External invocable capability
probe
Directed information extraction
weave
Semantic synthesis of multiple outputs
Epistemic Type System
AXON implements an epistemic type system based on a partial order lattice, representing formal subsumption relationships:CitedFact can naturally satisfy a FactualClaim dependency, but an Opinion never can.
How AXON Compares
| LangChain | DSPy | Guidance | AXON | |
|---|---|---|---|---|
| Own language + grammar | ❌ | ❌ | ❌ | ✅ |
| Semantic type system | ❌ | Partial | ❌ | ✅ |
| Formal anchors | ❌ | ❌ | ❌ | ✅ |
| Persona as type | ❌ | ❌ | ❌ | ✅ |
| Reasoning as primitive | ❌ | Partial | ❌ | ✅ |
| Native multi-model | Partial | Partial | ❌ | ✅ |
Design Principles
AXON is built on five core principles:- Declarative over imperative — describe what, not how
- Semantic over syntactic — types carry meaning, not layout
- Composable cognition — blocks compose like neurons
- Configurable determinism — spectrum from exploration to precision
- Failure as first-class citizen — retry, refine, fallback are native
Runtime Self-Healing
AXON features a native self-healing mechanism for semantic gates. When the LLM output violates a hard constraint (AnchorBreachError) or fails structural semantic validation (ValidationError), the AXON RetryEngine automatically intercepts the failure.
Instead of crashing, the engine re-injects the exact failure_context back into the LLM’s next prompt. This creates a closed feedback loop where the model adaptively corrects its logic and structurally self-heals in real-time.
Next Steps
Installation
Install AXON and set up your development environment
Quickstart
Build your first AXON program in minutes
