Skip to content

Add Slack PDF Summarizer Bot#14

Draft
charlieatchime wants to merge 1 commit intomainfrom
cursor/slack-pdf-summarization-9351
Draft

Add Slack PDF Summarizer Bot#14
charlieatchime wants to merge 1 commit intomainfrom
cursor/slack-pdf-summarization-9351

Conversation

@charlieatchime
Copy link
Copy Markdown

Summary

Adds a Slack bot that automatically detects when a PDF is shared in a channel and replies in a thread with a concise bullet-point summary of the document's key insights.

How it works

  1. A user drops a PDF into any channel the bot is a member of.
  2. The bot detects the PDF attachment, downloads it, and extracts the text using pdf-parse.
  3. The extracted text is sent to OpenAI (GPT-4o by default) with a prompt tuned to produce 3–7 bullet points of key insights.
  4. The summary is posted as a threaded reply on the original message.
  5. If multiple PDFs are shared in one message, they are all summarized concurrently.

Stack

  • @slack/bolt — Slack event handling via Socket Mode
  • pdf-parse — text extraction from PDF buffers
  • openai — GPT-4o-powered summarization

Files added

File Purpose
slack-pdf-summarizer/src/app.js Main Slack Bolt app — listens for messages with PDF attachments
slack-pdf-summarizer/src/pdf-extractor.js Extracts text from PDF buffers
slack-pdf-summarizer/src/summarizer.js Sends extracted text to OpenAI for bullet-point summarization
slack-pdf-summarizer/README.md Full setup instructions including Slack App configuration
slack-pdf-summarizer/.env.example Environment variable template
slack-pdf-summarizer/package.json Dependencies and scripts

Setup required

The README contains step-by-step instructions. In short:

  1. Create a Slack App with Socket Mode and the required scopes (channels:history, chat:write, files:read, etc.)
  2. Set environment variables (SLACK_BOT_TOKEN, SLACK_APP_TOKEN, SLACK_SIGNING_SECRET, OPENAI_API_KEY)
  3. npm install && npm start
  4. Invite the bot to channels where you want PDF summarization

Slack Thread

Open in Web Open in Cursor 

Automatically detects PDFs shared in Slack channels and replies with
a concise bullet-point summary of key insights.

Stack:
- @slack/bolt (Socket Mode) for Slack event handling
- pdf-parse for text extraction from PDF buffers
- OpenAI (GPT-4o) for generating summaries

Includes README with full Slack App setup instructions.

Co-authored-by: charlieatchime <charlieatchime@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants