Skip to main content
Reasoning capabilities extend thinking with mandatory analysis after each tool execution. This “Act-then-Analyze” pattern enables the agent to evaluate results and adapt its strategy dynamically, making it ideal for complex scenarios requiring iterative refinement.

Thinking vs. Reasoning

FeatureThinkingReasoning
PlanningCreates execution planCreates execution plan
ExecutionRuns tools sequentiallyRuns tools sequentially
AnalysisFinal synthesis onlyAnalyzes after EACH tool
AdaptationFollows original planCan revise plan mid-execution
Best ForStraightforward multi-tool tasksComplex analysis requiring evaluation

Enabling Reasoning

Reasoning requires both thinking and reasoning tools to be enabled:
Warning: enable_reasoning_tool requires enable_thinking_tool to be True. Setting reasoning without thinking will raise a ValueError.

How Reasoning Works

Reasoning follows an advanced “Act-then-Analyze” pattern:
  1. Strategic Planning: Create initial execution plan
  2. Execute One Step: Run the next tool in the plan
  3. Mandatory Analysis: Evaluate the result and decide next action
  4. Dynamic Adaptation: Continue, revise plan, or finalize answer
  5. Final Synthesis: Comprehensive conclusion with all insights

Reasoning Configuration

Agent-Level Reasoning

Task-Level Reasoning

Mixed Configuration

When to Use Reasoning

Reasoning is ideal for:
  • Iterative Analysis: When each step’s result affects the next
  • Strategic Decisions: Complex scenarios requiring evaluation at each step
  • Adaptive Workflows: When the plan may need mid-course corrections
  • Quality-Critical Tasks: Where analyzing intermediate results improves accuracy

Example: Investment Research with Analysis

Example: Multi-Source Research

Reasoning Output Structure

When reasoning is enabled, the agent provides:
  1. Initial Strategy: High-level approach to the problem
  2. Step-by-Step Analysis: Evaluation after each tool execution
  3. Adaptation Decisions: Whether to continue, revise, or conclude
  4. Evidence Chain: How each tool’s output influenced the conclusion
  5. Final Recommendation: Synthesized answer with full reasoning

Performance Considerations

Warning: Reasoning consumes significantly more tokens than thinking alone due to the mandatory analysis after each tool call. Use reasoning when the analytical depth justifies the cost.

Best Practices

  1. Use for Complex Scenarios: Enable reasoning when intermediate analysis adds value
  2. Requires Thinking: Always enable enable_thinking_tool when using reasoning
  3. Multiple Tools: Reasoning shines with 3+ tools where results interact
  4. Clear Instructions: Tell the agent to “evaluate at each step” or “adjust based on findings”
  5. Monitor Costs: Reasoning uses more tokens than thinking alone
  6. Debug First: Use debug=True to understand the reasoning chain
Reasoning provides the most sophisticated analytical capabilities for complex scenarios, making it essential for applications that require deep analysis and adaptive decision-making based on intermediate results.