We always aim to “educate” aspiring chatbot developers about the software challenges of building and running a good chatbot. Today we want to go a bit further and give you a behind-the-scenes look at all the languages, libraries and frameworks that must play together to run a chatbot.
The core chatbot logic
The core elements of the ecommerce bot (the intents, training sentences and business logic to execute for every matched intent) are implemented with our Java Fluent API that wraps a set of EMF-based core classes modeling our chatbot specification primitives and the help of Lombok to simplify the writing of the bot specification.
The NLP Engine
To determine which chatbot intent is the best match for the user textual input, we rely on nlp.js (in JS) though we are in the process of moving to our new Python NLP server for better optimization of the needs of eCommerce conversations. A preprocessor language model is also used to improve the chances of a matching.
The eCommerce chatbot is implemented as a WordPress plugin in PHP whose mission is to simply embed in the proper PHP WP pages the Xatkit widget displaying the bot. The widget itself is a react component that talks with the server component managing the core chatbot logic via a websocket.
The configuration and monitoring component
Any non-trivial bot comes with a dashboard to configure the bot (e.g. removing some predefined conversations, adding new ones, …) and monitor its results, showing, for instance, the user questions the bot was unable to understand.
All in all, chatbots are indeed a complex piece of engineering
Take a look at all the links above. We have 5 major programming languages (together with their package managers: maven, npm,…). 7 if we count HTML and CSS. Plus a myriad of auxiliary libraries and frameworks that require specialized knowledge, e.g. knowing Java doesn’t mean you can master Spring in a breeze. Or even less that you would be able to create Java Fluent APIs.
If you don’t have the luxury of having a large team with specialized profiles, maybe it’s time to start testing all these intelligent code assistants. And I’m only half-joking.
Definitely, I feel we need better software engineering tools that help manage the complexity of these type of multi-language projects and their dependencies. For instance, we have (a few) tools for reverse engineering large codebases written in one language and help you understand and evolve it. But I don’t know any that can do the same with a number of different repositories (we have over 80, including private ones, in Xatkit !) in a mix of languages where the dependencies between the components are not as “easy” as looking for imports or references in the package manager definition.
While we wait for these tools to pop up, any tech question on the internals of Xatkit you’d like to know? And if you want to read more about the technologies we have listed above, this twitter thread gives some pointers to good tutorials for them:
Interesting overview of the tech stack at @xatkit. For sure I didn't know what I was signing for when we started the project 😅 It has been a blast though, and an amazing learning opportunity! Some links to the documentation/tutorials I used in this journey below 👇 https://t.co/5gkLOxJB2O
— Gwendal Daniel (@g__daniel) July 7, 2022