Slack

Your support team can @mention the agent in a channel, and it answers in the thread.

Answer in Slack

Use the slack_bot connector with the workspace the bot is installed in.

slack_bot gives the agent no tools. For Slack tools, such as searching the workspace, use the slack connector.

The bot is a Slack app of your own, in a workspace where you can create apps. Setting it up takes six steps:

Create the Slack app

At api.slack.com/apps, create an app named Acme Support in your workspace. Under OAuth & Permissions, add the bot scopes chat:write, channels:history and im:history. Under App Home, turn on the Messages Tab.

Save the app's client

Give Stream the Slack app's Client ID, App ID (such as A012ABCD0A0), Client Secret and Signing Secret. The two secrets go on stdin, the Client Secret first:

curl -fsSL https://getstream.io/cli.sh | bash # get the CLI
printf '%s\n%s\n' "$SLACK_CLIENT_SECRET" "$SLACK_SIGNING_SECRET" | getstream agents connectors client set slack_bot \
  --client-id "$SLACK_CLIENT_ID" --provider-app-id A012ABCD0A0 --client-secret - --signing-secret -
Redirect URI (add it at the provider): https://router.example.com/v1/agents/connectors/oauth/callback
Saved the OAuth client for slack_bot
Warning:

Do this before step 4: Slack checks the Request URL at once, and Stream needs the signing secret to answer.

Add the redirect URI

Copy the redirect URI the CLI printed into the Slack app's OAuth & Permissions > Redirect URLs.

Turn on events

In the Slack app's Event Subscriptions, turn events on and set the Request URL: the redirect URI with /v1/agents/connectors/oauth/callback replaced by /v1/connectors/events/slack_bot/ and your Slack App ID. For a redirect URI of https://router.example.com/v1/agents/connectors/oauth/callback, that is https://router.example.com/v1/connectors/events/slack_bot/A012ABCD0A0. Then add the bot events message.channels, message.im and tokens_revoked.

Install the bot

getstream agents connections create slack_bot --label acme-workspace

Slack's consent opens in your browser. Pick the workspace and click Allow.

Add it to the agent

If you don't have an agent named support yet, create one in Creating an agent. Add the connection by its label:

getstream agents connectors bind support slack_bot --connection acme-workspace

The command adds this to agents/support/agent.yaml and syncs the agent. See a full agent.yaml for the rest of the file.

# ...
connectors:
  - name: slack_bot
    connection: acme-workspace

Test it in Slack itself. Add the bot to a public channel and write: "@Acme Support What is our return policy?". The agent answers in that message's thread. Reply in the thread without the mention, and it answers again. The thread is one conversation, shared by everyone who writes in it.

Limitations

One agent answers per connection. A second agent that uses the same connection is refused.

Going further