neomatrix369 / chatbot-conversations

Chatbot conversations: a demo application how two (or more) chatbots can talk to each other, the logic used to build Eliza (along with an NLP model) has been used to power the chatbots.
Apache License 2.0
35 stars 12 forks source link

Introduce queues to improve inter-bot communications #18

Open neomatrix369 opened 2 years ago

neomatrix369 commented 2 years ago

As the project started off as a demo project, inter-chatbot communications are not the most optimum.

Also if we would like to introduce a frontend via #17 then the interactions would be best handled by a queue.

Spikes and prototypes to come up with a queue would be a great start, some examples of queues could be:

Although for all intent and purpose of this project a simple queueing library is more than enough - a simple approach is a good start.

yugoccp commented 2 years ago

Hi @neomatrix369! Wish to have clearer idea about this issue.

Thought the simplest architecture to satisfy most of the current features:

Screen Shot 2022-05-05 at 00 37 45
  1. Chatbot produces message to message.post queue
  2. Mediator consumes message from message.post queue
  3. Mediator wait 4 sec, log message and post to message.display queue
  4. Chatbot consumes messages from message.display queue

Mediator have some control over the conversation, such as wainting 4 sec to display next question and log messages

Drawbacks:

neomatrix369 commented 2 years ago

Nice idea, let's think about it while also taking a couple of steps back and do the following:

Let's do a spike first and then move to a complete solution driven by tests