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



## Code [#code]

```python title="reasoning_agent.py"
from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.anthropic.claude import Claude
from agno.os.app import AgentOS
from agno.os.interfaces.whatsapp import Whatsapp
from agno.tools.reasoning import ReasoningTools
from agno.tools.yfinance import YFinanceTools

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

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

agent_os = AgentOS(
    agents=[reasoning_finance_agent],
    interfaces=[Whatsapp(agent=reasoning_finance_agent, show_reasoning=True)],
)
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 WHATSAPP_ACCESS_TOKEN=your_access_token
    export WHATSAPP_PHONE_NUMBER_ID=your_phone_number_id
    export WHATSAPP_VERIFY_TOKEN=your_verify_token
    export WHATSAPP_APP_SECRET=your_app_secret
    export ANTHROPIC_API_KEY=your_anthropic_api_key
    ```

    See the [WhatsApp setup guide](/agent-os/interfaces/whatsapp/setup) for how to get these values from the [Meta Developer Dashboard](https://developers.facebook.com/apps/).
  </Step>

  <Step title="Install dependencies">
    ```bash
    uv pip install -U "agno[os]" anthropic yfinance
    ```
  </Step>

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

## Key Features [#key-features]

* **Advanced Reasoning**: ReasoningTools for step-by-step financial analysis
* **Real-time Data**: Stock prices from Yahoo Finance
* **Claude Powered**: Runs on Claude Sonnet 4.6
* **Table Formatting**: Presents financial data in tables
* **Show Reasoning**: Use `show_reasoning=True` on the Whatsapp interface to see the model's thought process
