Skip to main content
A basic agent receives a message, thinks, and replies. A production agent handles the messy reality of workplace chat: conversations that span days, files dropped mid-thread, long-running tasks that need visibility, and sensitive actions that need approval. Here’s what makes it production-ready:
CapabilityWhat it doesQuick setup
MemoryConversations persist across messagesdb=SqliteDb(...)
FilesRead attachments, send files backSlackTools(enable_upload_file=True)
StreamingShow progress on long tasksOn by default
SearchFind messages and context across workspaceSlackTools(enable_search_workspace=True)
IdentityRecognize users across platformsresolve_user_identity=True
Response controlControl when bot respondsreply_to_mentions_only=True
ApprovalsPause for human approval@tool(requires_confirmation=True)
Context providerQuery and update Slack from any agentSlackContextProvider()

Memory

Slack conversations span hours or days. With a database configured, the agent remembers previous messages in the thread and can reference earlier context without the user restating it.
from agno.agent import Agent
from agno.db.sqlite import SqliteDb

agent = Agent(
    name="Support Bot",
    model=...,
    db=SqliteDb(db_file="sessions.db"),
    add_history_to_context=True,
    num_history_runs=5,
)
Each Slack thread maps to one session. DMs work the same way. All responses are sent as thread replies, keeping channel conversations organized. Conversations persist across server restarts.
Session format: {entity_id}:{thread_ts}. For example, an agent named “Support Bot” produces session IDs like Support Bot:1719000000.000100.

Files

The agent can read files that users attach and generate files in response. The interface extracts attachments from incoming messages and makes them available to the agent. Generated files upload back to the thread.
from agno.tools.slack import SlackTools

agent = Agent(
    tools=[SlackTools(enable_upload_file=True, enable_download_file=True)],
)

Streaming

Responses stream live, so users see text appear as the agent generates it, with task cards showing progress on long-running work.
Slack(agent=agent, streaming=True)  # on by default
Streaming requires Agents & AI Apps mode. Enable it under App Home in your Slack App settings. Without it, users see a spinner until the full response is ready.
The agent can search across your Slack workspace: messages, channels, and threads.
from agno.tools.slack import SlackTools

agent = Agent(
    tools=[SlackTools(enable_search_workspace=True)],
)
The search_workspace tool uses Slack’s semantic search to find relevant messages and context. Useful for catching up on discussions, finding prior decisions, or summarizing activity.
Search requires additional OAuth scopes (search:read.public, search:read.files). Add them under OAuth & Permissions in your Slack App settings. See the Reference for the full list.

Identity

The same user messages from Slack today, WhatsApp tomorrow. With identity resolution, the agent recognizes them as the same person.
Slack(agent=agent, resolve_user_identity=True)
The agent receives user_id as the user’s email instead of their Slack ID. Memory and context carry across platforms.

Response control

By default, the bot only responds when @mentioned in channels. In DMs, it responds to every message.
SettingBehavior
reply_to_mentions_only=True (default)Responds to @mentions in channels, all DMs
reply_to_mentions_only=FalseResponds to every message in joined channels
Setting reply_to_mentions_only=False means the bot responds to every channel message. Use this only for dedicated bot channels.

Troubleshooting

Check: Server running? ngrok active? Request URL matches {your-url}/slack/events?Fix: Verify you’ve subscribed to app_mention and message.im events in your Slack App.
Cause: Wrong signing secret, or request timestamp too old.Fix: SLACK_SIGNING_SECRET must match Basic Information > App Credentials in your Slack App settings. If using ngrok, restart it to clear stale connections. Slack rejects requests older than 5 minutes.
Cause: “Agents & AI Apps” not enabled.Fix: In Slack App settings → App Home → enable Agents & AI Apps.
Cause: reply_to_mentions_only=False makes the bot respond to every message in channels it can see, including @mentions of other users.Fix: Set reply_to_mentions_only=True (the default). Only set it to False for dedicated bot channels.
Cause: The search_workspace tool requires an action_token that only exists when running through the Slack interface. It doesn’t work in standalone scripts or terminal testing.Fix: Test search through the actual Slack bot, not in a standalone script. For terminal testing, use search_messages instead (requires a user token with search:read scope).
Cause: System Python missing root certificates.Fix:
export SSL_CERT_FILE=$(python3 -c "import certifi; print(certifi.where())")

Next steps

Human-in-the-Loop

Pause for approval before sensitive actions

Reference

All parameters and endpoints