Engineering

From Hackathon to production: The development journey of Slack summary AI

Tetsuji Higashi

Hello, I'm Higashi from the marketing team EM at JAPAN AI.

AI SaaSサービス開発チームAI活用戦略pitta.me

Today I want to share the story of a Slack thread summarization bot we built during a one-day AI hackathon held by the JAPAN AI business division in August.

The hackathon's goal was "developing AI tools to improve our own work efficiency." About 30 people participated—engineers, product managers, customer success team members—working individually or in teams to build AI applications. Since time was limited, I chose to work alone rather than in a team.

What We Built

I implemented a bot that summarizes Slack thread content. I often get mentioned in the middle of long threads and spend too much time trying to understand what's being discussed, so I wanted to solve this problem by building something myself.

But simple AI summarization and natural language search are already available as Slack's official AI add-on (though it's a bit pricey at ¥1,200 per user per month).

So instead of just replicating that functionality, I decided to implement some of those features while adding ideas for external integrations that Slack's AI add-on can't do.

Thread Summary Feature

When users mention the bot, it analyzes conversations in the thread and creates concise summaries, including decisions made and action items.

Incident Analysis

Analyzes content in service incident reporting channels, searches for similar past cases and solutions. Integrates with Confluence pages to suggest next actions based on historical cases.

GitHub Integration

Summarizes specification discussions that happen in Slack threads and should be linked to PRs. Posts summaries directly as comments on relevant PRs.

Just mention the app and it summarizes for you. (In practice, this assumes conversations between multiple accounts.)

Tech Stack and Architecture

Technology Overview

・Slack Bot: TypeScript, Bolt for JavaScript

・AI Workflow: Dify

・Integrations: Confluence, GitHub

I used Dify to implement the core summarization logic.

Dify is an open-source AI application development platform that combines Backend as a Service and LLMOps concepts, enabling developers to rapidly build AI applications.

You can build complete workflows including conditional branching, loops, and integrations with external tools including LLMs using a GUI interface. This let me implement most of the logic including prompt tuning with no code, very quickly.

Processing Flow

1. When the bot is mentioned in a Slack thread, the event listener (Slack Bot) triggers

2. Retrieves thread content and sends it to Dify

3. Generates summary based on the workflow configured in Dify

4. Returns the generated summary as a reply to the original thread

This workflow goes beyond simple summarization. For incident analysis, it incorporates RAG-like functionality by including knowledge based on past data in the processing flow. It also implements logic to use different prompts based on context.

Dify Workflow

In addition to a simple summarization flow, this workflow also realizes logic such as inserting knowledge that mimics past data into the processing flow for incident analysis (like a RAG linkage) and using different prompts depending on the context.

Prompt Design

The core summarization prompt was designed with business use in mind, focusing on extracting conclusions and action items.

const threadSummaryPrompt = (messages: string, additionalPrompt: string) => `
こちらはSlackのスレッド内で行われた会話です。以下の点に注意して要約を行ってください。

1. 会話全体をよく読んでください
2. 議論された主なトピックを特定し、重要な決定や結論があればメモする。重要な期限や日付があれば共に言及する
3. チームメンバーに割り当てられたアクションアイテムやタスクを強調する
4. 未解決の問題があれば記録する

${additionalPrompt
    ? `また、会話の前提および注意点として、以下の内容も考慮してください。
    ${additionalPrompt}`: ''
}
<message>
${messages}
</message>
`

Beyond this, I prepared context-supplementing prompts tailored to specific use cases like incident analysis and GitHub integration.

Implementation Process

During this hackathon, we had less than a full day for implementation, but I was able to rapidly build exactly what I wanted by using AI tools throughout the process:

・Built the Slack Bot from scratch using Cursor

・Generated and debugged prompt drafts using Anthropic Workbench's prompt creation feature

・Generated specification ideas and explanatory text for the Slack app using ChatGPT

・Created the Slack app icon image:

- Generated the base with Stable Diffusion

- Used JAPAN AI's image generation app's inpainting feature to refine the illustration

The App We Created

I named it "Summabot"—a play on "Summary" and "sanma" (Pacific saury fish). ChatGPT came up with the concept: "Fast-moving autumn saury fish ⇒ information freshness matters too." I just went with ChatGPT's sense of humor.

Operations and Future Improvements

More than a month has passed since the hackathon, but the infrastructure team prepared our internal OpenStack environment for hosting, so everyone in the company will actually be able to use it (starting next week).

For actual operations, I migrated the logic implemented in Dify to TypeScript (mostly in one shot by loading Dify's DSL into Cursor). When logic becomes complex, GUI-based tools become difficult to manage. I also removed the incident analysis and PR comment features other than thread summarization since their accuracy wasn't good enough, and instead added channel analysis functionality for the initial release.

Future Roadmap

・Summary Feature Enhancement:

  • Purpose-driven summarization features
  • External data integration and dataset creation

・Usability Improvements:

  • Information linking across multiple channels
  • Interactive summarization options

Conclusion

This hackathon wasn't just about building a workflow improvement app—it was also valuable time to try out new ideas for JAPAN AI, the service we provide.

Since the Slack summarization bot we developed received positive feedback as something useful, I want to nurture it to a level where we can offer it as a service.

You can also read about the overall hackathon in Geniee's official blog, which introduces other teams' interesting ideas. Please check that out too.

AI Dogfoodingに挑戦!第一回JAPAN AI HACKTHONレポート|株式会社ジーニーnote.com