Build an AI Slack knowledge bot
A Slack knowledge bot answers questions like 'what's our refund policy?' or 'how do I get VPN access?' in a channel or DM, using your own docs instead of the open web, and links the page each answer came from. It combines our RAG docs stack (index your docs, retrieve the relevant chunks, answer from them) with a Slack app that listens for mentions and direct messages.
Uses the picker's RAG / docs Q&A stack, with advice specific to this use case.
Recommended stack
Model
- Google Gemini 3.8 Flash: Free tier available; paid ~$0.75 in / $3.75 out per 1M until 2026-12-31, then $1.50/$7.50 (verified 2026-11-29)
- Anthropic Claude Sonnet 5.5: ~$2 in / $10 out per 1M tokens (verified 2026-11-29 on anthropic.com/pricing)
Framework
- LlamaIndex: Open source (free); LlamaParse cloud Pay-as-you-go $0/mo with 10K credits included, Pro $500/mo (400K credits) (verified 2026-11-15)
- LangChain / LangGraph: Open source (free); LangSmith Developer $0 (5k traces/mo), Plus $39/seat/mo (verified 2026-11-15)
- Chroma: Open source (free); Chroma Cloud Starter $0 + usage with $5 free credits, Team $250/mo (verified 2026-11-29)
- Supabase (Postgres + pgvector): Free: 500 MB database, 2 active projects, pauses after 1 week idle; Pro from $25/mo (verified 2026-11-29)
Hosting
No-code alternative
- Dify: Open source self-host free; Cloud Sandbox free (200 message credits), Professional $590/yr per workspace (verified 2026-11-15)
Rough monthly cost
$0–30/mo (Supabase/Chroma free tier + embeddings + tokens)Approximate. Tool prices checked 2026-11-15.Difficulty
IntermediateSome links may be affiliate links. Disclosure
Why this stack
- Slack's Bolt framework (JavaScript, Python or Java) handles events, slash commands and Socket Mode for you. Socket Mode receives events over a WebSocket, so you don't need a public URL, which suits an internal bot; Socket Mode apps can't be listed in the Slack Marketplace (Slack developer docs, checked 29 Nov 2026).
- Index the docs people actually ask about (handbook, wiki export, runbooks, FAQs) with LlamaIndex or LangChain into Chroma or Supabase pgvector. Chroma is open source, and Supabase's free plan includes a 500 MB database (checked 29 Nov 2026).
- A low-cost model such as Gemini 3.8 Flash (free tier; paid about $0.75 in / $3.75 out per 1M tokens until 31 Dec 2026) or GPT-6 Luna (about $0.10 / $0.50) keeps each answer cheap. Step up to Claude Sonnet 5.5 (about $2 / $10) if answers need more reasoning (prices checked 29 Nov 2026).
- A Socket Mode bot holds an open connection, so host it on an always-on container. Railway's Hobby plan is $5 a month including $5 of usage (checked 29 Nov 2026); a small Fly.io machine also works.
Step-by-step
- Create a Slack app from a manifest with only the scopes you need (for example app_mentions:read, chat:write and im:history), turn on Socket Mode and generate an app-level token. Install it in a test workspace first.
- Get a Bolt app replying 'pong' to an @mention before you add any AI.
- Index 20 to 50 of your most-asked-about docs. Chunk them and store each chunk with its title and URL so answers can link the source.
- On each mention or DM, retrieve the top chunks, answer only from them with a short system prompt, reply in a thread and include the source links. If nothing relevant comes back, say so and point to a person or channel.
- Run it in one channel for two weeks, collect thumbs-up/down feedback, log unanswered questions, and fill the gaps in your docs.
Common pitfalls
- Respect permissions. A bot that indexes private channels, HR files or DMs can leak them to anyone who asks. Start with docs everyone may read, and never index content the asker couldn't open themselves.
- Reading channel history is rate-limited for some apps: since 29 May 2025, commercially distributed apps outside the Slack Marketplace get 1 conversations.history or conversations.replies request per minute, 15 messages each. Internal apps built for your own workspace keep 50+ requests per minute (Slack changelog).
- On Slack's Free plan only the last 90 days of message and file history are accessible and you can add up to 10 integrations, so don't plan on indexing old threads there (Slack plans page, checked 29 Nov 2026).
- Questions are untrusted input. Keep the bot read-only: don't let a message make it post elsewhere, DM people or change anything.
- Keep the bot token and app-level token in environment variables, never in code or prompts, and rotate them if they leak.
- Stale docs produce confident wrong answers. Re-index on a schedule and show each source's last-updated date.
FAQ
How do I make a Slack bot that answers questions from our docs?
Create a Slack app with Bolt and Socket Mode, index your docs into a vector database (Chroma or Supabase pgvector) with LlamaIndex or LangChain, and on each mention retrieve the relevant chunks and have a model answer from them with links to the source pages.
How much does an AI Slack bot cost to run?
Often a few dollars a month. Chroma is free and open source, Supabase has a free plan, Railway's Hobby plan is $5 a month including $5 of usage, and a cheap model like GPT-6 Luna costs about $0.10 in / $0.50 out per 1M tokens (checked 29 Nov 2026).
Can the bot read our Slack conversations too?
It can, with the right scopes, but be careful: indexing channels can expose private discussions, Slack limits channel-history reads for apps distributed outside its Marketplace, and the Free plan only gives access to 90 days of history. Most teams start with docs and wiki pages and add selected public channels later.
Try it in the picker: Slack bot that answers questions from our docs · AI Slack bot for our company wiki · Slack bot for our HR knowledge base
Customise this stack in the picker →Related stacks
- Build a docs Q&A (RAG) app (RAG / docs Q&A)
- Build an AI Discord or Telegram bot (Discord / Telegram bot)
- Build an AI customer support bot (AI customer support bot)
Last updated 2026-11-29.