Overview
Each primitive maps to a specific cognitive capability or constraint that LLMs naturally possess. By making these explicit in the language, AXON enables you to compose complex AI behaviors declaratively.Identity & Context
persona, context, memoryReasoning & Control
reason, flow, intentConstraints & Validation
anchor, validate, refineTools & Synthesis
tool, probe, weaveThe 12 Primitives
1. Persona — Cognitive Identity
Defines the identity and capabilities of the AI model. A persona specifies domain expertise, tone, confidence thresholds, and behavioral constraints.2. Context — Working Memory
Establishes the session configuration and working memory parameters for execution. Controls temperature, token limits, language, and computational depth.contract_analyzer.axon
memory:session,persistent,ephemeraltemperature: Controls randomness (0.0 = deterministic, 1.0 = creative)depth:shallow,normal,exhaustivemax_tokens: Output length budget
3. Intent — Atomic Semantic Instruction
Represents a single, focused semantic operation. Intents are the smallest unit of cognitive work — they ask the model to perform one specific task.Example: Extract entities
4. Flow — Composable Cognitive Pipeline
Orchestrates multi-step reasoning by composing cognitive operations into a directed acyclic graph (DAG). Each step can reference outputs from previous steps.contract_analyzer.axon
Data Dependencies: Steps automatically form a dependency graph.
Assess won’t execute until Extract completes. The AXON runtime handles orchestration.5. Reason — Explicit Chain-of-Thought
Forces the model to show its reasoning before producing an answer. Enables explicit chain-of-thought or tree-of-thought reasoning.Example: Logical reasoning
chain_of_thought: Linear step-by-step reasoningtree_of_thought: Branching exploration (experimental)depth: Controls reasoning steps (1-5)
6. Anchor — Hard Constraint (Never Violable)
Defines inviolable rules that must never be broken. Anchors are checked at runtime, and violations raiseAnchorBreachError.
contract_analyzer.axon
- Preventing hallucinations (
NoHallucination) - Enforcing logical structure (
SyllogismChecker) - Blocking speculation (
AgnosticFallback) - Requiring citations (
RequiresCitation)
7. Validate — Semantic Validation Gate
Type-checks the semantic meaning of outputs, not just their structure. Ensures outputs match their declared epistemic type.Example: Validate against schema
ValidationError (Level 1) and can trigger automatic refinement.
8. Refine — Adaptive Retry with Failure Context
Enables self-healing by automatically retrying failed operations with injected failure context. The model learns from its mistakes.Example: Retry with backoff
Self-Healing Mechanism: When a step fails validation or breaches an anchor,
refine re-invokes the model with the exact failure reason injected into the prompt. This creates a closed feedback loop.9. Memory — Persistent Semantic Storage
Provides long-term storage for semantic values across sessions. Unlike context (working memory), memory persists beyond execution.Example: User preferences
in_memory: Fast, ephemeralvector: Semantic search (embeddings)kv: Key-value store
10. Tool — External Invocable Capability
Bridges the model to external capabilities like web search, code execution, file I/O, or API calls.contract_analyzer.axon
WebSearch— Internet search (Serper.dev)FileReader— Local filesystem accessCodeExecutor— Run code sandboxedCalculator— Math operationsDateTime— Time/date utilities
11. Probe — Directed Information Extraction
Performs targeted extraction of specific information from unstructured data.Example: Extract obligations
12. Weave — Semantic Synthesis
Combines multiple outputs into a coherent whole. Unlike simple concatenation, weaving performs semantic integration.Example: Synthesize report
Composability
Primitives are designed to compose naturally:Full pipeline example
run statement combines:
- Persona (who)
- Context (how)
- Flow (what)
- Anchor (constraints)
- Refine (recovery)
Design Philosophy
Declarative over Imperative
Declarative over Imperative
Primitives describe what you want, not how to do it. The AXON runtime handles orchestration.
Semantic over Syntactic
Semantic over Syntactic
Primitives operate on meaning, not bytes. Types represent epistemic states, not memory layouts.
Composable Cognition
Composable Cognition
Primitives snap together like neural networks — small units compose into complex behaviors.
Failure as First-Class
Failure as First-Class
refine, validate, and anchor make failure handling explicit and automatic.Next Steps
Type System
Learn about AXON’s epistemic types
Compilation Pipeline
See how primitives compile to prompts
Error Handling
Understand the 6-level error hierarchy
Examples
See primitives in action
