Skip to content
This repository was archived by the owner on Feb 4, 2026. It is now read-only.

mlane/slack-drafter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack-drafter

A lightweight GPT-powered Slack bot that helps you reply faster — without sounding like a robot.

Powered by GPT-4 + LangChain. Designed for thoughtful humans who want to save time.


Features

  • ⌨️ Use /draft [thread URL] in Slack to generate a reply suggestion
  • 🧵 Understands full thread context to avoid repetition
  • 🔣 Adapts to your voice (IC-focused tone by default)
  • 🔒 Replies are private until you choose to send them
  • ⚡ Built with FastAPI, Slack Bolt, and LangChain

Quickstart

git clone https://github.com/mlane/slack-drafter.git
cd slack-drafter

# Create and activate virtual environment
python3.11 -m venv .venv
source .venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Copy and edit environment variables
cp .env.sample .env
# Then add your OpenAI and Slack credentials

Run the app:

python src/main.py

Environment Variables

LANGCHAIN_API_KEY=your-langchain-api-key
LANGSMITH_ENDPOINT="https://api.smith.langchain.com"
LANGSMITH_PROJECT=your-project-name
LANGCHAIN_TRACING_V2=true
OPENAI_API_KEY=your-openai-key
SLACK_ALLOWED_USERS=user-id-1,user-id-2
SLACK_BOT_TOKEN=xoxb-your-slack-token
SLACK_SIGNING_SECRET=your-signing-secret

Note: The LangChain and LangSmith variables are optional and currently unused. They're included for future support (e.g. memory, tracing, or LangSmith debugging).


Minimal Testing

To keep LLM costs low, we recommend basic tests for:

  • extract_slack_ids()
  • format_timestamp()
  • format_user()

Example:

# tests/slack_utils_tests.py
def test_format_timestamp():
    ts = "1714774008.000000"
    formatted = format_timestamp(ts)
    assert formatted == "2024-05-03 10:06 PM UTC"

Slack App Setup

  1. Create a Slack App at https://api.slack.com/apps
  2. Enable Slash Commands and Event Subscriptions
  3. Add these OAuth scopes:
    • commands
    • chat:write
    • channels:history
    • users:read
  4. Create a slash command:
    • Command: /draft
    • Request URL: https://<your-domain>/slack/events
  5. Install to your workspace

Roadmap

  • Slash command reply suggester
  • Ephemeral message previews
  • Tone tuned to IC voice
  • Optional App Home fallback UI
  • Long-term personalization via memory/context
  • Message quality scoring (e.g., “Too wordy”)

🧑‍💻 License

MIT

Contributions

PRs welcome. Please keep things minimal, tested, and low-dependency.


Why "slack-drafter"?

The goal is simple: help you draft thoughtful replies — fast. Whether you're in back-to-back meetings or catching up on threads, this Slack bot gives you a head start without losing your voice.

Previously named slack-reply-assistant.

About

A lightweight Slack bot that suggests personalized, GPT-powered replies when you’re mentioned in a thread — fast, human-reviewed, and built for productivity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages