# Reasoning Finance Agent (/agent-os/usage/interfaces/slack/reasoning-agent)



Part of the [Slack interface](/agent-os/interfaces/slack/introduction) examples. Follow the [setup guide](/agent-os/interfaces/slack/setup).

<Warning>
  The source example below uses `claude-sonnet-4-20250514`, which [Anthropic retired](https://platform.claude.com/docs/en/about-claude/model-deprecations). Before running it, replace that model ID with `claude-sonnet-4-6` (or another available compatible Claude model).
</Warning>

## Code [#code]

```python title="reasoning_agent.py"
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.anthropic import Claude
from agno.os.app import AgentOS
from agno.os.interfaces.slack import Slack
from agno.tools.reasoning import ReasoningTools
from agno.tools.websearch import WebSearchTools

agent_db = SqliteDb(session_table="agent_sessions", db_file="tmp/persistent_memory.db")

reasoning_finance_agent = Agent(
    name="Reasoning Finance Agent",
    model=Claude(id="claude-sonnet-4-20250514"),
    db=agent_db,
    tools=[
        ReasoningTools(add_instructions=True),
        WebSearchTools(),
    ],
    instructions="Use tables to display data. When you use thinking tools, keep the thinking brief.",
    add_history_to_context=True,
    num_history_runs=3,
    add_datetime_to_context=True,
    markdown=True,
)

# Setup our AgentOS app
agent_os = AgentOS(
    agents=[reasoning_finance_agent],
    interfaces=[Slack(agent=reasoning_finance_agent)],
)
app = agent_os.get_app()


if __name__ == "__main__":
    agent_os.serve(app="reasoning_agent:app", reload=True)
```

## Usage [#usage]

<Steps>
    <Step title="Set up your virtual environment">
      <CodeBlockTabs defaultValue="Mac">
        <CodeBlockTabsList>
          <CodeBlockTabsTrigger value="Mac">
            Mac
          </CodeBlockTabsTrigger>

          <CodeBlockTabsTrigger value="Windows">
            Windows
          </CodeBlockTabsTrigger>
        </CodeBlockTabsList>

        <CodeBlockTab value="Mac">
          ```bash
          uv venv --python 3.12
          source .venv/bin/activate
          ```
        </CodeBlockTab>

        <CodeBlockTab value="Windows">
          ```bash
          uv venv --python 3.12
          .venv\Scripts\activate
          ```
        </CodeBlockTab>
      </CodeBlockTabs>
    </Step>

  <Step title="Set Environment Variables">
    ```bash
    export SLACK_TOKEN=***
    export SLACK_SIGNING_SECRET=***
    export ANTHROPIC_API_KEY=***
    ```
  </Step>

  <Step title="Install Dependencies">
    ```bash
    uv pip install 'agno[os,slack]' anthropic ddgs
    ```
  </Step>

  <Step title="Run Example">
    ```bash
    python reasoning_agent.py
    ```
  </Step>
</Steps>

## Key Features [#key-features]

* **Chain-of-Thought Reasoning**: ReasoningTools enables structured step-by-step analysis
* **Web Search**: Searches the web for current information via WebSearchTools
* **Persistent Sessions**: SQLite database for conversation history across restarts
