/cognee-ask to search memory, save a message to memory with the Remember this shortcut, and review answers before sharing them with the rest of the channel.
This integration is for self-hosted Cognee deployments — you create and own the Slack app, so it lives entirely inside your own Slack workspace and your own Cognee backend. There is no shared, Cognee-managed Slack app.
Why Use This Integration
- Ask from anywhere in Slack:
/cognee-ask <question>searches your memory and replies privately, with a Share button to post the question + answer to the channel once you’ve checked it. - Save context on the fly: the Remember this message shortcut stores any Slack message into Cognee memory, tagged with the channel and author.
- Per-user, not per-workspace: each Slack member links their own Cognee account (
/cognee-link <api_key>), so answers and saved memories respect the same permissions they’d have via the API or SDK. - Self-hosted, no middleman: your Slack app talks directly to your Cognee backend. No data passes through a third-party relay.
Prerequisites
- A running Cognee backend reachable over HTTPS from the public internet (Slack will not call
localhost). For local development, use a tunnel like ngrok; for production, this is your deployment’s normal public domain. - A Cognee account with an API key for each Slack member who wants to link their account.
Setup
1. Create the Slack App
- Go to api.slack.com/apps → Create New App → From scratch.
- Name it (e.g. “Cognee”) and pick the workspace you’re installing it into for development.
2. Bot Token Scopes
OAuth & Permissions → Scopes → Bot Token Scopes — add:Deliberately no
channels:history — bulk channel ingestion isn’t part of this integration (see external data sources for pulling Slack history via dlt instead). Slack’s non-Marketplace rate limits on history reads (1 request/minute as of 2025) make it impractical here anyway.3. OAuth Redirect URL
OAuth & Permissions → Redirect URLs — add exactly:SLACK_REDIRECT_URI in step 6 — copy the same value into both places.
4. Slash Commands
Slash Commands → Create New Command — add both:5. Event Subscriptions & App Home
- Event Subscriptions → toggle on → Request URL:
https://<your-backend-domain>/api/v1/slack/events - Under Subscribe to bot events, add
app_home_opened. - App Home → enable the Home Tab.
6. Interactivity & Shortcuts
- Interactivity & Shortcuts → toggle on → Request URL:
https://<your-backend-domain>/api/v1/slack/interactive - Under Shortcuts → Create New Shortcut → On messages:
- Name:
Remember this - Callback ID:
remember_this(must match exactly — this is how Cognee’s handler recognizes it)
- Name:
7. Configure Cognee
Copy the app’s credentials into your backend’s.env (Basic Information for the first three):
8. Install and Connect
- Install App (in the Slack app’s sidebar) to add it to your workspace.
- In the Cognee UI, go to Integrations and click Connect Slack — this runs the OAuth install and links the workspace to your Cognee account.
- In Slack, run
/cognee-link <api_key>(from your Cognee account’s API Keys settings) so your own messages resolve to your own Cognee user. - Try
/cognee-ask What does Cognee do?— you should get a private reply with a Share button.
Multiple Environments
Slack apps are tied to one set of OAuth credentials and one Redirect URL each. If you run more than one Cognee deployment (local dev, staging, production), create a separate Slack app per environment rather than editing one app’s config back and forth — each environment gets its ownSLACK_CLIENT_ID/SLACK_CLIENT_SECRET/SLACK_SIGNING_SECRET/SLACK_REDIRECT_URI. This avoids local testing ever breaking a shared staging or production connection.
For local development with a tunnel, a reserved/static ngrok domain means you only register the Redirect URL once — it keeps working across every ngrok http restart instead of changing each time.
This is separate from how many Slack workspaces one deployment can serve: any number of different teams can each connect their own workspace to the same Cognee deployment through the same “Connect Slack” OAuth flow — that’s already multi-tenant by design and needs no extra setup per workspace.
Troubleshooting
- “redirect_uri did not match any configured URIs” (shown by Slack, during Connect Slack): the
redirect_uriyour backend sent (fromSLACK_REDIRECT_URI) isn’t byte-identical to an entry under OAuth & Permissions → Redirect URLs. Slack enforces an exact match as a security measure — add the missing URL there, or fixSLACK_REDIRECT_URIto match one already registered. - Slash commands/events return 401:
SLACK_SIGNING_SECRETin.envdoesn’t match the app’s Basic Information → App Credentials value, so Cognee’sX-Slack-Signaturecheck rejects the request. Recheck the value and restart the backend. - Slack shows “dispatch_failed” instead of a reply: the Slash Command’s Request URL is missing or wrong — it must point at
/api/v1/slack/commands, not/api/v1/slack/eventsor/api/v1/slack/interactive. If the URL is correct but you seeCommand `/some-command` is not yet supported.instead, that command was registered in the Slack App but isn’t one of the two Cognee implements (/cognee-ask,/cognee-link). - “This Slack workspace is not connected to Cognee”: the OAuth install (Connect Slack in the Cognee UI) hasn’t completed for this workspace yet, or the connection was later disconnected/revoked.
Related
External Data Sources
Pull Slack channel history in bulk via dlt, instead of the live bot.
Cloud Integrations UI
Where “Connect Slack” lives in the Cognee UI.