What is Reasoning?
Choose native reasoning, explicit planning tools, or a separate reasoning stage for Agents and Teams.
Setup
In an activated virtual environment:
uv pip install -U agno openai
export OPENAI_API_KEY="your_openai_api_key"Reasoning in Agno can come from a model's native reasoning capability, explicit planning tools, or a separate reasoning stage before the main response. Agents and Teams support these patterns. None guarantees that an answer is correct; validate outputs against the requirements of your application.
Why Reasoning Matters
Reasoning can help with problems that require planning, comparing alternatives, calculations, or several tool calls. Give the agent tools or source material when the task needs current facts. Planning tools alone cannot retrieve evidence.
How Reasoning Works
A native reasoning model controls its internal computation. Agno can receive the provider's exposed reasoning content or summaries. Explicit ReasoningTools instead let a tool-capable model write structured think and analyze notes during its normal tool loop. These notes are tool data, not access to all of the model's hidden reasoning.
Three Approaches to Reasoning
1. Reasoning Models
Configure reasoning on the model itself. This example requests medium effort and an exposed summary through OpenAI Responses:
from agno.agent import Agent
from agno.models.openai import OpenAIResponses
agent = Agent(
model=OpenAIResponses(
id="gpt-5.2", reasoning_effort="medium", reasoning_summary="auto"
),
)
agent.print_response(
"Compare 9.11 and 9.9, and explain the decimal comparison.",
stream=True,
show_full_reasoning=True,
)show_full_reasoning=True controls display of available content; it does not enable native reasoning or expose hidden model reasoning. See Reasoning Models.
Reasoning Model + Response Model
Use reasoning_model for a separate native reasoning stage, followed by the main model for the response. The extra stage adds model calls and latency. See Reasoning Agents.
2. Reasoning Tools
Give a model explicit planning and analysis tools:
from agno.agent import Agent
from agno.models.openai import OpenAIChat
from agno.tools.reasoning import ReasoningTools
agent = Agent(
model=OpenAIChat(id="gpt-4.1"),
tools=[ReasoningTools(add_instructions=True)],
)
agent.print_response(
"A project has 40 hours available. Design takes 12, implementation 20, "
"and testing 16. Compare two feasible ways to reduce scope.",
stream=True,
show_full_reasoning=True,
)The model decides whether to call the tools. See Reasoning Tools.
3. Reasoning Agents
Configure a supported native reasoning_model when you want a separate reasoning pass. Agno creates a reasoning agent for that model, or uses your supplied reasoning_agent. It does not inherit the main agent's tools automatically.
from agno.agent import Agent
from agno.models.openai import OpenAIChat, OpenAIResponses
agent = Agent(
model=OpenAIChat(id="gpt-4.1"),
reasoning_model=OpenAIResponses(
id="gpt-5.2", reasoning_effort="medium", reasoning_summary="auto"
),
)
agent.print_response("Prove that the sum of the first n odd numbers is n squared.")The former reasoning=True, reasoning_min_steps, and reasoning_max_steps constructor arguments are no longer supported. Use explicit tools or a native reasoning model. See Reasoning Agents.
Choosing the Right Approach
| Approach | Control | Available output |
|---|---|---|
| Native model | Provider-specific effort and thinking options | Provider-exposed content or summaries |
| Reasoning tools | Instructions and ordinary tool-call limits | Explicit tool notes, when called |
| Separate reasoning stage | Native reasoner and optional custom agent | Reasoning-stage output followed by the main response |