Skip to main content
"""
Ollama Reasoning Agent
======================

Cookbook example for `ollama/chat/reasoning_agent.py`.
"""

from agno.agent import Agent
from agno.models.ollama import Ollama

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------

reasoning_agent = Agent(
    model=Ollama(id="gpt-oss:120b"),
    reasoning=True,
    debug_mode=True,
)

reasoning_agent.print_response(
    "How many r are in the word 'strawberry'?", show_reasoning=True
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    pass

Run the Example

# Clone and setup repo
git clone https://github.com/agno-agi/agno.git
cd agno/cookbook/90_models/ollama/chat

# Create and activate virtual environment
./scripts/demo_setup.sh
source .venvs/demo/bin/activate

python reasoning_agent.py