Building PseudoChat: an AI-powered Slack chatbot with webhooks, FastAPI and Together AI
Wiring Slack events to an LLM through a verified webhook endpoint — and designing around Slack's three-second deadline.
01 The short version
PseudoChat answers mentions and direct messages in Slack using an LLM. Slack's event subscriptions POST to a FastAPI service, which verifies the request, decides whether it's a recognised command or a general question, and replies in the channel.
Together AI serves the model — LLaMA 3.3 70B — and ngrok exposes the local server during development so Slack's callbacks can actually reach it.
The security piece is request verification: HMAC-SHA256 signing with timestamp validation, so a spoofed request can't drive the bot.
The constraint that shapes the whole design is Slack's three-second response deadline. Generation takes longer than that, so the work moves to a background task and the endpoint acknowledges immediately.
02What you'll take away
- Verify every Slack request with HMAC-SHA256 and a timestamp check — the signing secret is the only thing between your bot and anyone who learns the URL.
- Slack gives you three seconds. Acknowledge first, generate in a background task, post the result afterwards.
- Routing known commands to custom handlers and falling back to the model keeps deterministic behaviour where you need it.
- ngrok covers local development, and the same handler runs unchanged once it's deployed.