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

# Reasoning Agent

> Pair a Groq reasoning model with a Groq response model to answer step by step.

## Code

```python reasoning_agent.py theme={null}
from agno.agent import Agent
from agno.models.groq import Groq

# Create a reasoning agent that uses:
# - `deepseek-r1-distill-llama-70b` as the reasoning model
# - `llama-3.3-70b-versatile` to generate the final response
reasoning_agent = Agent(
    model=Groq(id="llama-3.3-70b-versatile"),
    reasoning_model=Groq(
        id="deepseek-r1-distill-llama-70b", temperature=0.6, max_tokens=1024, top_p=0.95
    ),
)

# Prompt the agent to solve the problem
reasoning_agent.print_response("Is 9.11 bigger or 9.9?", stream=True)
```

## Usage

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

**1. Set your API key**

```bash theme={null}
export GROQ_API_KEY=xxx
```

**2. Install dependencies**

```bash theme={null}
uv pip install -U groq agno
```

**3. Run Agent**

Save the code above as `reasoning_agent.py`, then run:

```bash theme={null}
python reasoning_agent.py
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.