Skip to main content

Build and Implement Your Bot

Learning Objectives

After completing this unit, you’ll be able to:

  • Create your deployment timeline.
  • Define bot conversations.
  • Map flows and states within the bot.
  • Build your bot.

Create Your Deployment Timeline

Now that you’ve identified what your bot will do and who will bring it to life, it’s time to create a timeline so you and the team can see when you need to complete each step of the process. Successful bots take time and resources to put together, and creating a timeline can help you decide how to best allocate them. 

Harryette stands beside her calendar

As Harryette Randall defines her timing expectations for the deployment of Bloomington Bot, she asks herself a few high-level questions.

  • When do we want to launch the bot?

Bloomington Caregivers tends to see a spike in new patients around the peak of flu season. Harryette and her supervisors hope to have their bot up and running by then, so the team chooses a target launch date in the fall.

  • Which steps must be phased (done in a particular order)?

Here are the phased steps: First, she needs to pitch the idea to her supervisors for approval. Then, she needs to put together a budget and onboard the team members she identified in the last unit. After she has these dependencies sorted out, she can begin delegating tasks and planning out how long each phase of the project will take. 

  • Which steps can be done at the same time?

While Harryette’s supervisors take the time they need to approve her proposed budget, she schedules meetings with customer support agents to better understand which conversations the bot will eventually handle. When it comes time to build the bot, she plans to incorporate live feedback from her subject matter expert—in this case, a customer service agent—as she populates the bot content. 

  • How will I get the data needed for my bot?

Because Bloomington Caregivers uses Salesforce Health Cloud, Harryette knows exactly where to find her data. She understands that admins like herself sometimes need to use Salesforce tools and languages to automate processes and access data, so she bookmarks the Flow and Apex trails in case she needs to brush up on these skills when it comes time to make use of data within her bot. 

After making these high-level decisions, Harryette sets deadlines for each task and shares her timeline with the key stakeholders involved in the project. With a high-level game plan to guide her project, she’s ready to roll up her sleeves and bring her bot to life.

Define Conversations for Top Use Cases

Harryette has identified her bot’s use cases. She’s talked to customer support agents to confirm these use cases and gather conversational insights. And she’s created her timeline. She now has nearly everything she needs to start building her bot.

Before anyone on her team writes copy for the bot, though, Harryette wants to ensure that the bot speaks with a cohesive voice and tone—with a personality that reflects the Bloomington Caregivers brand. And she knows just the place to start: marketing. Luckily for her, the marketing department has already developed voice and tone guidelines for all of the company’s content, which now includes chatbot conversations. 

She shares these guidelines with her team and introduces them to the Conversation Design Trailhead module to get them acquainted with best practices. Together, they draft conversation paths for each topic their customers might want to explore. For each topic, they map out a “happy path,” a conversation flow that results in a pleasant experience for the customer, whether that’s resolving the issue within the chat or getting redirected to a better resource.

Map Flows and States, and Identify Key Dialogs

Within each conversation, Harryette identifies different bot subprocesses, which effectively become dialogs after they are implemented in the bot. Dialogs are conversation snippets that control what a bot can do. 

Dialogs can look like a bot introduction, main menu, transfer to agent, customer identification, and other recurring topics that can be compartmentalized and reused. To maximize the effectiveness of her bot, Harryette puts extra thought into choosing which dialog should be prompted when. 

To organize these subprocesses, she maps the relationships between them. She does this by asking herself whether a pair or group of processes are encapsulated, connected, or independent.  

  • Encapsulated subprocesses are part of a larger process.
  • Connected subprocesses are related to but not dependent on each other.
  • Independent subprocesses are not related to each other in any way.

Screenshot of a dialog map inside the Bot Builder

Using this framework, Harryette looks for which processes are used in multiple places. That way, she can build repeated processes into discrete dialogs that can be reused in conversation. Eventually, she plans to build every process into a dialog. 

As Harryette maps out these relationships for all her top use cases, her conversation map begins to fill out with processes across the bot. It becomes her go-to resource for conversation design, as it helps her visualize how all the subprocesses come together to create a cohesive customer experience. 

Identify and Build Bot Entities and Variables

By designing the conversation flows, Harryette has laid the foundation for her bot. Now, she sets her sights on the details. 

To get acquainted with bot-building terminology, she reviews a couple of Salesforce key terms.

Terminology 

Description

Entity

An entity is a type of data that you want to collect from a customer. Salesforce provides the following system entities: Text, DateTime, Date, Money, Number, Person, Location, Organization, Percent, Boolean, and Object (standard Salesforce or custom). You can create custom entities as needed.

Variable

A variable is a container that stores a specific piece of data collected from a customer. 


When collecting user information through Einstein Bots, you must associate each variable with an entity. This is because our bots use Named Entity Recognition to capture only the relevant portion of a chat visitor's answer, the entity, in order to save the right information and keep your Salesforce transcripts and data clean.


Since variables are containers of information, you can use them within dialog actions as both inputs and outputs and insert them as text in messages.

Harryette quickly sees that variables like a customer’s ID number or case number make it possible to build internal bot functions like object search, which require the right variables to look up records. 

In order to unlock full functionality within the bot, Harryette creates her variables in both Flow and the Bot Builder and makes sure they match up. Well-defined variables are a prerequisite for actions that require Flow or Apex, such as updating a user record or creating a case, so Harryette keeps all of her desired processes in mind when assigning variables. Whenever she’s unsure how to accomplish what she wants, she turns to the Flow Elements help doc for more information. 

How to Implement Natural Language Processing

Harryette has heard a lot about the importance of NLP for enabling artificial intelligence in a chatbot. After meeting with her team, Harryette decides to save NLP functionality for phase two of the bot launch, when they will evaluate whether they need to expand beyond the menu-based capabilities to meet customer needs. 

In preparation for phase two, she gathers all the steps and resources necessary to implement NLP. She remembers from her preliminary research that NLP is built from intent models that teach the bot which utterances (user inputs) correspond to which intents (requests). These intents are mapped to the appropriate dialogs, which is what the user sees in response to their queries.  

She learns from the Bot Builder that Einstein Bots require three to five intents and a minimum of 20 utterances per intent to get started—but more improves accuracy. Further exploring best practices, she learns that intents should be roughly balanced in the number of utterances tied to them, so they don’t skew the model in any particular direction. For the same reason, each utterance should be unique and have some variation in word length. 

That’s all great to know, but where does she get the utterances for her intent model? After some poking around on Salesforce, Harryette writes down these ways to source her utterances.

  • Crowdsourcing from customer service data
  • Enabling Input Recommender in the Bot Builder
  • Downloading intent sets from the AppExchange
  • Using data from the Template Bot intent set

To build her bot with NLP in phase two, Harryette must first get her utterances and intents in order. Then, after the data is uploaded to the bot, Harryette can begin building and training the intent model. Inside the Bot Builder, she can start this process in Bot Training, where she can view data from up to seven days ago, verify classifications, and later rebuild the model with new data. 

The bot will likely only be able to identify exact matches at first, but it can learn from its mistakes and improve with more experience and data. After the NLP-enabled bot launches, Harryette plans to check up on its performance in the Model Management tab twice a month.

Resources

Keep learning for
free!
Sign up for an account to continue.
What’s in it for you?
  • Get personalized recommendations for your career goals
  • Practice your skills with hands-on challenges and quizzes
  • Track and share your progress with employers
  • Connect to mentorship and career opportunities