This is a proof of concept for collaborating with multiple AI agents on Slack.
git clone
this repository- Run
pip install slack_bolt langchain openai
- Run
source venv/bin/activate
- Copy the
.env.example
file to.env
. Follow the stepts below to get the necessary tokens.
- Go to Slack API and create a new app.
- Name your app and select a workspace.
- Under
Socket Mode
- Enable Socket Mode
- Generate an app token. The app token starts with
xapp-
. - Copy the app token and use it in your
.env
file.
- Under
Event Subscriptions
- Enable events
- Subscribe to bot events:
message.channels
message.groups
message.im
message.mpim
- Under
OAuth & Permissions
- Add the following scopes:
app_mentions:read
chat:write
- Install the app to your workspace.
- Copy the
Bot User OAuth Token
(starting withxoxb-
) and use it in your.env
file.
- Add the following scopes:
- Go to OpenAI and create an account (or log in).
- Under
Billing
, add a payment method and add some funds to your account. - Under
API Keys
, create a new API key. - Copy the API key and use it in your
.env
file.
- Make sure all environment variables are set in
.env
. - Run
python main.py
. - Invite the bot to a channel using
/invite @your-bot-name
. - Interact with an agent by mentioning it in a message, prefixed with an
!
. For example,Hello !echo, what's up?
.