Create a Chatbot from scratch that remembers and reminds events with Python

Summary

In this article, using Telegram and Python, I will show how to build a friendly Bot with multiple functions that can chat with question-answering conversations (short-term information) and store user data to recall in the future (long-term information).

All this started because a friend of mine yelled at me for not remembering her birthday. I don’t know if that has ever happened to you. So I thought I could pretend I remember birthdays while I actually have a Bot doing it for me. Now I know what you’re thinking, why building something from scratch instead of using one of the millions of calendar apps around? And you’re right, but for nerds like us … what’s the fun in that?

Through this tutorial, I will explain step by step how to build an intelligent Telegram Bot with Python and MongoDB and how to deploy it for free with Heroku and Cron-Job,using my Dates Reminder Bot as an example(link below).

I will present some useful Python code that can be easily applied in other similar cases (just copy, paste, run) and walk through every line of code with comments so that you can replicate this example (link to the full code below).

In particular, I will go through:

  • Setup: architecture overview, new _Telegram _Bot generation, _MongoDB _connection, _Python _environment.
  • Front-end: code the Bot commands for user interaction with pyTelegramBotAPI.
  • Back-end: create the server-side app with _flask _and threading.
  • Deploy the Bot through Heroku and Cron-Job

#artificial-intelligence #programming #web-development #chatbots #engineering #build & deploy a telegram bot with short-term and long-term memory

Build & Deploy a Telegram Bot with short-term and long-term memory
1.55 GEEK