Skip to main content

Introduction

warning

This documentation page is still being written.

Co is a framework for building conversational bots implemented in colang. It provides generic components that provide out-of-the-box behavior, and can be included in any bot.

Design Philosophy

Co takes a symmetrical approach to modeling the interaction between the user and the bot i.e. they both use a simplified common language to communicate. Below is an example of how a simple conversation could unfold:

user greeting
bot greeting

bot ask name
user inform name
bot express nice meeting you

user request appointment
bot ask best period
user inform datetime
bot inform time slot available
bot inform appointment confirmed

user express thank you
bot express you are welcome

From this perspective, the NLU layer of the bot is translating from natural language to the common language, and the NLG layer of the bot is translating from the common language back to natural language.

Common Language

Broadly speaking, there are five categories of sentences in the common language:

  1. ask: to ask information from the other party e.g. ask name.
  2. inform: to provide information to the other party e.g. inform name.
  3. request: to request the other party to do something e.g. request appointment.
  4. express: to express feeling or opinion about something e.g. express thank you.
  5. comment: anything else e.g. comment about politics.

Multiple sentences in the common language can be separated by "and":

user inform datetime
bot express apologies and inform time slot unavailable

Why The Common Language?

Let's think about the end goal for a moment. A bot capable of having human like conversations with a customer on hundreds, potentially thousands of scenarios. This bot would need to understand thousands of intents. How can we organize these intents? One way to do it,

How to build reusable components?

How to make the NLU approach scale? Depending on the scenario, as soon as we're training ML models with hundreds of intents, we start to see confusion because of the overlap between the intents. It will get significantly harder for a model to distinguish "flat" between intents. Another, more scalable approach, is to not intents as completely distinct, but rather as a hierarchy. Or even better, to see them simply as a sequence of tokens. Seq2Seq models have proven that they can learn to translate very accurately from one language to another.

At this point, the vocabulary of the common language used by Co is not standardized. It follows a set of conventions. In a future version, in order to enable better re-usability, a specific set of words will be standardized.

bot "Ok. To find the right sneakers, I'm going to run you through 3 simple questions"
bot "For most people, this only takes a minute"
bot "Read. Set. Go?"

$goal = "find sneakers"

bot acknowledge and confirm goal and inform next steps
bot inform time expectation
bot ask start confirmation