A powerful conversational agent that integrates seamlessly with Slack workspaces. This agent demonstrates advanced AI capabilities for building interactive Slack bots with tool integration, conversation management, and intelligent response generation.
- ✨ Features
- 🚀 Quick Start
- 📋 Prerequisites
- 💻 Installation
- 🔧 Slack Setup
- 🔧 Usage
- 📁 Project Structure
- ⚙️ Configuration
- ❓ Troubleshooting
- 👥 Contributing
- 🆘 Support
- 📄 License
- Slack Integration: Native Slack bot with real-time message handling
- Intelligent Conversations: Advanced AI-powered responses and context awareness
- Tool Integration: Support for external APIs, databases, and services
- Event Handling: Responds to mentions, direct messages, and slash commands
- Streaming Responses: Real-time message updates for better user experience
- Multi-workspace Support: Deploy across multiple Slack workspaces
- Secure Authentication: OAuth 2.0 and secure token management
- Easy Deployment: Seamless integration with Blaxel platform
For those who want to get up and running quickly:
# Clone the repository
git clone https://github.com/blaxel-templates/template-slack-chatbot.git
# Navigate to the project directory
cd template-slack-chatbot
# Install dependencies
uv sync
# Set up environment variables
cp .env.example .env
# Edit .env with your Slack credentials
# Start the server
bl serve --hotreload- Python: 3.10 or later
- UV: An extremely fast Python package and project manager, written in Rust
- Slack Workspace: Admin access to create and configure Slack apps
- Blaxel Platform Setup: Complete Blaxel setup by following the quickstart guide
- Blaxel CLI: Ensure you have the Blaxel CLI installed. If not, install it globally:
curl -fsSL https://raw.githubusercontent.com/blaxel-templates/toolkit/main/install.sh | BINDIR=/usr/local/bin sudo -E sh - Blaxel login: Login to Blaxel platform
bl login YOUR-WORKSPACE
- Blaxel CLI: Ensure you have the Blaxel CLI installed. If not, install it globally:
Clone the repository and install dependencies:
git clone https://github.com/blaxel-templates/template-slack-chatbot.git
cd template-slack-chatbot
uv syncStart the development server with hot reloading:
bl serve --hotreloadNote: This command starts the server and enables hot reload so that changes to the source code are automatically reflected.
- Invite your bot to a channel:
/invite @your-bot-name - Mention your bot:
@your-bot-name Hello! - Send a direct message to your bot
- Use slash commands (if configured)
When you are ready to deploy your application:
bl deployThis command uses your code and the configuration files under the .blaxel directory to deploy your application.
- src/main.py - Application entry point
- src/agent.py - Core Slack agent implementation
- src/slack_integration - Slack integration
- src/slack_router - Slack router including events handling
- src/slack_security - Slack check request is signed
- src/server/ - Server implementation and routing
- middleware.py - Request/response middleware
- pyproject.toml - UV package manager configuration
- blaxel.toml - Blaxel deployment configuration
- .env.example - Environment variables template
SLACK_BOT_TOKEN- Your Slack bot token (required)SLACK_SIGNING_SECRET- Slack signing secret for request verification (required)
Edit blaxel.toml to customize:
- Model settings and preferences
- Function definitions and tools
- Deployment environment variables
- Resource allocation
-
Slack Authentication Issues:
- Verify your bot token starts with
xoxb- - Check that your app is installed in the workspace
- Ensure signing secret matches your Slack app settings
- Verify your bot token starts with
-
Permission Errors:
- Verify bot has required OAuth scopes
- Check that bot is invited to channels where it should respond
- Ensure event subscriptions are properly configured
-
Event Handling Problems:
- Confirm your Request URL is accessible and returns 200
- Check that event subscriptions match your handler functions
- Verify Slack can reach your webhook endpoint
-
Blaxel Platform Issues:
- Ensure you're logged in to your workspace:
bl login MY-WORKSPACE - Verify models are available:
bl get models - Check that functions exist:
bl get functions
-
Bot Response Issues:
- Check message formatting and Slack API limits
- Verify conversation context and state management
- Monitor rate limiting and API quotas
-
Deployment and Configuration:
- Check environment variable configuration
- Verify webhook URLs are publicly accessible
- Review network connectivity and firewall settings
For more help, please submit an issue on GitHub.
Contributions are welcome! Here's how you can contribute:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature
- Commit your changes:
git commit -m 'Add amazing feature' - Push to the branch:
git push origin feature/amazing-feature
- Submit a Pull Request
Please make sure to update tests as appropriate and follow the code style of the project.
If you need help with this template:
- Submit an issue for bug reports or feature requests
- Visit the Blaxel Documentation for platform guidance
- Check the Slack API Documentation for Slack-specific help
- Join our Discord Community for real-time assistance
This project is licensed under the MIT License. See the LICENSE file for more details.
