SlideShare a Scribd company logo
Story Of a Cerberus
Bot
Andrea De Gaetano - @dega1999
My Typical Work Day
#Java #j2ee #j2se #spring #swing #maven
#android #gradle
#security
After Work
I play a lot with:
#raspberrypi #arduino #esp8266 #iot #maker
#nodejs #python
#security
http://pestohacks.blogspot.com
What is a Cerberus Bot?
Sharing my experience on bot development
Talking about:
• Early 2000’s bots
• Why does bots matters?
• Bots Models/Architectures
• IndaqoBot: Telegram
• Bot Software Stack
• Firebase
• Improvements
• One Core , Multiple Heads: Facebook Messenger, Alexa?
• …And google assistant?
In the early 2000’s: IRC Bots
- File Sharing
- Guardians of Channels
- AntiSpam
- Ban unauthorized
- Secretary
- …
In 2016
Amazon
Apple
Facebook
Google
Microsoft
…
1st Impression
Why Should I use a Text based interface
instead a GUI?
Alexa, had my attention
Figuring out…
My Idea was changing
User Advantages
Integration in known software: integrated in app or service
known.. facebook messenger, skype, siri.
Users already know them: No learning curve, they can
rapidly start to talk with a bot with no need to learn a new
user interface.
No installation/space needed on the device: no need to
install anything on their device. No need to upgrade.
User Advantages
Natural Interaction: everyone knows how to text and
speak.
Attractive also for old people. A perfect bot is hard to
distinguish from a real person.
Same uniform experience across devices/platforms
Developer Advantages
• Userbase Potential: part of a known app (like facebook
messenger) improves the link between the real user
and the owner of the bot.
• Learn new data from users through continous
interaction
• One language for many platforms: web, web-mobile,
desktop, mobile .
• No need to bother with accounts,login, oauth,
tecnologies problems and so on!
Bots Models
• Generative
• Retrieval-Based
• Pattern Based
Generative Model
Retrieval Based Model
• The chatbot uses the message and context of
conversation for selecting the best response from a
predefined list of bot messages.
• The context can include current position in the dialog
tree, all previous messages in the conversation,
previously saved variables (e.g. username).
Pattern Based Model
• The bot have a list of the supported questions/
commands it support.
• Easy.
• Stupid.
• Eg. Alexa Skills
@IndaqoBot
• Pattern based
• 2 command supported:
• brief
• ready
• work only with Telegram
Start a new Telegram Bot
Bot Stack
Bot Stack
Web Dyno:
use node-telegram-bot-api
talk with telegram server
accept http requests: commands
Bot Stack
Web Worker
Task scheduled every hour:
• Send a broadcast message to
registered users
• Call Web Dyno to change mission
Keep bot state across reboots
Store Users Results: text and
images*
Never used before: easy
Structure Data
Storing user images
Storing user images
Storing user images
Sad Solution: all images are converted to base64
#code
#code TODO
Scalability
Chat Injections
Change Model
Facebook Integration
Road to Facebook Messenger integration
•Tested another bot with a raspberry pi 3, duckdns.org
and letsencrypt certificate. All free! :D
•You need to register a new application on Facebook,
generate a token and some other boring steps
•If the server doesn’t answer for some time, Facebook
disable the bot.
•From the @IndaqoBot code, just 2 new endpoints:
•one for the authentication between Facebook and
the server
•one to receive messages
•Need Facebook approval to publish it
Facebook Messenger integration
Alexa
#code
Advices for a Cerberus Bot
•Separate logic from presentation: endpoint code must be minimal
•Create library for your code, reusable from any platform
•Write Unit Test for your libraries
•Use a storage solution to keep bot state, like firebase
•Use constants
•Use localization
•Understand the limit of each bot platform: number of simultaneous
messages, user interactions and so on
•Be prepared to scale Fast!
Google Assistant
Twitter: @dega1999
Thanks you!

More Related Content

Viewers also liked

Cerberus, the hound from Hades
Cerberus, the hound from HadesCerberus, the hound from Hades
Cerberus, the hound from Hadesdomenechino
 
Characters
CharactersCharacters
CharactersJesss21
 
CURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANE
CURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANECURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANE
CURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANEMamonokane Rokney Komane
 
владимир
владимирвладимир
владимир
multy33
 
Greek mythology characters
Greek mythology charactersGreek mythology characters
Greek mythology characters
Christine May Petajen-Brillantes
 
6. gods portal copy
6. gods   portal copy6. gods   portal copy
6. gods portal copy
DB3igs
 
Revistajustomedio8 11
Revistajustomedio8 11Revistajustomedio8 11
Revistajustomedio8 11Perú 2021
 
Phieu_Dang_Ky_De_Tai_Trung
Phieu_Dang_Ky_De_Tai_TrungPhieu_Dang_Ky_De_Tai_Trung
Phieu_Dang_Ky_De_Tai_TrungVũ Nguyên
 
Effect of Workplace Civility, Structural and Psychological Empowerment on New...
Effect of Workplace Civility, Structural and Psychological Empowerment on New...Effect of Workplace Civility, Structural and Psychological Empowerment on New...
Effect of Workplace Civility, Structural and Psychological Empowerment on New...
iosrjce
 
El correo electronico
El correo electronicoEl correo electronico
El correo electronicoluis234yanez
 
Malcha flier feb12
Malcha flier feb12Malcha flier feb12
Malcha flier feb12weiss2001
 

Viewers also liked (20)

Cerberus, the hound from Hades
Cerberus, the hound from HadesCerberus, the hound from Hades
Cerberus, the hound from Hades
 
Characters
CharactersCharacters
Characters
 
The Twelth Labour
The Twelth LabourThe Twelth Labour
The Twelth Labour
 
CURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANE
CURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANECURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANE
CURRICULUM VITAE OF MAMONOKANE ROCKNEY KOMANE
 
владимир
владимирвладимир
владимир
 
Greek mythology characters
Greek mythology charactersGreek mythology characters
Greek mythology characters
 
E twinning project
E twinning projectE twinning project
E twinning project
 
6. gods portal copy
6. gods   portal copy6. gods   portal copy
6. gods portal copy
 
Dobre wypracowania
Dobre wypracowaniaDobre wypracowania
Dobre wypracowania
 
Revistajustomedio8 11
Revistajustomedio8 11Revistajustomedio8 11
Revistajustomedio8 11
 
Presentación1
Presentación1Presentación1
Presentación1
 
red scare collage
red scare collagered scare collage
red scare collage
 
2 2012
2 20122 2012
2 2012
 
2008-2011
2008-20112008-2011
2008-2011
 
Phieu_Dang_Ky_De_Tai_Trung
Phieu_Dang_Ky_De_Tai_TrungPhieu_Dang_Ky_De_Tai_Trung
Phieu_Dang_Ky_De_Tai_Trung
 
Pacho etitc 2012
Pacho etitc 2012Pacho etitc 2012
Pacho etitc 2012
 
Effect of Workplace Civility, Structural and Psychological Empowerment on New...
Effect of Workplace Civility, Structural and Psychological Empowerment on New...Effect of Workplace Civility, Structural and Psychological Empowerment on New...
Effect of Workplace Civility, Structural and Psychological Empowerment on New...
 
diploma 2.jpg
diploma 2.jpgdiploma 2.jpg
diploma 2.jpg
 
El correo electronico
El correo electronicoEl correo electronico
El correo electronico
 
Malcha flier feb12
Malcha flier feb12Malcha flier feb12
Malcha flier feb12
 

Similar to Story of a Cerberus Bot

ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp
 
Done Reports - Open Source Bridge
Done Reports - Open Source BridgeDone Reports - Open Source Bridge
Done Reports - Open Source Bridge
Aaron Parecki
 
Resume
ResumeResume
Resume
PeterTao7
 
Getting Started With bots
Getting Started With botsGetting Started With bots
Getting Started With bots
Gaurav sharma
 
EricLong_Resume_Public
EricLong_Resume_PublicEricLong_Resume_Public
EricLong_Resume_PublicEric Long
 
Datasploit - An Open Source Intelligence Tool
Datasploit - An Open Source Intelligence ToolDatasploit - An Open Source Intelligence Tool
Datasploit - An Open Source Intelligence Tool
Shubham Mittal
 
Pinax Long Tutorial Slides
Pinax Long Tutorial SlidesPinax Long Tutorial Slides
Pinax Long Tutorial Slides
Daniel Greenfeld
 
Py conkr 2020-automated newsletter service for your valuable community-chans...
Py conkr 2020-automated newsletter service  for your valuable community-chans...Py conkr 2020-automated newsletter service  for your valuable community-chans...
Py conkr 2020-automated newsletter service for your valuable community-chans...
Park Chansung
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professionalzwheller
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
Fred Lin
 
Resume
ResumeResume
Using Chatbots in Extension Programming
Using Chatbots in Extension ProgrammingUsing Chatbots in Extension Programming
Using Chatbots in Extension Programming
Amy Cole
 
memories of tumblr gear & Tumblrowl
memories of tumblr gear & Tumblrowlmemories of tumblr gear & Tumblrowl
memories of tumblr gear & Tumblrowl
honishi
 
Fun with Jenkins & Salesforce
Fun with Jenkins & SalesforceFun with Jenkins & Salesforce
Fun with Jenkins & Salesforce
Abhinav Gupta
 
Ai chatbot ppt.pptx
Ai chatbot ppt.pptxAi chatbot ppt.pptx
Ai chatbot ppt.pptx
aashnareddy1
 
React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + Authentication
Kobkrit Viriyayudhakorn
 
ChrisSchilling_SideProjects
ChrisSchilling_SideProjectsChrisSchilling_SideProjects
ChrisSchilling_SideProjectsChris Schilling
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
Heiko Voigt
 

Similar to Story of a Cerberus Bot (20)

ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
ITCamp 2017 - Laurent Ellerbach - Bot. You said bot? Let's build a bot then...
 
Done Reports - Open Source Bridge
Done Reports - Open Source BridgeDone Reports - Open Source Bridge
Done Reports - Open Source Bridge
 
Resume
ResumeResume
Resume
 
Getting Started With bots
Getting Started With botsGetting Started With bots
Getting Started With bots
 
EricLong_Resume_Public
EricLong_Resume_PublicEricLong_Resume_Public
EricLong_Resume_Public
 
Datasploit - An Open Source Intelligence Tool
Datasploit - An Open Source Intelligence ToolDatasploit - An Open Source Intelligence Tool
Datasploit - An Open Source Intelligence Tool
 
Pinax Long Tutorial Slides
Pinax Long Tutorial SlidesPinax Long Tutorial Slides
Pinax Long Tutorial Slides
 
Py conkr 2020-automated newsletter service for your valuable community-chans...
Py conkr 2020-automated newsletter service  for your valuable community-chans...Py conkr 2020-automated newsletter service  for your valuable community-chans...
Py conkr 2020-automated newsletter service for your valuable community-chans...
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Github for Serious Business Professional
Github for Serious Business ProfessionalGithub for Serious Business Professional
Github for Serious Business Professional
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
 
Resume
ResumeResume
Resume
 
Using Chatbots in Extension Programming
Using Chatbots in Extension ProgrammingUsing Chatbots in Extension Programming
Using Chatbots in Extension Programming
 
memories of tumblr gear & Tumblrowl
memories of tumblr gear & Tumblrowlmemories of tumblr gear & Tumblrowl
memories of tumblr gear & Tumblrowl
 
Fun with Jenkins & Salesforce
Fun with Jenkins & SalesforceFun with Jenkins & Salesforce
Fun with Jenkins & Salesforce
 
Ai chatbot ppt.pptx
Ai chatbot ppt.pptxAi chatbot ppt.pptx
Ai chatbot ppt.pptx
 
React Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + AuthenticationReact Native Firebase Realtime Database + Authentication
React Native Firebase Realtime Database + Authentication
 
Project Summary
Project SummaryProject Summary
Project Summary
 
ChrisSchilling_SideProjects
ChrisSchilling_SideProjectsChrisSchilling_SideProjects
ChrisSchilling_SideProjects
 
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
What is cool with Domino V10, Proton and Node.JS, and why would I use it in ...
 

Recently uploaded

May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
rickgrimesss22
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Yara Milbes
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
Paco van Beckhoven
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
Globus
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata
 

Recently uploaded (20)

May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptxTop Features to Include in Your Winzo Clone App for Business Growth (4).pptx
Top Features to Include in Your Winzo Clone App for Business Growth (4).pptx
 
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi ArabiaTop 7 Unique WhatsApp API Benefits | Saudi Arabia
Top 7 Unique WhatsApp API Benefits | Saudi Arabia
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024Cracking the code review at SpringIO 2024
Cracking the code review at SpringIO 2024
 
GlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote sessionGlobusWorld 2024 Opening Keynote session
GlobusWorld 2024 Opening Keynote session
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024OpenMetadata Community Meeting - 5th June 2024
OpenMetadata Community Meeting - 5th June 2024
 

Story of a Cerberus Bot

  • 1. Story Of a Cerberus Bot Andrea De Gaetano - @dega1999
  • 2. My Typical Work Day #Java #j2ee #j2se #spring #swing #maven #android #gradle #security
  • 3. After Work I play a lot with: #raspberrypi #arduino #esp8266 #iot #maker #nodejs #python #security http://pestohacks.blogspot.com
  • 4. What is a Cerberus Bot? Sharing my experience on bot development Talking about: • Early 2000’s bots • Why does bots matters? • Bots Models/Architectures • IndaqoBot: Telegram • Bot Software Stack • Firebase • Improvements • One Core , Multiple Heads: Facebook Messenger, Alexa? • …And google assistant?
  • 5. In the early 2000’s: IRC Bots - File Sharing - Guardians of Channels - AntiSpam - Ban unauthorized - Secretary - …
  • 7. 1st Impression Why Should I use a Text based interface instead a GUI?
  • 8. Alexa, had my attention
  • 9. Figuring out… My Idea was changing
  • 10. User Advantages Integration in known software: integrated in app or service known.. facebook messenger, skype, siri. Users already know them: No learning curve, they can rapidly start to talk with a bot with no need to learn a new user interface. No installation/space needed on the device: no need to install anything on their device. No need to upgrade.
  • 11. User Advantages Natural Interaction: everyone knows how to text and speak. Attractive also for old people. A perfect bot is hard to distinguish from a real person. Same uniform experience across devices/platforms
  • 12. Developer Advantages • Userbase Potential: part of a known app (like facebook messenger) improves the link between the real user and the owner of the bot. • Learn new data from users through continous interaction • One language for many platforms: web, web-mobile, desktop, mobile . • No need to bother with accounts,login, oauth, tecnologies problems and so on!
  • 13. Bots Models • Generative • Retrieval-Based • Pattern Based
  • 15. Retrieval Based Model • The chatbot uses the message and context of conversation for selecting the best response from a predefined list of bot messages. • The context can include current position in the dialog tree, all previous messages in the conversation, previously saved variables (e.g. username).
  • 16. Pattern Based Model • The bot have a list of the supported questions/ commands it support. • Easy. • Stupid. • Eg. Alexa Skills
  • 17. @IndaqoBot • Pattern based • 2 command supported: • brief • ready • work only with Telegram
  • 18. Start a new Telegram Bot
  • 20. Bot Stack Web Dyno: use node-telegram-bot-api talk with telegram server accept http requests: commands
  • 21. Bot Stack Web Worker Task scheduled every hour: • Send a broadcast message to registered users • Call Web Dyno to change mission
  • 22. Keep bot state across reboots Store Users Results: text and images* Never used before: easy Structure Data
  • 23.
  • 26. Storing user images Sad Solution: all images are converted to base64
  • 27. #code
  • 28. #code TODO Scalability Chat Injections Change Model Facebook Integration
  • 29. Road to Facebook Messenger integration •Tested another bot with a raspberry pi 3, duckdns.org and letsencrypt certificate. All free! :D •You need to register a new application on Facebook, generate a token and some other boring steps •If the server doesn’t answer for some time, Facebook disable the bot. •From the @IndaqoBot code, just 2 new endpoints: •one for the authentication between Facebook and the server •one to receive messages •Need Facebook approval to publish it
  • 32. Advices for a Cerberus Bot •Separate logic from presentation: endpoint code must be minimal •Create library for your code, reusable from any platform •Write Unit Test for your libraries •Use a storage solution to keep bot state, like firebase •Use constants •Use localization •Understand the limit of each bot platform: number of simultaneous messages, user interactions and so on •Be prepared to scale Fast!