Connectors Slack

Slack

Chat

The Slack connector is a chat connector that pulls live messages from Slack channels via a Bot Token. It uses db.ingest_chat() to extract claims from message threads.

How it works

Extraction modes

ModeDescription
heuristicFast rule-based extraction. No LLM required. Default mode.
smartEnhanced heuristic with pattern matching and entity recognition.
llmFull LLM-powered extraction. Requires a configured curator.

1 Create a Slack App

Go to api.slack.com/apps and create a new app for your workspace.

2 Add Bot Token Scopes

Under OAuth & Permissions, add the following Bot Token Scopes:

3 Install to Workspace

Click Install to Workspace and authorize the app. Copy the Bot User OAuth Token (starts with xoxb-).

4 Install the requests package

$ pip install requests

5 Connect

conn = db.connect("slack", token="xoxb-...")
result = conn.run(db)
Parameter Required Default Description
token Yes Slack Bot Token (xoxb-...)
channels No All List of channel names to fetch
extraction No heuristic heuristic, smart, or llm
oldest No 0 Unix timestamp for oldest messages
save No False Encrypt and persist token

Basic usage

conn = db.connect("slack", token="xoxb-...")
result = conn.run(db)
print(f"Ingested {result.claims_ingested} claims")

Filtered channels with save

conn = db.connect("slack",
    token="xoxb-...",
    channels=["general", "engineering"],
    extraction="heuristic",
    save=True,
)
result = conn.run(db)

LLM extraction

conn = db.connect("slack",
    token=os.environ["SLACK_BOT_TOKEN"],
    extraction="llm",
    oldest=1700000000,
)
result = conn.run(db)

Related Connectors