Creating a Bot from Scratch vs Using a Bot Platform

The Bot Value Chain by Jean-Marc Ly

With the rise of bots, software designed to automate tasks (making a reservation, purchasing a product, distributing content, providing customer service or sending coupons), there is a degree of development knowledge needed to create intelligent, robust and scalable bots. By nature, bots are applications that live on top of existing communication channels that take advantage of their interface UI and adds NLU (Natural Language Understanding) to facilitate communication between the software and an individual.

Bot development differs from app development is many ways. Apps require proper planning, a specific designer for UX flow and platform specific building blocks. Bots on the other hand offer a more streamlined and linear execution. However, building a bot isn’t as simple as it looks. Let’s take a look at how bot development is done today and a new emerging development method.

Building a Bot from Scratch Today

Bots rely on several preparation steps to ensure a good working bot. You need to prepare the conversational script as part of your bot spec, the bot architecture and your development environment.

Spec & Conversational Script

The conversational script acts as use case of actual user conversation. Because most bots interact with users via a chat interface, the bot must guide the user toward the answer or task. The content of the script creates a context that relies on user behavior and add-on NLU (Natural Language Understanding).

System Environment & Configuration

Next you need to create the architecture and engineering design of the bot. You need to create both the back-end and front-end ranging from setting up the servers to the front-end conversational interface, user action and any computation needed. A developer will typically need to spin up their own servers, build, deploy and manually wire up the corresponding SDKs, incorporate NLU (Natural Language Understanding), fiddle with platform specific API, manage hosting and preparation of deployment package including processing of dependencies, test and deploy. These steps usually takes developers a bit to set up since there are many connecting interfaces, services, plugins and configurations. Will you manually host it yourself, use Amazon AWS (which requires configurations) or another service? Will you create a management interface to monitor your resource spent and key-value storage of your conversation history?

Bot Development

With your system configuration all set, you can now start building your bot. Use your conversational script to create a working bot while testing it to make sure it responds well and to check for any errors. This step is very straightforward as your spec guidelines gives you the skeleton of the bot.

Deployment

Once you are satisfied with your bot, it is time to deploy it to your hosted environment. You need a stable hosting environment where the bot will reside that allows you enough flexibility to expand your hosting and monitor your bot/resource usage.

 

Publish to Messaging Channels

To get people to use your bot, you need to distribute it. Publishing your bot to various messaging platform such as Facebook Messenger or Viber gives people a chance to discover and interact with it. Platforms such as Facebook Messenger have a bot store where people can try out different bots. If you have a specific Facebook Page for your bot, you will need to integrate a token key.

The one key drawback when building your own bot is that you will need to set up a hosting environment for the same bot for a different messaging platform. For example, your first bot gets published to Facebook Messenger, you have to re-create the environment AND bot so you can add it to another channel such as Slack or Viber. Each bot lives in its own hosting environment and it is your job as the developer to monitor and manage each environment, conversations, figure out integrations and storing conversational data and so forth.

Ideally, you have built tracking and conversation monitoring into each of the bots. In order to improve the response of these bots, you have to take a look at how users interact with it. By examining potential scripts, you can add them into your bot via an update to the publishing channel.

The Entire Process Looks Like This:

Bot Spec & Script -> System Configuration and Hosting Environment -> Bot Development (coding the bot) -> Testing -> Deployment -> Publishing -> Monitor & Analyze -> Update

Now while the step process looks simple, there are hidden struggles within. Jake Bennett, CTO at Seattle-based agency POP, tried creating a serverless app using AWS Lambda. So even if you don’t host your own application, it isn’t as easy as it seems. He details his struggles in a Venture Beat article, What I learned Building Serverless Apps.

His main challenges was the time spent prior to building the application. It was the time spent configuring, creating and setting up the Lambda functions:

Configuration takes significant amount of time
To develop an app, Jake had to configure the environment for uploading the code, configuring the Lambda function, creating the API endpoint, setting up the IAM security role for the function, configuring the behavior of the HTTP request, configuring the behavior of the HTTP response, creating the staging endpoint, and deploying the API.

This time should be factored in when estimating the project completion time since Lambda functions are nano-services (same if you use other services such as Azure) .

Documentation is sparse so researching is needed
The biggest challenge for Jake was figuring out how to solve problems popping up as the lack of documentation made for wasted time spent researching issues. “Error messages are often cryptic and the number of configuration options is large, making diagnosis time-consuming. Making matters worse, documentation and community support is still immature, so there isn’t a huge corpus of community knowledge to draw from.”

How to balance between tight cohesion and loose coupling in structuring the app
Before the adoption of serverless architecture, functions were thought to exist in a larger cohesive application with shared memory and a call stack. However, there is a lacks of architecture design patterns for serverless applications. “With AWS Lambda, you are literally deploying a single function, outside the context of a larger application. So how do you live without the things we take for granted every day like shared functions and common configuration settings?”

Will you impose every function as a Lambda and create tons of configuration thus affecting performance (since every function invocation will be out-of-process call) or deploy a single Lambda function that acts as a controller for the entire application (you have to oversee the controller function in order to keep it efficient and manageable). Depending on your application, you may need a mix of the two but time spent on architecture can be costly and long.

So if we go back to the process map, even with serverless hosting, you can see how it could take a developer some time to build the bot from end-to-end.

Bot Spec & Script -> Lamdba and API gateway configuration, Hosting Architecture -> Bot Development (coding the bot) -> Testing -> Deployment -> Publishing -> Monitor & Analyze -> Update

Where Bot-as-a-Service comes into the value chain

As the advent popularity of bots, bot platforms are starting to spring up to make development workflow streamlined and simple. There are many kind of bot platform ranging from development tools, infrastructure setup, development frameworks to deployment and publishing platforms. What all these services and products offer is to take the pain from the setup, configuration, building and deployment steps so any user can publish a bot into a messaging platform as soon as possible.

Why a Bot Platform Saves Time

The innovator’s dilemma is searching for new approaches to past problems. How can we optimize the current approach in order to shorten the time and gap so distribution of knowledge and resources can better reach the intended audience? The platform approach takes the optimization level and redefines it into solving the same problem by a new solution (it’s a paradox in itself). A bot platform enables creation of more bot inventory (in the market) without using and wasting more resources (time, manpower, computer processes). The logical thinking is that if we empower and permit developers to build faster and more efficiently; more quality bots will be available on the market and thus letting more people use better bots (increasing developer interest and starting the cycle over).

Our platform, Recime is an end-to-end bot development platform. We encompass a generalized platform that anyone can use to build their custom bot solution and deploy it across various channels. We are the founding blocks to build your fundamental processes such as the bot building framework, the serverless infrastructure, the building and testing environment and deployment method.

Using our platform Jake Bennett would be able to skip the pain points of configuring and setting up his infrastructure and system architecture while cutting down on the deployment time with our custom CLI.

The new value chain is shortened and more streamlined. We handle the infrastructure and system architecture setup (using Lambda functions and Cloud Formations) while providing both a framework and platform for deployment and publishing.

Are all platforms equal?

Bot platforms are not all equal. There are many areas in the value chain where efficiency is needed and many platform tackle one area for improvement. There are platforms for pre-development, mid-development and post-development. The beauty is that the value chain is big enough for everyone to thrive. However for the developer, that means integrating multiple platforms and spending time to make sure all systems can talk to each other. They are in a sense, system integrators rather than platforms. This step can be frustrating and time consuming. Do the different platforms integrate? Do I need to know different languages to use them? What about the different pricing models for each system integrator?

Our mission is create a true platform. A platform which can be used by both the developer AND the system integrator. A developer who needs an end-to-end solution in building enterprise grade bots to a bot marketing platform building marketing bots for enterprises. Both these individuals can use Recime as their bot development platform or bot development environment. Recime offers a generalized platform for anyone to use and offers custom bot development for Fortune 500 brands. The platform is the basis for any bots regardless of how complex it is. We’ve offering a solution like no other, build a bot faster, better and future-proof.

Productivity & Scale

The biggest benefit in using a bot platform is the increased productivity of your development team and increase scalability of your bot. Not only do we power your process and hosting, we help you improve and scale your bot. A typical developer using Recime has this type of workflow:

Looking at the original process flow, we have shorten it to:

Specs & Conversation script -> Create Recime Account and download CLI -> Bot Development (in the most popular language in the world = more developer adoption) -> Testing, optimizing, deployment on Recime (same terminal, no need to use additional software) -> Publish across DIFFERENT messaging platforms.

Cross-Platform

Cross-platform refers to your bot’s ability to be deployed across different messaging platform. This is possible using a single code base (hence crossing to different platforms). Cross-platform is not only a huge time saver (recreating development environment, bot, testing, deployment) but allows for quicker go-to-market possibilities. You can launch your bot across the different channels your customers are using and letting them choose how they would want to interact with you.

Conversations happen across many channels; Facebook Messenger, Slack, WeChat, etc. Why limit yourself to one subset of your users when you can maximize your impact and reach millions more. Developing on a platform that enables cross-platform deployment saves you time, effort and resources. Most people launch mobiles apps on both the Apple App Store and the Google Play Store. Why is it not the same for bots?

We have built connectors for the world’s most popular messaging platforms. One bot deployed to all messaging channels powering any conversations you can think of. It’s all unified and aligned.

As a developer, you simply reuse your code . There is no need to develop additional bots since the logic remains the same.

Messaging Platforms Are Welcoming Bots with Open Arms

Facebook announced Discovery Tab in Messenger where people can browse and find bots, nearby places and businesses to message. As a developer, Discover allows you to showcase your messaging bot to the more than 1.2 billion people who use Messenger each month.

More and more people rely on messaging apps to communicate with their peers and with businesses. To stay competitive, big brands such as Sephora have created bots to bring new businesses to their shops. Viber and Telegram have a developer hub to help developers create bots on their platform. More are opening their platform for developers to express themselves via bots. Bots are represented as accounts and thus giving the “feeling” of communicating with someone, whether that someone is a computer AI or not.

According to statista.com, the world is nearing 2 billion active users on instant-messaging applications. That is more than people who have social media profiles. Brands cannot ignore the power of messaging apps any longer. In fact it presents new business opportunities.

Customers can be acquired through messaging channels via bots who can aid in making purchases. Amazon had the same idea when they allowed users to make purchase using Alexa (technically a voice powered bot).

https://www.statista.com/statistics/258749/most-popular-global-mobile-messenger-apps/

The Future Development of Bots

Bot Platform-as-a-Service is allowing companies to add bots as part of their marketing strategy. This new paradigm shift in creating communication channels powered by AI will drive future consumer interaction. From shopping to customer service, the world will be powered by bots (it is already happening). Bots provide an expected response from consumers (it is easier to predict the conversation flow) and data insights on what consumers are searching for. This predictive data can give you an edge over competitors. Some of the biggest brands in the world are already using bots. Are you?

 ——

Recime.io is a enterprise bot development platform. With Recime you can build cross-platform bots at fraction of the time and cost. It is free for personal and open-source bots and royalty free. If you have a bot that is solving a problem, helping the community, you are hitting scaling issues, or want to go cross-channel with a single codebase then we would love to hear from you!

This post first appeared on Medium

 

You may also like