Host agents as Slack Applications.
Prerequisites
Create a Slack App
Configure OAuth & Permissions
app_mention
chat:write
chat:write.customize
chat:write.public
im:history
im:read
im:write
Setup Environment Variables
.envrc
file in your project root with the following content, replacing placeholder values with your actual credentials:direnv allow
).Setup Webhook with ngrok
https://
URL provided by ngrokhttps://your-ngrok-url.ngrok.io/slack/events
Configure Event Subscriptions
app_mention
message.im
message.channels
message.groups
Enable App Home
Final Installation
SlackAPI
, and serve it:
SlackAPI
: Wraps Agno agents/teams for Slack integration via FastAPI.SlackAPI.serve
: Serves the FastAPI app using Uvicorn, configured for Slack.SlackAPI
ClassParameter | Type | Default | Description |
---|---|---|---|
agent | Optional[Agent] | None | Agno Agent instance. |
team | Optional[Team] | None | Agno Team instance. |
settings | Optional[APIAppSettings] | None | API configuration. Defaults if None . |
api_app | Optional[FastAPI] | None | Existing FastAPI app. New one created if None . |
router | Optional[APIRouter] | None | Existing APIRouter. New one created if None . |
app_id | Optional[str] | None | App identifier (autogenerated if not set). |
name | Optional[str] | None | Name for the App. |
description | Optional[str] | None | Description for the App. |
agent
or team
, not both.
POST /slack/events
python <my-app>.py
(ensure ngrok is running)/invite @YourAppName
@YourAppName hello