Echo
- 3 Devlogs
- 8 Total hours
A Slack AI assistant that remembers team's knowledge, summarizes conversations, answers questions, and helps developers search projects faster.
A Slack AI assistant that remembers team's knowledge, summarizes conversations, answers questions, and helps developers search projects faster.
I finished the last two most complex commands — /echo-summary and /echo-project and then finally deployed it on Nest with Hackclub
/echo-summary The command accepts today, yesterday, last N, and unread. I had to translate each of these into Unix timestamps for Slack’s conversations.history API
Filtering bot messages: The API returns bot messages too. Added .filter(m => !m.bot_id) to skip Echo’s own messages, otherwise Echo would summarize its own responses as if they were team decisions.
Finally deployed it on Nest as this
I’ve also shared a tutorial video on youtube to help you understand any command and how to use Echo on slack
https://youtu.be/Wu7u665-Njo
I gave some real commands and functions to Echo and connect it to the Hackclub workspace. By the end of the my work today , Echo had:
/echo-ask command — ask it anything, get an AI answer/echo-help command — shows all commands/echo-search command — live web search with cited sources/echo-docs command — searches technical documentationutils.js service for shared helpersservices/ai.js
The first thing I needed was a way for Echo to actually think and give responses. I built a single getAIResponse() function that every command would call:
temperature: 0.7 I’ve used temperature attribute so make model more creative in responsing.gpt-4o-mini for speed and cost, but I made the model parameter swappable so different commands can use better models when needed.services/utils.js , Helpers moduleBefore building commands, I wrote the utilities they’d all share. I’ve used a cache logic so that commands like /echo-summary loop through 50-100 messages and need user names for each one. Without caching, that’s 100 API calls. With caching, it’s only as many unique users as exist.
Then I built the files for each command in ordered manner in my project so that I can manage them easily. You can see the code of each file on my git repo
Slack’s 3-second ack timeout: Slack requires every slash command to be acknowledged within 3 seconds or it shows a timeout error to the user. AI calls take 3-10 seconds. Solution: await ack() immediately at the top of every handler, then do the slow work after. This was the first bug I had to fix.
User IDs in messages: Slack stores messages with raw user IDs like <@U123ABC> instead of names. When I was building search, I realized the AI would receive these IDs and not know who said what. so I built resolveUserMentions() to replace them with real names before sending to the AI.
Today I started Echo , an AI Slack bot that acts as a teammate inside your workspace. The idea hit me because our team was constantly switching tabs to look things up, ask questions, check what happened in a channel yesterday. I thought what if there was a bot that just lives in Slack and handles all of that?
Went to api.slack.com/apps and created a new app from scratch.
chat:write, commands, channels:history, users:read etc everything Echo would need to read messages and respond.SLACK_BOT_TOKEN (xoxb-…)SLACK_SIGNING_SECRETSLACK_APP_TOKEN (xapp-… for Socket Mode)I’ve used Node.js for my project
npm install @slack/bolt dotenv axios cheerio
Dependencies I’m working with:
@slack/bolt — Slack’s official framework for building bots. Handles all the event routing, slash commands, and ack() timing .dotenv — keep tokens out of the codeaxios — for hitting the HackClub AI API latercheerio — for parsing web content (I’ve planned for search in some cmds)Socket Mode confusion , at first I wasn’t sure whether to use Socket Mode or HTTP. Read through the Bolt docs and realized Socket Mode is the right call for development because I don’t need a public URL. HTTP is for production deployments.