An intelligent Slack chatbot that analyzes conversations, extracts tasks, summarizes discussions, and provides context-aware insights about your work. Built with FastAPI, LLMs (Ollama/OpenAI), and SQLAlchemy.
- Thread Summarization: AI-powered summaries of any Slack thread
- Task Extraction: Automatically pull actionable items from conversations
- Context-Aware Q&A: Ask questions and get answers with full context of your work
- Task Tracking: Create, manage, and track work items
- Real-time Integration: Responds instantly to mentions in Slack
- Multi-LLM Support: Works with local Ollama or cloud OpenAI API
β
Summarize long Slack threads with one command
β
Extract tasks from conversations automatically
β
Answer questions like "What's on my plate?" with full context
β
Get daily/weekly work summaries
β
Track and manage action items
β
Provide smart insights about ongoing work
# Copy environment template
cp .env.example .env
# Edit with your Slack tokens
nano .envpip install -r pyproject.tomluvicorn api.main:app --reloadpython test_api.py- Go to Slack API
- Create a "New App"
- Set these scopes under "Bot Token Scopes":
chat:writechat:write.publicreactions:writesearch:readusers:readchannels:read
- Enable event subscriptions for:
app_mentionmessage.channelsmessage.groupsmessage.im
# Slack
SLACK_BOT_TOKEN=xoxb-your-token
SLACK_SIGNING_SECRET=your-secret
SLACK_APP_TOKEN=xapp-your-token
# LLM (choose one)
LLM_PROVIDER=local # Uses Ollama
MODEL_NAME=mistral
# OR
LLM_PROVIDER=openai # Uses OpenAI
OPENAI_API_KEY=sk-your-key
# Database
DATABASE_URL=sqlite:///./assistant.dbPOST /tasks/
Body: {"title": "...", "description": "..."}
Returns: Created task
GET /tasks/
Returns: List of all tasks
POST /summarize
Body: {
"text": "conversation text",
"store_tasks": true
}
Returns: {summary, extracted_tasks}
GET /memory/slack-threads/user/{user_id}
GET /memory/slack-threads/marked
POST /memory/slack-threads/mark
Body: {"thread_ts": "...", "is_marked": true}
POST /memory/slack-threads/analyze
Body: {"thread_ts": "...", "channel_id": "...", "extract_tasks_flag": true}
POST /chat/ask
Body: {
"user_id": "U123",
"question": "What's on my plate?",
"channel_id": "C456" # optional
}
Returns: AI-generated response with context
GET /chat/pending-summary/{user_id}
Returns: Summary of pending tasks
GET /chat/slack-status/{user_id}
Returns: User's recent Slack activity
@assistant What should I focus on?
@assistant Summarize this thread
@assistant Extract tasks from this
Mark a thread and use API to analyze
Slack Events β Slack Bot Handler β FastAPI Server β LLM (Ollama/OpenAI)
β
Database (SQLite/PostgreSQL)
β
Slack Notifications
- API Routes: FastAPI endpoints for all operations
- Slack Bot: Event handler for real-time interactions
- LLM Provider: Integration with Ollama (local) or OpenAI
- Context Builder: Builds smart context from tasks and threads
- Database: SQLAlchemy ORM with Task and SlackThread models
- Notifier: Sends responses back to Slack
assistant/
βββ api/routes/ # API endpoints
β βββ tasks.py
β βββ summarize.py
β βββ memory.py
β βββ conversation.py
βββ core/ # Core logic
β βββ slack_bot.py # Event handler
β βββ llm_provider.py # LLM integration
β βββ context_builder.py # Context logic
β βββ summarizer.py # Summarization
β βββ task_extractor.py # Task extraction
βββ connectors/ # External APIs
β βββ slack_client.py # Slack API wrapper
βββ memory/ # Data layer
β βββ models.py
β βββ repository.py
βββ notifications/ # Slack messaging
β βββ notifier.py
βββ config/ # Configuration
β βββ database.py
βββ utils/ # Utilities
βββ logger.py
| Layer | Technology |
|---|---|
| API | FastAPI, Uvicorn |
| Database | SQLAlchemy, SQLite (dev) / PostgreSQL (prod) |
| Slack | slack-sdk, slack-bolt |
| LLM | Ollama (local) + OpenAI (cloud) |
| Language | Python 3.12+ |
- id (primary key)
- title (required)
- description (optional)
- status (pending/completed/in-progress)
- created_at
- id (primary key)
- thread_ts (unique)
- channel_id
- user_id
- user_name
- channel_name
- summary
- is_marked
- created_at
- updated_at
| Guide | Purpose |
|---|---|
| QUICK_START.md | 5-minute quick start |
| SETUP_GUIDE.md | Complete setup & configuration |
| QUICK_REFERENCE.md | API reference & common tasks |
| ARCHITECTURE.md | System design & data flows |
| IMPLEMENTATION_NOTES.md | Technical details & next steps |
| COMPLETION_CHECKLIST.md | Feature checklist & status |
# 1. Install dependencies
pip install -r pyproject.toml
# 2. Configure .env
cp .env.example .env
# Edit with Slack tokens
# 3. Start server
uvicorn api.main:app --reload
# 4. Run tests (in another terminal)
python test_api.py
# 5. Test in Slack
# Mention bot: @assistant What's on my plate?- Create file in
api/routes/ - Define route handler
- Register in
api/main.py
Edit core/summarizer.py and core/task_extractor.py
Update DATABASE_URL in .env:
# SQLite (dev)
DATABASE_URL=sqlite:///./assistant.db
# PostgreSQL (prod)
DATABASE_URL=postgresql://user:password@localhost/dbname- Complete Quick Start
- Configure Slack tokens
- Run test suite
- Test with your Slack workspace
- Customize prompts for your domain
- Add conversation history
- Implement task priorities
- Create scheduled summaries
- Migrate to PostgreSQL
- Add user authentication
- Implement background jobs
- Create analytics dashboard
- Multi-workspace support
- Outlook Calendar integration
- Advanced analytics
- Mobile app
- Verify SLACK_BOT_TOKEN is correct
- Ensure bot is in the channel
- Check logs in console
- Ensure Ollama is running (if using local)
- Verify OpenAI API key (if using cloud)
- Check LLM_PROVIDER setting
- Check all .env variables
- Run
test_api.pyto diagnose - Review logs in server console
- Use local LLM (Ollama) for privacy and speed
- Start with SQLite, migrate to PostgreSQL when needed
- Cache frequently accessed data (future enhancement)
- Batch process long conversations
- Store tokens in .env (never commit)
- Use environment variables for secrets
- Implement authentication for production
- Use HTTPS in production
- Validate all inputs
MIT License - See LICENSE file
Feel free to extend with:
- New endpoints
- Additional integrations (Outlook, Teams, etc.)
- Advanced analytics
- Custom workflows
- Improved prompts
- Check documentation files
- Review code comments
- Run test suite for diagnostics
- Check server logs
β
Core Features: Complete
β
API Implementation: Complete
β
Slack Integration: Complete
β
Database Layer: Complete
β
Documentation: Comprehensive
β
Testing: Test suite included
Status: Ready for Production (with auth additions)
Version: 1.0.0
Last Updated: 2026-02-25
Ready to get started? Head to QUICK_START.md AI assistant is a tool which helps person to summarize his slack conversation, outlook email & track thread conversion, zoom conversation & can crate task behalf of that.