Botpress, Next.js, Twilio, OpenAI, Stripe
Chat Your History — Adaptive Q&A Bot
An interactive Q&A bot built with Botpress Cloud — dynamically asks questions based on selected files, with flows defined through configurable workflows, SMS and voice access via Twilio, and shareable session memos.
What needed to be solved
The client needed a system where an AI asks questions, listens to user responses, and follows up based on those answers — not a static FAQ bot, but an adaptive conversation flow. He also needed a subscription layer so the platform could generate revenue from users accessing it.
Key Decisions & Challenges
Botpress over a Custom Bot
Situation
The client needed an adaptive Q&A flow where the bot asks follow-up questions based on user responses. Building this from scratch would have meant rebuilding conversation management, state handling, and flow logic entirely.
Options Considered
- Build a custom chatbot from scratch — full control, but significantly longer development time
- Use Botpress Cloud — define and connect conversation flows using nodes and cards without rebuilding the conversation engine
Decision
Used Botpress. It let me focus on the question logic and flow design rather than the infrastructure. The tradeoff was that prompt tuning required constant iteration as the client's requirements evolved — eventually the client started updating prompts himself to get the exact behavior he wanted.
Custom Backend + Neon PostgreSQL over Botpress DB
Situation
Botpress's built-in database was too expensive for the project's budget. There was also a requirement that if a user leaves mid-conversation, they should resume exactly where they left off on their next visit.
Options Considered
- Use Botpress's native database — simpler integration, but costly
- Build a custom backend with an external database and handle state manually
Decision
Built a custom backend with Neon PostgreSQL. Conversation state is tracked via Botpress hooks and custom APIs, enabling seamless resume without relying on Botpress's storage — at a fraction of the cost.
Custom OpenAI API for Image Understanding
Situation
A requirement came in that users should be able to upload an image and have the bot understand what it is about and continue the conversation from that context.
Decision
Built a custom API endpoint that sends the uploaded image to OpenAI's API, interprets the result, and feeds it back into the bot flow — extending Botpress's capabilities without modifying the core flow structure.
Features
Adaptive Q&A Bot
Botpress-powered bot that dynamically asks questions based on selected files, following up based on user responses through configurable workflows and nodes.
Progress Tracking
Web interface where users select file titles, track answered vs. pending questions, and monitor their individual progress.
Shareable Session Memos
Users generate shareable memos for each Q&A session, with options to copy or distribute via social platforms and WhatsApp.
SMS & Voice Access
Twilio integration lets users interact with the bot through SMS and phone calls for broader accessibility.
Conversation Resume
If a user leaves mid-session, the bot picks up exactly where they left off on their next visit, handled via Botpress hooks and custom APIs.
Image Understanding
Users upload an image and the bot understands its content via a custom OpenAI API endpoint, continuing the conversation from that context.
Subscription System
Stripe-powered subscription layer for monetizing access to the platform.
In Action
Botpress emulator
My Role
I was the sole developer — responsible for the full stack: the Botpress bot flows, the Next.js frontend, the backend, Twilio integration, and the Stripe subscription system.
Tech Stack
Outcome
Delivered to the client.