Skip to main content

Overview

A flow is AXON’s equivalent of a function—a composable cognitive pipeline that takes typed inputs and produces typed outputs. Unlike traditional functions, flows contain cognitive primitives like reasoning, probing, and validation rather than loops and assignments.

Syntax

Basic Structure

Simple Flow

Multi-Step Flow

Parameters

Flows can accept typed parameters:

Return Types

Flows declare their return type after ->:
Return type can be omitted if the flow doesn’t return a value:

Step

Steps are named cognitive operations within a flow.

Basic Step

Step Fields

Referencing Step Outputs

Reference previous step outputs using dot notation:

Multiple Inputs

Probe

Probe performs targeted extraction of specific fields from data.

Syntax

Examples

Use Cases

  • Extract structured fields from documents
  • Pull specific entities from text
  • Parse formatted data into fields

Reason

Reason performs explicit chain-of-thought reasoning.

Syntax

Examples

Fields

Depth Guidelines

  • 1-2: Simple, direct reasoning
  • 3-4: Moderate complexity, multiple factors
  • 5-7: Complex, multi-step reasoning
  • 8-10: Deep, exhaustive analysis

Validate

Validate creates semantic validation checkpoints with conditional actions.

Syntax

Examples

Validation Actions

Conditions

Conditions can use comparison operators:

Refine

Refine implements adaptive retry logic with failure context.

Syntax

Examples

Fields

Weave

Weave synthesizes multiple outputs into a coherent result.

Syntax

Examples

Requirements

  • Minimum 2 sources required
  • Sources must be valid step outputs or identifiers
  • Target is the output identifier

Use Tool

Use invokes external tool capabilities.

Syntax

Examples

Memory Operations

Remember

Store data to semantic memory:

Recall

Retrieve data from semantic memory:

Conditionals

Conditional branching in flows:

Syntax

Examples

Complete Example

Here’s a comprehensive flow using multiple features:

Run Statements

Execute flows using run statements:

Basic Execution

With Modifiers

Run Modifiers

Effort Levels

  • low: Minimal resources, fast execution
  • medium: Balanced (default)
  • high: More thorough, slower
  • max: Maximum resources, exhaustive

Failure Strategies

Best Practices

1. Name Steps Descriptively

2. Use Appropriate Reasoning Depth

3. Validate Critical Outputs

4. Chain Steps Logically

5. Use Weave for Multiple Sources

  • Types — Type system and type definitions
  • Anchor — Hard constraints and validation
  • Persona — Agent identities
  • Context — Execution environments
  • Tools — External capabilities