Skip to main content
This reference covers the core data structures and events used across all reasoning approaches in Agno (Reasoning Models, Reasoning Tools, and Reasoning Agents).

ReasoningStep

The ReasoningStep class represents a single step in the reasoning process, whether generated by Reasoning Tools, Reasoning Agents, or native reasoning models.

Attributes

AttributeTypeDefaultDescription
titleOptional[str]NoneA concise title for this reasoning step
reasoningOptional[str]NoneThe detailed thought process or reasoning for this step
actionOptional[str]NoneThe action to be taken based on this reasoning
resultOptional[str]NoneThe outcome or result of executing the action
next_actionNextActionNextAction.CONTINUEWhat to do next (continue, validate, final_answer, reset)
confidencefloat0.8Confidence level for this step (0.0 to 1.0)
metadataOptional[Dict[str, Any]]NoneAdditional metadata for this step

NextAction Enum

The NextAction enum defines possible next steps in the reasoning process:
ValueDescription
CONTINUEContinue with more reasoning steps
VALIDATEValidate the current solution before finalizing
FINAL_ANSWERReady to provide the final answer
RESETReset and restart the reasoning process (error detected)

ReasoningSteps

The ReasoningSteps class is a container for multiple reasoning steps, used as the structured output for Reasoning Agents.

Attributes

AttributeTypeDefaultDescription
reasoning_stepsList[ReasoningStep][]List of reasoning steps taken
metadataOptional[Dict[str, Any]]NoneAdditional metadata about the reasoning process

ReasoningTools

The ReasoningTools toolkit provides explicit tools for structured thinking.

Constructor Parameters

ParameterTypeDefaultDescription
enable_thinkboolTrueEnable the think() tool
enable_analyzeboolTrueEnable the analyze() tool
allboolFalseLegacy parameter to enable both tools
instructionsOptional[str]NoneCustom instructions for using the tools
add_instructionsboolFalseAdd default instructions to agent
add_few_shotboolFalseAdd few-shot examples to instructions
few_shot_examplesOptional[str]NoneCustom few-shot examples

Methods

think()

Use as a scratchpad to reason about problems step-by-step. Parameters:
ParameterTypeDefaultDescription
session_stateDict[str, Any]RequiredAgent’s session state (automatically provided)
titlestrRequiredConcise title for this thinking step
thoughtstrRequiredDetailed reasoning for this step
actionOptional[str]NoneWhat you’ll do based on this thought
confidencefloat0.8Confidence level (0.0 to 1.0)
Returns: str - Formatted list of all reasoning steps taken so far

analyze()

Analyze results from previous actions and determine next steps. Parameters:
ParameterTypeDefaultDescription
session_stateDict[str, Any]RequiredAgent’s session state (automatically provided)
titlestrRequiredConcise title for this analysis
resultstrRequiredOutcome of the previous action
analysisstrRequiredYour evaluation of the results
next_actionstr"continue"What to do next: “continue”, “validate”, or “final_answer”
confidencefloat0.8Confidence level (0.0 to 1.0)
Returns: str - Formatted list of all reasoning steps taken so far

Reasoning Events

Events emitted during reasoning processes when using Reasoning Agents or Reasoning Models.

Event Types

Event TypeDescription
ReasoningStartedIndicates the start of the reasoning process
ReasoningStepContains a single reasoning step
ReasoningCompletedSignals completion of the reasoning process

ReasoningStartedEvent

Emitted when reasoning begins. Attributes:
AttributeTypeDefaultDescription
eventstr"ReasoningStarted"Event type
run_idOptional[str]NoneID of the current run
agent_idOptional[str]NoneID of the reasoning agent
created_atintCurrent timestampUnix timestamp of event creation

ReasoningStepEvent

Emitted for each reasoning step during the process. Attributes:
AttributeTypeDefaultDescription
eventstr"ReasoningStep"Event type
contentOptional[Any]NoneContent of the reasoning step
content_typestr"str"Type of the content
reasoning_contentstr""Detailed reasoning content for this step
run_idOptional[str]NoneID of the current run
agent_idOptional[str]NoneID of the reasoning agent
step_numberOptional[int]NoneThe sequential number of this step
created_atintCurrent timestampUnix timestamp of event creation

ReasoningCompletedEvent

Emitted when reasoning finishes. Attributes:
AttributeTypeDefaultDescription
eventstr"ReasoningCompleted"Event type
contentOptional[Any]NoneFinal reasoning content
content_typestr"str"Type of the content
reasoning_stepsOptional[List[ReasoningStep]]NoneAll reasoning steps taken
reasoning_messagesOptional[List[Message]]NoneMessages from the reasoning process
run_idOptional[str]NoneID of the current run
agent_idOptional[str]NoneID of the reasoning agent
created_atintCurrent timestampUnix timestamp of event creation

Agent Configuration for Reasoning

Reasoning Agent Parameters

Parameters for configuring Reasoning Agents (reasoning=True):
ParameterTypeDefaultDescription
reasoningboolFalseEnable reasoning agent mode
reasoning_modelOptional[Model]NoneSeparate model for reasoning (if different from main model)
reasoning_agentOptional[Agent]NoneCustom reasoning agent instance
reasoning_min_stepsint1Minimum number of reasoning steps
reasoning_max_stepsint10Maximum number of reasoning steps

Display Parameters

Parameters for showing reasoning during execution:
ParameterTypeDefaultDescription
show_full_reasoningboolFalseDisplay complete reasoning process in output
stream_intermediate_stepsboolFalseStream each reasoning step in real-time

See Also