AskSlackBot is a Slack bot management system built with Django, FastAPI, and LangGraph Agents, integrated with Slack via the Slack Bolt SDK for Python.
It supports multiple AI personas by routing users to dedicated API endpoints powered by LangGraph-based agents, which interact with MCP (Multi-Context Processor) tools for advanced reasoning and extensible workflows.
Get a quick visual overview of AskSlackBot in action:
- 🛠️ Django Backend — Handles Slack user management, persona configurations, and integration settings via an admin interface.
- 🤖 Slack Bot — Its the main service that interacts with users through the Home Tab, direct messages, and mentions events.
- ⚡ FastAPI Services — Provides RESTful endpoints for agent chat handling, health checks, and tool discovery.
- 🧩 LangGraph Agents — Implements modular, graph-based AI agents for structured reasoning and persona-specific workflows.
- 🔗 MCP Integration — Connects to external MCP servers for performing computations, data analysis, or other domain-specific tasks.
- 🧠 Multi-Persona System — Supports multiple bot personas, each with unique endpoints and behaviors. It can even support endpoints from N8N webhooks.
- 📊 Advanced Math Tools — Includes simple and advanced math operations via MCP servers.
| Directory | Description |
|---|---|
core/ |
Django project settings and configuration. |
personas/ |
Defines bot personas and their corresponding LangGraph + MCP logic. |
slack_bot/ |
Slack bot logic including event handlers, message processors, and view interactions. |
slack_integration/ |
Django app for managing Slack users, roles, and administrative tools. |
git clone https://github.com/kwstasg/AskSlackBot.git
cd AskSlackBotMake sure Python ≥ 3.10 is installed.
python -m venv env
source env/bin/activatepip install -r requirements.txtCopy the environment sample file and update your configuration:
cp .env.sample .envUpdate .env with your:
-
Django Settings:
Configure theSECRET_KEYfor Django's security and setDEBUGtoTruefor development orFalsefor production. Specify the database engine (sqlitefor development ormysqlfor production). -
Database Configuration:
If using MySQL or MariaDB, provide the database name, user, password, host, and port. For SQLite, no additional configuration is needed. -
Slack API Tokens:
Add your Slack Bot Token (SLACK_BOT_TOKEN) and App Token (SLACK_APP_TOKEN) to enable communication with your Slack workspace.
For guidance on creating a Slack app and retrieving these tokens, refer to the Slack API: Creating and Configuring Apps. -
LLM Provider Settings:
Choose the language model provider (LLM_PROVIDER) such asazureoropenrouter. Depending on your choice, configure the corresponding API keys, endpoints, and model names.
Make sure to keep sensitive information like API keys and database credentials secure.
python manage.py makemigrations slack_integration
python manage.py migratepython manage.py createsuperuserpython manage.py runserverpython ./slack_bot/main.pypython ./personas/generic_bot_agent.pyAskSlackBot includes demo MCP (Multi-Context Processor) tools to showcase simple and advanced math operations:
- Simple Math Tools: Addition, subtraction, multiplication, and division.
- Advanced Math Tools: Power, square root, factorial, average, standard deviation, dot product, and quadratic equation solving.
Slack Workspace
│
▼
AskSlackBot
│
├── Django Backend
├── Slack Bot Event Handlers (Home Tab, DM, Mention)
├── Persona Agent Router (Can also support N8N Webhooks and AI Agents)
├── FastAPI Services
├── LangGraph Generic Agent
└── MCP Server Connections
└── Math Demo Tools
- Python 3.10+
- Django — Backend management and user data.
- FastAPI — Lightweight service for MCP/agent endpoints.
- LangGraph — Framework for building modular AI agent graphs.
- Slack Bolt (for Python) — Slack SDK integration.
- SQLite / MariaDB — Database layer.
- Uvicorn — ASGI server for FastAPI.
This project is licensed under the MIT License.
