How to Build a Contextual AI Assistant
Creating your first conversational AI project can seem daunting. But it doesn’t have to be. In this eight part guide, we’ll cover the process of building a contextual assistant from idea all the way to production. Each post focuses on an important aspect of building sophisticated contextual assistants. At the end of this guide, we will have learned everything we need to build truly contextual assistants!
Part 1: What are contextual assistants?
Part 2: How to create a minimum viable assistant
I. What are contextual assistants?
Contextual assistants not only handle questions and execute tasks, they also engage in flexible back and forth dialogue—and that can be a hard problem to solve. Building contextual assistants requires machine learning, engineering best practices, powerful tools, and data in the form of valuable user conversations.
But, building production-ready contextual assistants doesn’t mean you have to build everything from scratch. In this series, we’ll learn how to go from proof of concept to production and create enterprise-grade contextual assistants. In the first post of this series, we’ll talk about what contextual assistants are and the components needed to build them.
Conversational AI Architecture Layers
Not all chatbots use machine learning. There are simple bots that can handle basic FAQs without being able to answer a follow up question or process contextual information. Then, there are sophisticated contextual assistants that are able to efficiently handle important enterprise functions such as supply chain optimization, customer service use cases, back office processes and more. At Rasa, we believe there are 5 levels of contextual assistants that can be defined by their capabilities.
In machine learning, context can mean a lot of things. When we say ‘context’ or refer to contextual assistants, we’re talking about the ability to understand the relevance of previous messages to accomplish user goals as gracefully and as efficiently as possible.
Understanding context is key to taking the right action based on the situation, dealing with ambiguous user input, user interjections, chitchat, and other potential ways a conversation can deviate from a linear path. Contextual assistants also leverage business rules and other conditional logic to respond to users or execute tasks on their behalf. We’ll talk about these concepts in detail soon.
Every conversational AI application, regardless of its sophistication level, is made of several distinct layers:
- The computation layer
- The conversational AI infrastructure layer
- The tools and services layer
- The application layer
The computation layer is the foundational layer on top of which the other layers sit. Machine learning-friendly programming languages like Python and Julia, and machine learning frameworks like TensorFlow, PyTorch, and spaCy make up the computation layer.
The conversational AI infrastructure layer is one abstraction layer above the computation layer. Rasa Open Source is the standard infrastructure layer that provides the building blocks you need to create contextual assistants. Just like how you don’t write your own programming language, you don’t have to build your own conversational AI infrastructure components. An open source framework like Rasa is the middle ground between building everything yourself or using a SaaS framework that you can’t customize to your use case and training data.
The tools or services layer sits on top of the infrastructure layer. With Rasa Open Source, you can build an MVP assistant that can hold conversations and execute certain tasks. The next step is to test and improve your assistant. Tools help you do that. Rasa Enterprise is a toolset that allows you to collect, visualize, and review user conversations.
The application layer is where your AI assistant lives. It can live alongside other systems and web applications. For example, an enterprise’s payroll, HR, and IT systems live here. Depending on your AI assistant’s use case, it might interact with one or more of these systems. Applications at this layer also have user interfaces that your users will actually see and interact with.
How to get started with building a contextual assistant
So, you’ve decided to build a contextual assistant. What next? You probably want to learn how to set it up, create a minimum viable assistant, or an assistant that can handle most happy paths. You may also want to do interesting things like handle multiple intents, call an API, or fail gracefully. In the next post, we’ll talk about how to create a minimum viable assistant.