Building a chatbot: a reference architecture

Author: Matthias De Scheerder, Team coach Enterprise Integration Solutions at LoQutus


At LoQutus, we want to guide organizations to become digital leaders. One of the important aspects of digital is engaging with customers in new ways. Enter the chatbot!

If done well, chatbots allow customers to engage in a natural way with your organisation. Accessible on any device and at any time, customers can be helped right away without having to call or email. Since chatbots are always online, it’s a straightforward way of enabling 24/7 support without human presence. For more information about the merits of a chatbot, we would like to point you to two of our blogs from earlier this year:

In this blogpost we discuss the basics needed to build a chatbot.

Responsibilities of a chatbot

A chatbot has to properly engage with the customer to bring value to the customer:

  • A chatbot UI [User Interface – Ed.] needs to be accessible and intuitive. Customers will not feel attracted to engage with a clunky, unattractive UI – instead they will look elsewhere for a better customer experience.
  • The chatbot must understand the customer – be it text or voice input. This goes beyond knowing the meaning of individual words, the system must actually understand and interpret the full context of the sentences in order to extract meaning from them.
  • The chatbot must be able to give an appropriate answer, by fetching information from the right company resources, possibly searching and combining information across different resources and maybe even the Internet.
  • The chatbot must offer human-like answers. Instead of chucking out raw data in a direct way, phrasing answers in a natural way offers the customer a more satisfying experience.
  • The chatbot must keep track of the context. The customer is engaging in a conversation, and the history of this conversation is important.

Consider the following examples and ask yourself which bot offers a more natural, customer-friendly conversation experience:

LeftBot: “Hi, how can I help you?”RightBot: “Hi, how can I help you?”
Customer: “What are your opening hours on Tuesday?”Customer: “When are you open on Tuesday?”
Lb: “On Tuesdays, we’re open from 9AM to 5PM”Rb: “On Tuesdays, we’re open from 9AM to 5PM”
Cu: “And on Wednesday?”Cu: “And on Wednesday?”
Lb: “I don’t understand your question”Rb: “From 9AM to 6PM”
Cu: “What are your opening hours on Wednesday?”
Lb: “On Wednesdays, we’re opened from 9AM to 6PM.”

The differences might be subtle, but where Leftbot loses track of the conversational context, Rightbot remembers what was previously asked and thus offers the customer a much more fluid, even human-like way of interacting.

Functional components

So, now that we’ve listed a number of responsibilities of the bot, we can translate these to functional components. They represent the building blocks within your chatbot architecture.

Accessible, intuitive UI

IntuitiveYou need a good looking, attractive and responsive UI. An optional voice interface could be an extension.
You could choose to develop a chatbot front-end yourself, or you can use one of the readily available front-ends. Using an off-the-shelf front-end you’ll get started more quickly, but there may be limits in customization and look & feel. Either way, this is a very important building block as it is the only component visible for the end-user, and as such a direct representation of your brand.

Customer understanding

UnderstandingA bit more complex, the module responsible for ‘understanding’ has a few different tasks.
First of all, it tries to identify intent, i.e. what the customer is trying to do.
Secondly, it tries to extract entities, i.e. subjects the customer is talking about which provide more information about the intent.
Thirdly, it uses the conversation context in order to track what’s been said.
Last but not least, it learns. Training this module to become better at matching intents and entities is vital and will greatly improve the range of situations your chatbot is able to handle. Putting these things together, your chatbot will be able to identify exactly what the customer has asked, and it will become even better at it over time.

Data retrieval

RetrievalOnce your bot has a proper understanding of what’s being asked, it can now orchestrate the necessary calls to find and retrieve the correct data in the organization’s resources. There are several ways to accomplish this:



  • Hard-coded data to answer predefined questions
  • Searching in datasets that are updated from time to time
  • Using web-service or database calls
  • Reaching out to cloud-based resources

This is highly dependent on the specific use cases and environments, and it is up to the chatbot architect to think about the best way of getting the data in timely fashion.

Response generation

ResponseFor each set of envisioned questions, there should be a set of plausible responses. A chatbot that gives the exact same answer every time is not as pleasing to interact with as one that can diversify its answers. Therefore the chatbot designer has to come up with several good alternative answers for each question. Going one step further, the responses can even be influenced by the detected mood of the customer.


Conversation and context

ContextThis component can be programmed with conversation flows matching the purpose of the bot. This way it can track and update context and provide a meaningful and natural way to engage in a conversation with the customer. Without this component, the bot would revert to zero-state after each question.
The definition of conversation flows can be closely tied to the ‘customer understanding’ module responsible for matching intent.


Wrapping it up

Tying it all together, we end up with the following reference architecture for a typical chatbot:

Chatbot Reference Architecture

Note that the details and design will differ from bot to bot, depending on:

  • your specific needs and organisation resources
  • the interfaces offered by the specific packages and tools you choose as implementation for the logical parts
  • the combination of two or more of the logical parts into one platform or tool

The bottom line is that the above diagram can serve as a starting point, and can get you started with brainstorming about your own bot.

That wraps it up for this blog. We hope it has given you some inspiration and ideas. If you want to know how LoQutus can help you build your bot, feel free to contact us using the contact form below.

Get in touch to see how we can help you build your chatbot

Written by Matthias De Scheerder, Team Coach Enterprise Integration Solutions at LoQutus.