> ## Documentation Index
> Fetch the complete documentation index at: https://phidatainc.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Mistral Reasoning COT

> Run mistral-large-latest with reasoning=True and use_json_mode=True, streaming the full chain-of-thought for a Fibonacci script walkthrough.

Demonstrates built-in chain-of-thought reasoning with Mistral.

```python mistral_reasoning_cot.py theme={null}
"""
Mistral Reasoning COT
=====================

Demonstrates built-in chain-of-thought reasoning with Mistral.
"""

from agno.agent import Agent
from agno.models.mistral import MistralChat

# ---------------------------------------------------------------------------
# Create Agent
# ---------------------------------------------------------------------------
reasoning_agent = Agent(
    model=MistralChat(id="mistral-large-latest"),
    reasoning=True,
    markdown=True,
    use_json_mode=True,
)

# ---------------------------------------------------------------------------
# Run Agent
# ---------------------------------------------------------------------------
if __name__ == "__main__":
    reasoning_agent.print_response(
        "Give me steps to write a python script for fibonacci series",
        stream=True,
        show_full_reasoning=True,
    )
```

## Run the Example

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U agno mistralai
    ```
  </Step>

  <Step title="Export your Mistral API key">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export MISTRAL_API_KEY="your_mistral_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:MISTRAL_API_KEY="your_mistral_api_key_here"
      ```
    </CodeGroup>
  </Step>

  <Step title="Run the example">
    Save the code above as `mistral_reasoning_cot.py`, then run:

    ```bash theme={null}
    python mistral_reasoning_cot.py
    ```
  </Step>
</Steps>

Full source: [cookbook/10\_reasoning/agents/mistral\_reasoning\_cot.py](https://github.com/agno-agi/agno/blob/main/cookbook/10_reasoning/agents/mistral_reasoning_cot.py)
