> ## 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.

# Basic Slack Agent

> Minimal Slack bot with SQLite session persistence and @mention replies

## Code

```python basic.py theme={null}
from agno.agent import Agent
from agno.db.sqlite.sqlite import SqliteDb
from agno.models.openai import OpenAIChat
from agno.os.app import AgentOS
from agno.os.interfaces.slack import Slack

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

basic_agent = Agent(
    name="Basic Agent",
    model=OpenAIChat(id="gpt-4o"),
    db=agent_db,
    add_history_to_context=True,
    num_history_runs=3,
    add_datetime_to_context=True,
)

# Setup our AgentOS app
agent_os = AgentOS(
    agents=[basic_agent],
    interfaces=[
        Slack(
            agent=basic_agent,
            reply_to_mentions_only=True,  # The Agent will react only to messages mentioning it
        )
    ],
)
app = agent_os.get_app()


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

## Usage

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

  <Step title="Set Environment Variables">
    ```bash theme={null}
    export SLACK_TOKEN=***
    export SLACK_SIGNING_SECRET=***
    export OPENAI_API_KEY=***
    ```
  </Step>

  <Step title="Install Dependencies">
    ```bash theme={null}
    uv pip install 'agno[slack]'
    ```
  </Step>

  <Step title="Run Example">
    ```bash theme={null}
    python basic.py
    ```
  </Step>
</Steps>

## Key Features

* **Mention-Only Replies**: Responds only to @mentions in channels
* **Session Persistence**: SQLite database stores conversation history across restarts
* **Conversation History**: Last 3 interactions included in context
