Equip agents with chain-of-thought reasoning capabilities.
Example showing how to configure a basic Reasoning Agent, using the reasoning=True flag.
1
Add the following code to your Python file
basic_cot.py
Copy
Ask AI
from agno.agent import Agentfrom agno.models.openai import OpenAIResponsestask = ( "Analyze the key factors that led to the signing of the Treaty of Versailles in 1919. " "Discuss the political, economic, and social impacts of the treaty on Germany and how it " "contributed to the onset of World War II. Provide a nuanced assessment that includes " "multiple historical perspectives.")reasoning_agent = Agent( model=OpenAIResponses(id="gpt-5.2"), reasoning=True, # The Agent will be able to reason. markdown=True,)reasoning_agent.print_response(task, stream=True, show_full_reasoning=True)