A Slack-integrated assistant that enables natural language querying of internal documentation such as runbooks, ADRs, and wikis. It uses OpenAI embeddings with a Chroma vector store for semantic search and returns summarized, context-aware answers directly in Slack. Falls back to GPT-based general knowledge when no relevant information is found.
- 🔍 Semantic Search: Uses OpenAI embeddings to semantically match questions to internal documentation
- 🧠 Contextual Summarization: Returns only the most relevant excerpts, not full wiki pages
- 💬 Slack Integration: Ask questions directly in Slack via mentions
- 📄 Source Linking: Provides links to the original documentation sources
- 🧩 Fallback to GPT: Uses GPT for DevOps/infra questions when no internal match is found
- 🚫 Reduces Tribal Knowledge Dependency: Engineers don't need to know specific document titles or locations
- "How do I block an IP in AWS WAF?"
- "Why is the Go audit indexer lagging?"
- "How do I manually reindex the org?"
Slack → Slack Bolt App (Python) →
↓
Extract Question → Embed via OpenAI → Query Chroma Vector Store →
↓ ↓
Match Found? No Match
↓ ↓
Summarize + Cite Source → Use GPT to Answer
↓
Respond in Slack Thread
git clone https://github.com/reshmachitre/Kb-Slackbot.git
cd slack-knowledge-assistantpython3 -m venv venv
source venv/bin/activatepip install -r requirements.txtCreate a .env file in the project root:
SLACK_BOT_TOKEN=xoxb-your-slack-bot-token
SLACK_APP_TOKEN=xapp-your-slack-app-token
OPENAI_API_KEY=sk-...You must embed and store your internal documents (runbooks, ADRs, etc.) in ChromaDB using OpenAI embeddings. This typically happens in a separate ingestion script.
Ensure your chroma_store/ contains the indexed vectors.
Note: If needed, we can provide a script to do this.
python app.pyThe bot will start and listen for mentions via Socket Mode.
Mention the bot in a Slack channel or DM:
@knowledge-bot How do I reindex the catalog?
It will respond with:
- A summary of the best-matching documentation
- Relevant source links
- A fallback GPT response if no internal docs matched
The bot uses a static map of source files to URLs (e.g., Confluence pages). Update the SOURCE_LINKS dictionary in app.py as you add more documents.
- Slack Bolt (Python)
- OpenAI Python SDK
- ChromaDB
- python-dotenv
Install them with:
pip install -r requirements.txt- Missing ChromaDB or Documents: Ensure your vector store is properly populated and path is correct
- Bot Not Responding: Check your Slack app permissions, tokens, and that it's running in Socket Mode
- Filtered Error: Ensure variable scopes are consistent if modifying the
get_context()logic
- Add streaming responses to Slack
- Allow ingestion via Slack DM/upload
- Admin UI for document ingestion and monitoring
- Add confidence scores in response metadata