An exploration on how to combine AI automation with human expertise using a scalable, extensible architecture.
The Challenge: Speed vs. Empathy in Customer Support
Modern customer support faces a central tension:
- AI offers speed, scalability, and 24/7 availability
- Humans bring empathy, flexibility, and problem-solving intuition
But traditional chatbots often fall short with complex requests, and purely human teams can’t scale cost-effectively.Solution: Human-in-the-Loop (HITL) AI.This architecture blends automation with human oversight by dynamically routing conversations based on confidence, context, and complexity.In this article, we’ll explore how to build a HITL support system using Botpress for AI and Slack for human collaboration—without locking yourself into a specific backend tech stack.
Architecture Overview: Botpress + Slack Integration
Your HITL support system includes three core components:
- 01 - Botpress AI Engine - Handles NLP, intent recognition, and AI-generated responses.
- 02 - Slack Webhooks and API Integration - Facilitates real-time messaging and collaboration.
- 03 - Context Management Layer - Tracks conversations, manages human handoffs, and preserves state

Why Botpress?
Botpress is a flexible, developer-friendly platform that makes it easy to build smart, context-aware chatbots. Its built-in NLP and seamless integration capabilities. It's extremely versatitle and allows you to basically implement it into your workflow in many ways unlike many other chatbot solutions.
Why Slack?
Slack is a powerful collaboration platform that teams already use daily, making it an ideal environment for customer support. Its real-time messaging, thread-based conversations, and robust API allow seamless integration with AI systems like Botpress.Using Slack for HITL support ensures human agents can jump into conversations instantly, without switching tools or disrupting their workflow. The abiltiy to be able to build your own application that can plug directly into your worskpace makes complete sense, especially if your team is already on the platform.
Message Flow: From User Input to Resolution
Let’s walk through how a message moves through the system:
1. Initial Message Processing
- A user visits a website and opens up the agent window powered by Botpress. After a brief conversation the user asks to talk to a human. Botpress then determines the need for handoff to a human and triggers the HITL (Human in the loop) workflow.
- The HITL workflow forwards a notification to Slack which alerts the Human agents in a designated slack channel that there is someone in need of support.
2. Human Handoff and Notification
- The notification recieved includes the context of the conversation using Botpress's abiltity to summarise the conversation.
- The human agent can then reply to directly in slack to this request with full context preserverd.
- The message is then sent back via a Botpress webhook and message then displayed to the user.
3. Context Mapping
- The system maps Slack thread timestamps to Botpress conversation IDs
- Ensures consistent history across AI and human interactions
5. Seamless Re-engagement
- When the human replies, the system detects the source
- AI can re-engage when the issue is resolved or a follow-up is needed

Webhook Design
The language of the webhook is irrelevant as long as it can handle slacks event models.
Outgoing Webhook (Slack Events)
You can implement it in any backend framework (Node.js, Python, Go, Java, etc.). The choices are endless:The webhook is relatively simiple in fact it performs this simple process:
- 01 - Verify Slack’s signature
- 02 - Filter bot/system messages
- 03 - Extract relevant info (text, thread, user ID, channel ID)
- 04 - Create a normalized message payload
- 05 - POST it to the Botpress webook.
{ "text": "Is there anything else I can help you with?", "userId": "U123", "channelId": "C456", "threadTs": "1717549330.000100", "conversationId": "abc-123" }
Outgoing Webhook (Botpress Events)
- 01 - Receive Slack's reply (includes message + slack metatdata)
- 02 - Botpress checks if we're still flagged as using HITL
- 03 - If so, send the human response back to Slack via chat.postMessage, using the original thread timestamp
- 04 - The human agent recieves the response in the original thread.
- 05 - Conversation continues.
Thread Context & State Management
Maintaining thread continuity is key to a natural support experience.There are a number of ways you can do this, whether it's via system memory or some sort of database storage. In this instance we use a lightweight key-value map.We store a combination of the Slack Channel ID with the original message timestamp as a lookup to the conversationID.
slackThreadMappings[channelID_threadTs] ⇆ botpress_conversation_id
This way any messages that come through to slack can be quickly mapped back to the Botpress conversation for further processing and to send back to Botpress to match the conversations.
Conclusion
By combining Botpress for intelligent automation and Slack for human collaboration, you can deliver responsive, context-rich customer support at scale.By adding a couple more features, this Human-in-the-Loop (HITL) system is:
- Smart enough to handle routine questions
- Flexible enough to escalate complex issues
- Modular enough to evolve with your tech stack. In this example we use slack but it could easily be swapped out to whatever chat/notification system you require.
If you have any questions about similar HITL systems please feel free to let me know.