Index the message history of Slack channels, one thread at a time.
Slack can no longer be added as a new source. This page is for Slack sources added earlier, which keep syncing.
This source reads what was said in Slack. To answer questions inside Slack, set up the Slack bot. You can use both.

Before you start

  • A Pro plan or higher, and permission to edit sources in the knowledge base.
  • Permission to create a Slack app in your Slack workspace.

Set up

1

Create a Slack app

At api.slack.com/apps, create an app for your workspace. Under OAuth & Permissions, add these bot token scopes: channels:read, channels:history, users:read and team:read. For private channels, also add groups:read and groups:history.
2

Install the app

Install the app to your workspace and copy the Bot User OAuth Token. It starts with xoxb-.
3

Invite the bot

In every channel you want indexed, run /invite @your-app. Kelu reads only channels the bot is in.
4

Add the source

In Kelu, open your knowledge base, go to Sources, click Add source and choose Slack. Paste the Bot token. To index only some channels, list their Channel IDs. Click Add source. The first sync starts right away.
Chat history often holds things you would not publish. A Slack source starts Restricted: its documents answer your team and your chat bots, but not your widget or public API. To keep it that way for good, add Slack to an internal knowledge base.

Options

The add form shows Bot token and Channel IDs. The rest are on the source’s Configuration tab.
OptionDefaultWhat it does
ChannelsEmptyChannel IDs, comma-separated, for example C0123456, C0789012. Empty indexes every public channel the bot is in. Archived channels are skipped. A private channel needs groups:read and groups:history.
Include private channelsOffAlso indexes private channels the bot is in. Needs groups:read and groups:history. Ignored when Channels is filled in.
Threads opened withinEmptyOnly threads started in the last N days. Empty reads the whole history.
Trusted usersEmptyUser IDs or handles, for example U024BE7LH, @alice. The people whose replies you trust.
Only threads a trusted user answeredOffDrops every thread no trusted user replied to. Ignored while Trusted users is empty.
Exclude usersEmptyUser IDs or handles, for example @ci-bot. Their messages are dropped, the rest of the thread is kept.
New documentsRestrictedSet to Public so documents indexed from now on also reach public surfaces. Documents already indexed keep their setting.

What gets indexed

  • One document per thread. A message with no replies is its own document.
  • The title is #channel: first line of the opening message. The citation links to that message.
  • The document holds the question, then the accepted answer, then the rest of the discussion, each with author and date.
  • The accepted answer is the reply marked with a check-mark emoji (✅ ✔️ ☑️, or a custom emoji named solved, resolved, answered or correct). With none, it is the reply with the most reactions. With a tie, no reply is marked.
  • Join, leave and topic-change messages are skipped.

Sync

Slack re-syncs every 6 hours. Click Sync Now on the source page to sync right away.

Troubleshooting

  • The sync fails with not_in_channel. You named a channel the bot is not in. Run /invite @your-app in it, then sync.
  • The sync fails with missing_scope. Add the missing scopes, reinstall the app, and paste the new token on the Configuration tab.
  • A channel is not indexed. With Channels empty, Kelu reads only channels the bot is in, and skips archived and private ones (unless Include private channels is on).
  • Authors show as user IDs. The token is missing users:read.
  • Citations open a Slack redirect, not the message. The token is missing team:read.
  • Nothing is indexed with Only threads a trusted user answered on. No trusted user replied in any thread. Check the names in Trusted users.