Mycotina
Mycotina

Reputation: 521

How to Implement Chatbot at Scale

I have a project where I need to implement a chatbot. Due to the requirement I can't use existing chatbot services and need to create one from scratch.

The simplest idea that I can think of is to have a server side client which act as the bot (probably impelemented in smack) which will connect to an xmpp server (probably ejabberd). This bot will then forward the messages it received to some NLP services to generate a response before sending it back to the message sender.

On the other hand, the chatbot users will have client implemented in their mobile devices and all of them will communicate to the bot's JID.

But then I am thinking about scalability of the server side's client. How can I achieve horizontal scaling? I'm thinking of binding multiple resources on the JID of the server side bot, with each resource representing one server instance. The user then will randomly choose one of them during the start of the application. But that sounds like a hack, it will need a client update every time the number of instance changed, doesn't sounds nice to me.

Any insights are appreciated. Thanks.

Upvotes: 0

Views: 64

Answers (1)

sheldon
sheldon

Reputation: 74

You can take a look at https://github.com/igniterealtime/openfire-llama-plugin. This adds chatbot to Openfire server.

Horizontal scaling is handled by the hazelcast plugin https://github.com/igniterealtime/openfire-hazelcast-plugin.

You would install and configure both Hazelcast plugin and Llama plugin on all Openfire servers.

Upvotes: 0

Related Questions