This project demonstrates the integration of Generative AI into a real-world chatbot deployed on Telegram, enhanced by multimodal input (text + voice), Web App interactivity, and deployment on Render. The applicationβHappyBotβis designed for wellbeing support and interaction through both natural conversation and a Telegram Mini App interface.
Building this application provided a comprehensive look into applying Generative AI for practical problems like: - Mental wellbeing support through empathetic responses - Lightweight mobile-friendly interaction (Mini App) - Async API deployments and webhook-based triggers - Multimodal UX with both text and voice support
format_prompt() via LangChain to condition prompts by
context (detect_context()), history, and user intent.run_webhook() to expose a Telegram-compatible
endpoint.InlineKeyboardMarkup to open a Web
App.alerts.html) back into Telegram via
web_app_data..oga), converts to
.wav, and transcribes using
SpeechRecognition + Sphinx.gTTS, improving accessibility and
engagement.telegram_bot.py: Handles all Telegram logic, command
routing, and multimodal message processing.sea_lion_api.py: Centralizes LLM interaction, allows
easy swapping of providers.session_db.py: Supports Redis-based or in-memory
session state management.langchain_prompts.py: Modular prompt formatting
logic.| Concept | Key Insight |
|---|---|
| Prompt Design | How small changes affect model tone & relevance |
| API Rate-Limits | Added retries, error logging for robustness |
| Web App UX | JavaScript-based forms bridge mobile & bot |
| Multimodal Handling | Complex pipeline: OGG β WAV β Text β LLM β Text+TTS |
| Deployment Strategy | Importance of environment variables & webhook correctness |
This project embodies a full-stack AI agent, from frontend interaction (Mini App) to backend intelligence (LLM) with seamless cloud deployment and real-time interaction via Telegram. It highlights how modern GenAI tools can be adapted creatively to real societal challenges, such as mental wellbeing support, through thoughtful system design.