Using RASA to build an email-bot - in general about email-bots dialog management

I submit a general question about how to build bots running through a email channel. Specifically, about how to find solutions using RASA.

1. Tech of emails gateway server

Sending and receiving mail automation appears a “not difficult” gateway task. Need a gateway server that receive mails via IMAP and call RASA REST API, answering back RASA Core answers, sending back to user a mail via SMTP.

BTW, Let me know is someone already shared an email gateway to interface RASA or any other conversational engine.

Anyway that is the least of the problems.

2. Dialog management with email messages

Here the hard section. Let’s escape the usual chat paradigm where a bot and a person exchange small talks with a back and forward made by few words / often just a single sentence, possibly in short elapsed time (seconds/minutes). In this scenario I guess the chat topics are pretty “contextualized” in the chat sequences of near turns. Chatting could be see as a “synchronous messaging”.

On the other hand, let’s think to a different scenario where conversation happens just via email-exchanges. BTW, My vertical application concerns an academic research in educational realms, about using a “tutorbot” to let students to ask questions to a tutor bot about contents of a course or everything related to the course, examinations, etc.

In this scenario the user send an email to the bot, as the recipient were a real human teacher (maybe the student is unaware if the mail recipient is a real human tutor or a bot. TBD/partially irrelevant).

The point is that within an usual email communication between people, users “collect” in a single text (the letter) maybe more than a single topic (say “intent” in our parlance) that are maybe unrelated each other (simple), or maybe there is a dependence among them (hard!). The need of this “collection” of questions/topics is because the email is an asynchronous communication channel, so between people email exchange, is normal to collect in a single message a bunch of topics. BTW; I call the email a “asynchronous messaging”.

My open question:

How to manage email exchanges, From the conversation experience design, with RASA technology, and in general with an intent-based dialog management system?

My first idea is to tokenize the input text in multiple sentences, blindly processing them though RASA NLU, as a sequence of intents. one by one. The bot answer will be trivially produce the NLG text just concatenating answers of above mentioned intents.

Example of user incoming mail:

Hi Mr. tutor,

I’m very interested in topic X mentioned in video Y. Can I have more study material? Maybe some papers about it? BTW, what’s examination next session date?

Thanks & regards giorgio

The tutor bot answer could be a concatenation of intents-answers, without any memory/correlation among answers. That’s maybe can work for simple cases. See this answer:

Hi Giorgio,

I’m glad you are interested in topic X. You were right to watch video about Y. That’s coherent with your study programme! I also suggest these papers: Z, W.

The next examination date is to be decided yet. I’ll inform you via email!


The teacher

In terms of RASA intents the input mail could be:

intent greet
intent interest_on
intent interest_more_info
intent next_exam

In terms of RASA answers the output mail could be:


So far it seems simple… but what if input sentences are much or less related each other?

Rasa Core stories, as a prediction of sequences of intents, of the input mail, seems in theory a winner solution, but is not fully clear to me how to implement the use of stories in application code.

Can you help me understand in practice how to possibly use RASA stories in this email context? I mean: How could use RASA core to predict the next intent/answer, given previous intents detection? Can you give me a code example? (I’m not a RASA/python nerd)

Thanks giorgio