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

# Telegram Reasoning Agent

> Telegram bot powered by Claude with chain-of-thought reasoning and web search.

Telegram bot powered by Claude with chain-of-thought reasoning and web search. Uses ReasoningTools for structured thinking and DuckDuckGo for live information retrieval.

```python reasoning_agent.py theme={null}
"""
Telegram Reasoning Agent
========================

Telegram bot powered by Claude with chain-of-thought reasoning and web
search. Uses ReasoningTools for structured thinking and DuckDuckGo for
live information retrieval.

Key concepts:
  - ``ReasoningTools`` gives the agent explicit think/reason tool calls.
  - ``DuckDuckGoTools`` provides web search for up-to-date information.
  - SQLite session persistence keeps conversation history across restarts.

Setup: Set TELEGRAM_TOKEN env var from @BotFather.
"""

from agno.agent import Agent
from agno.db.sqlite import SqliteDb
from agno.models.openai import OpenAIChat
from agno.os.app import AgentOS
from agno.os.interfaces.telegram import Telegram
from agno.tools.duckduckgo import DuckDuckGoTools
from agno.tools.reasoning import ReasoningTools

# ---------------------------------------------------------------------------
# Create Example
# ---------------------------------------------------------------------------

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

reasoning_agent = Agent(
    name="Reasoning Research Agent",
    model=OpenAIChat(id="gpt-5.2"),
    db=agent_db,
    tools=[
        ReasoningTools(add_instructions=True),
        DuckDuckGoTools(),
    ],
    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_agent],
    interfaces=[Telegram(agent=reasoning_agent)],
)
app = agent_os.get_app()

# ---------------------------------------------------------------------------
# Run Example
# ---------------------------------------------------------------------------

if __name__ == "__main__":
    """Run your AgentOS.

    You can see the configuration and available apps at:
    http://localhost:7777/config

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

## Run the Example

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

  <Step title="Install dependencies">
    ```bash theme={null}
    uv pip install -U "agno[os]" ddgs fastmcp openai starlette
    ```
  </Step>

  <Step title="Export your API keys">
    <CodeGroup>
      ```bash Mac/Linux theme={null}
      export JWT_VERIFICATION_KEY="your_jwt_verification_key_here"
      export OPENAI_API_KEY="your_openai_api_key_here"
      ```

      ```bash Windows theme={null}
      $Env:JWT_VERIFICATION_KEY="your_jwt_verification_key_here"
      $Env:OPENAI_API_KEY="your_openai_api_key_here"
      ```
    </CodeGroup>
  </Step>

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

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

Full source: [cookbook/05\_agent\_os/interfaces/telegram/reasoning\_agent.py](https://github.com/agno-agi/agno/blob/main/cookbook/05_agent_os/interfaces/telegram/reasoning_agent.py)
