Pure state machine for Algorithm-of-Thoughts (AoT) reasoning.
AoT in this implementation is intentionally single-query: one LLM generation pass that demonstrates algorithmic search behavior in-context and extracts a final answer.
Summary
Types
External status used by strategy snapshots
Internal machine status (string) - required by Fsmx
Functions
Returns the default AoT system prompt for a profile/search-style pair.
Extracts an explicit final answer line from model output text.
Rebuilds a machine struct from strategy state map data.
Generates a unique call id for AoT LLM stream requests.
Builds a new AoT machine with configurable strategy options.
Parses free-form AoT response text into the structured AoT result shape.
Converts machine state into strategy-storable map form.
Applies a machine event and returns {updated_machine, directives}.
Types
@type external_status() :: :idle | :exploring | :completed | :error
External status used by strategy snapshots
@type internal_status() :: String.t()
Internal machine status (string) - required by Fsmx
@type profile() :: :short | :standard | :long
@type search_style() :: :dfs | :bfs
@type t() :: %Jido.AI.Reasoning.AlgorithmOfThoughts.Machine{ current_call_id: String.t() | nil, examples: [String.t()], max_tokens: pos_integer(), profile: profile(), prompt: String.t() | nil, require_explicit_answer: boolean(), result: map() | nil, search_style: search_style(), started_at: integer() | nil, status: internal_status(), streaming_text: String.t(), temperature: float(), termination_reason: termination_reason(), usage: usage() }
@type termination_reason() ::
:success | :missing_explicit_answer | :no_solution | :error | nil
@type usage() :: %{ optional(:input_tokens) => non_neg_integer(), optional(:output_tokens) => non_neg_integer(), optional(:total_tokens) => non_neg_integer() }
Functions
@spec default_system_prompt(profile(), search_style(), [String.t()]) :: String.t()
Returns the default AoT system prompt for a profile/search-style pair.
Extracts an explicit final answer line from model output text.
Rebuilds a machine struct from strategy state map data.
@spec generate_call_id() :: String.t()
Generates a unique call id for AoT LLM stream requests.
Builds a new AoT machine with configurable strategy options.
Parses free-form AoT response text into the structured AoT result shape.
Converts machine state into strategy-storable map form.
Applies a machine event and returns {updated_machine, directives}.