LARGE LANGUAGE MODEL HANDLING OUT-OF-SCOPE AND OUT-OF-DOMAIN DETECTION FOR DIGITAL ASSISTANT

Techniques for using a LLM to detect OOS and OOD utterances. In one aspect, a method includes routing an utterance to a skill bot. The skill bot is configured to execute an action for completing a task associated with the utterance, and a workflow associated with the action includes a GenAI component state configured to facilitate completion of at least part of the task. The method further includes inputting a prompt into a GenAI model for processing. The prompt includes the utterance and scope-related elements that teach the GenAI model to output an invalid input variable when the utterance is OOS or OOD. When the GenAI model determines the utterance is OOS or OOD as part of the processing, the response is generated to include the invalid input variable, and the GenAI component state is caused to transition to a different state or workflow based on the response.

FIELD

The present disclosure relates generally to artificial intelligence techniques, and more particularly, to techniques for using a large language model (LLM) to detect out-of-scope (OOS) and out-of-domain (OOD) utterances input into a digital assistant.

BACKGROUND

Artificial intelligence (AI) has a multitude of applications, and one example is its use in instant messaging or chat platforms to provide instant responses. Organizations leverage these platforms to engage with customers in real-time conversations, but hiring human service agents for this purpose can be prohibitively expensive. To address this, chatbots-automated programs designed to simulate human conversation—have been developed, particularly for internet use. These chatbots can be integrated into existing messaging apps that users are already familiar with. Initially, the chatbots were simple programs designed to simulate conversation with users through text-based interactions, often following predefined scripts with limited capabilities. These early chatbots were primarily used for basic customer service tasks, such as answering frequently asked questions or providing information about products and services.

The evolution of chatbots into more sophisticated chatbot systems such as digital assistants have been driven by advancements in AI and the growing need for more sophisticated and interactive user experiences. More specifically, as AI technologies, particularly Natural Language Processing (NLP) and Machine Learning (ML), advanced, chatbots began to evolve into more intelligent and context-aware systems. NLP enabled chatbots to understand and process human language more effectively, allowing them to comprehend context, manage ambiguity, and handle diverse linguistic nuances. This shift allowed chatbots to engage in more natural and meaningful conversations, moving beyond simple keyword-based interactions to understanding user intent and providing more relevant responses. ML enabled chatbots to understand voice commands, interact with various applications and services, manage schedules, control smart devices, and provide personalized recommendations. The continuous learning and adaptation capabilities of AI ensure that chatbots can evolve with user needs and preferences, offering a more seamless and intuitive user experience. This evolution from simple chatbots to sophisticated chatbot systems represents a significant leap in AI's ability to enhance daily life and business operations.

BRIEF SUMMARY

In various embodiments, a computer-implemented method includes: routing an utterance to a skill bot, wherein the skill bot is configured to execute an action for completing a task associated with the utterance, and a workflow associated with the action includes a generative artificial intelligence (GenAI) component state configured to facilitate completion of at least part of the task; generating, by the GenAI component state, a prompt to include the utterance and one or more scope-related elements based on a prompt template, wherein the one or more scope-related elements include: (i) one or more scenarios, (ii) one or more negative few-shot examples that are considered out of scope (OOS) or out of domain (OOD), and (iii) instructions that teach a GenAI model to output an invalid input variable when the GenAI model determines an utterance is OOS or OOD; communicating, by the GenAI component state, the prompt to a GenAI provider for processing by the GenAI model; receiving, at the GenAI component state from the GenAI model provider, a response generated by the GenAI model processing the prompt, wherein when the GenAI model determines the utterance is OOS or OOD as part of the processing the prompt, the response includes the invalid input variable; and responsive to the response including the invalid input variable, transitioning from the GenAI component state to another state different from that of the GenAI component state or another workflow different from the workflow associated with the action.

In some embodiments, the computer-implemented method further includes receiving the utterance from a user during a session with a digital assistant; determining, by one or more machine learning models, an intent of the user based on the utterance; identifying the skill bot based on the intent; and identifying, by the skill bot, the action for completing the task associated with the utterance.

In some embodiments, when the GenAI model determines the utterance is in-scope or in-domain (not OOS or OOD) as part of the processing the prompt, the response does not include the invalid input variable, and the computer-implemented method further comprises responsive to the response not including the invalid input variable, maintaining the GenAI component state.

In some embodiments, the prompt further includes: (i) a definition of a role or persona for the GenAI model and (ii) a description of the task; the one or more scenarios comprise an invalid scenario; and the one or more negative few-shot examples are associated with the invalid scenario.

In some embodiments, the prompt further includes one or more positive few-shot examples, which include: (i) one or more additional example utterances that are considered to be in-scope or in-domain (not OOS or OOD), and (ii) instructions that teach the GenAI model to output a response based on sample responses that enforce format and structure of the response to be generated when an utterance is determined to be in-scope or in-domain (not OOS or OOD); the one or more scenarios further comprise a valid scenario; and the one or more positive few-shot examples are associated with the valid scenario.

In some embodiments, the another state is another GenAI component state different from the GenAI component state, and wherein the computer-implemented method further comprises: generating, by the another GenAI component state, another prompt to include the utterance or another utterance and one or more scope-related elements based on another prompt template; communicating, by the another GenAI component state, the another prompt to another GenAI provider for processing by another GenAI model; receiving, at the another GenAI component state from the another GenAI model provider, another response generated by the another GenAI model processing the another prompt, wherein when the another GenAI model determines the another utterance is OOS or OOD as part of the processing the another prompt, the another response includes the invalid input variable; and responsive to the another response including the invalid input variable, transitioning from the another GenAI component state to a different state or different workflow.

In some embodiments, the GenAI component state is a multi-turn interaction with the GenAI model and the workflow further includes the another state.

In some embodiments, the GenAI component state is a multi-turn interaction with the GenAI model and the another state is associated with the another workflow that is different from the workflow.

In some embodiments, a system is provided that includes one or more processors and one or more computer-readable media storing instructions which, when executed by the one or more processors, cause the system to perform part or all of the operations and/or methods disclosed herein.

In some embodiments, one or more non-transitory computer-readable media are provided for storing instructions which, when executed by one or more processors, cause a system to perform part or all of the operations and/or methods disclosed herein.

DETAILED DESCRIPTION

Introduction

Artificial intelligence has many applications. For example, a digital assistant is an artificial intelligence-driven interface that helps users accomplish a variety of tasks using natural language conversations. For each digital assistant, a customer may assemble one or more skills. Skills (also described herein as chatbots, bots, or skill bots) are individual bots that are focused on specific types of tasks, such as tracking inventory, submitting timecards, and creating expense reports. When an end user engages with the digital assistant, the digital assistant evaluates the end user input and routes the conversation to and from the appropriate chatbot. The digital assistant can be made available to end users through a variety of channels such as FACEBOOK® Messenger, SKYPE MOBILE® messenger, or a Short Message Service (SMS). Channels carry the chat back and forth from end users on various messaging platforms to the digital assistant and its various chatbots. The channels may also support user agent escalation, event-initiated conversations, and testing.

Intents allow artificial intelligence-based technology such as a chatbot to understand what the user wants the chatbot to do. Intents are the user's intention communicated to the chatbot via user requests and statements, which are also referred to as utterances (e.g., get account balance, make a purchase, etc.). As used herein, an utterance or a message may refer to a set of words (e.g., one or more sentences) exchanged during a conversation with a chatbot. Intents may be created by providing a name that illustrates some user action (e.g., order a pizza) and compiling a set of real-life user statements, or utterances that are commonly associated with triggering the action. Because the chatbot's cognition is derived from these intents, each intent may be created from a data set that is robust (one to two dozen utterances) and varied, so that the chatbot may interpret ambiguous user input. A rich set of utterances enables a chatbot to understand what the user wants when it receives messages like “Forget this order!” or “Cancel delivery!”—messages that mean the same thing, but are expressed differently. Collectively, the intents, and the utterances that belong to them, make up a training corpus for the chatbot. By training a model with the corpus, a customer may essentially turn that model into a reference tool for resolving end user input to a single intent. A customer can improve the acuity of the chatbot's cognition through rounds of intent testing and intent training.

Once an intent of the user is understood by the chatbot, the chatbot can execute a dialog flow. A flow is a piece of the skill dialog flow that defines the interaction with the user to complete a task or a part of a task that the user wants to perform. Typical examples of flows include:Intent-driven flows, where each intent defined in the skill has an associated flow, for example ‘Order Pizza’, ‘Send Money’ or ‘Create Expense’.Supporting or utility flows for tasks like user authorization, new user onboarding, logging, or providing user assistance. Such flows can be invoked from multiple flows. For example, you could have a Create Account sub-flow that you invoke from flows like Order Pizza or Send Money.

Generally speaking, flows break down into the following types: Main Flow, Intent flows, Flows for built-in events and system transitions, and Sub-flows that can be used by top-level flows. The main flow isn't really a flow as such. Rather, it is the control center for the skill, from where users are directed to specialized flows that are mapped to the intents. Within the intent and sub-flows various actions may be defined for supporting what the user wants the chatbot to do in accordance with the understood intent. The various actions can include conversation dialogue, execution of queries on databases, sentiment analysis, data analysis, API and REST calls, and the like.

More recently, Large Language Models (LLMs) have been integrated into digital assistants to enhance skills with generative AI capabilities. These capabilities include handling small talk with a user, generating written summaries of data, automating challenging or repetitive business tasks, such as those required for talent acquisition, and providing sentiment analysis of a given piece of text to determine whether it reflects a positive, negative, or neutral opinion. Using the Invoke Large Language Model component (the LLM component), a skill bot developer can plug these capabilities into their dialog flow wherever they're needed. This dialog flow component is the primary integration piece for generative AI in that it contacts the LLM through a call (e.g., REST call), then sends the LLM a prompt (the natural language instructions to the LLM) along with related parameters. It then returns the results generated by the model (which are also known as completions) and manages the state of the LLM-user interactions so that its responses remain in context after successive rounds of user queries and feedback. The LLM component can call any LLM. A user can add one or more LLM component states (or LLM blocks) to flows. A user can also chain the LLM calls so that the output of one LLM request can be passed to a subsequent LLM request.

The utterances that a digital assistant receives from actual users in the real-world environment (e.g., in the production environment) can however be quite varied and noisy. Some of these received utterances can be very different from the utterances used to train the skill or chatbot and may not fall within the intents that the chatbot is trained to infer and handle. For example, a banking chatbot could receive an utterance such as “How do I book a trip to Italy?” that has nothing to do with banking. Such utterances are referred to as out-of-domain (OOD) utterances since they are not within the domain of intents of the trained chatbot. It is important for a chatbot system to be able to identify such OOD utterances such that proper responsive actions can be taken. For example, upon detecting an OOD utterance, the chatbot may respond to the user indicating that the utterance is not one that the bot can process or handle rather than select a closest matching intent.

Moreover, groups of skills or chatbots may be deployed as part of a same domain. Typically, these skills are developed by different groups or departments of an enterprise within a same domain. In such instances, it will be common for a chatbot to receive utterances about intents that belong to different skills in the same domain. For example, a compensation chatbot in the Human Capital Management (HCM) domain could receive an utterance such as “What are my benefits” that has nothing to do with compensation but does have to do with benefits which is part of the HCM domain. Such utterances are referred to as out-of-scope (OOS) utterances since they are not within the scope of intents of the trained chatbot. Since the skills are part of the same domain, a user may get stuck in skill A (e.g., the compensation chatbot) as questions relating to skill B (e.g., a benefits chatbot) in the same domain are out of scope in Skill A but would pass through Skill A's OOD detector and also potentially match with an intent in Skill A with relatively high confidence. It is important for a chatbot system to be able to identify such OOS utterances such that proper responsive actions can be taken. For example, upon detecting an OOS utterance, a context aware router can route the utterance from the current chatbot (e.g., the compensation chatbot) to the most relevant chatbot within a defined group of the domain (e.g., a benefits chatbot).

With respect to the LLM component, the OOS and OOD detection discussed above presents unique challenges because once a user is interacting with a generative AI model (GenAI model) (e.g., an LLM) the user may present the GenAI model with multiple utterances. The LLM component could have what is described herein as “multi-turn conversations” enabled or disabled. If it is enabled, users can send follow-up utterances to the previous turn, e.g.: “write me a sample email”-> “make it shorter”. In these scenarios, context for the conversation is maintained. However, the user could get stuck in the multi-turn conversations with the GenAI model without OOS and OOD detection. For example, an in-domain query (belonging to a certain intent) in the present skill could be a part of the follow-up queries a user has with the LLM component. This is technically OOS/OOD with respect to the LLM component as the DA does not want the GenAI model to answer questions that intent flows should handle. But the GenAI model needs to identify that it is indeed OOS/OOD-if it does not, the user will not get routed to the correct intent in the skill and get stuck in the LLM component. It is thus important for the GenAI model to be able to identify such OOS and OOD utterances such that proper responsive actions can be taken. For example, upon detecting an OOS or OOD utterance, the GenAI model should be able to end the conversation and allow for the current chatbot to either proceed with the dialog flow for a given intent or a context aware router to route the utterance from the current chatbot to the most relevant chatbot (i.e., state or flow transition).

Accordingly, new approaches are needed to address these challenges and others. These new approaches include various prompt engineering techniques to enable a GenAI model to handle OOS and OOD detection and conveyance of the detection results to the digital assistant and/or skill bot such that it can utilize intent detection and/or the flow (e.g., state or flow transition) to respond to the user accordingly. For example, when the GenAI model determines the utterance is OOS or OOD as part of the processing the prompt, the response includes a deterministic response having a keyword (e.g., an invalid input variable), and when the GenAI model determines the utterance is in-scope or in-domain (not OOS or OOD) as part of the processing the prompt, the response does not include a deterministic response having a keyword. The keyword being an indicator pointing to the fact that a utterance is OOS/OOD. Responsive to the response including the deterministic response having a keyword, the skill bot can implement a flow transition from the GenAI component state (e.g., the LLM component) to another state different from that of the GenAI component state or implement a flow transition from the current flow (also described herein as a workflow such as an intent flow) (e.g., the LLM component) to another flow different from that of the current flow. This allows for, upon detecting an OOS or OOD utterance, the GenAI model to end the conversation with the user and for the current chatbot to either proceed with the dialog flow for a given intent or a context aware router to route the utterance from the current chatbot to the most relevant chatbot.

In an exemplary embodiment, a computer-implemented method includes routing an utterance to an appropriate skill, and within the skill, the utterance is further routed to the appropriate intent. In some instances, the intent flow may have an LLM component. The LLM component takes in the utterance and determines if it is OOS/OOD or in-scope/in-domain. If the scope of the GenAI model is defined such that the GenAI model can handle the utterance, it provides a relevant response to the utterance. If the scope of the GenAI model is defined such that the GenAI model determines the utterance is OOS/OOD, it provides a deterministic keyword that indicates to the router that an utterance is OOS/OOD and hence the router routes the query to the appropriate intent. The scope of “WHAT” the GenAI model can handle, “WHEN” to determine if OOS/OOD, “HOW” to respond to OOS/OOD queries is achieved using prompt engineering, as described below in detail.

In one particular aspect, a computer-implemented method includes routing an utterance to a skill bot. The skill bot is configured to execute an action for completing a task associated with the utterance, and a workflow associated with the action includes a generative artificial intelligence (GenAI) component state configured to facilitate completion of at least part of the task. The computer-implemented method further includes generating, by the GenAI component state, a prompt to include the utterance and one or more scope-related elements based on a prompt template. The one or more scope-related elements include: (i) one or more scenarios, (ii) one or more negative few-shot examples that are considered out of scope (OOS) or out of domain (OOD), and (iii) instructions that teach a GenAI model to output an invalid input variable when the GenAI model determines an utterance is OOS or OOD. The computer-implemented method further includes communicating, by the GenAI component state, the prompt to a GenAI provider for processing by the GenAI model; and receiving, at the GenAI component state from the GenAI model provider, a response generated by the GenAI model processing the prompt. When the GenAI model determines the utterance is OOS or OOD as part of the processing the prompt, the response includes the invalid input variable, and responsive to the response including the invalid input variable, transitioning from the GenAI component state to another state different from that of the GenAI component state or another workflow different from the workflow associated with the action.

As used herein, the articles ‘a’ and ‘an’ are used herein to refer to one or to more than one (i.e. at least one) of the grammatical object of the article. By way of example, an element means at least one element and can include more than one element.

As used herein, the terms “about,” “similarly,” “substantially,” and “approximately” are defined as being largely but not necessarily wholly what is specified (and include wholly what is specified) as understood by one of ordinary skill in the art. In any disclosed embodiment, the term “about,” “similarly,” “substantially,” or “approximately” may be substituted with “within [a percentage] of” what is specified, where the percentage includes 0.1 percent, 1 percent, 5 percent, and 10 percent, etc. Moreover, the term terms “about,” “similarly,” “substantially,” and “approximately” are used to provide flexibility to a numerical range endpoint by providing that a given value may be slightly above or slightly below the endpoint without affecting the desired result.

As used herein, when an action is “based on” something, this means the action can be based at least in part on at least a part of the something.

The use herein of the terms including, comprising, or having, and variations thereof, is meant to encompass the elements listed thereafter and equivalents thereof as well as additional elements. Embodiments recited as including, comprising, or having certain elements are also contemplated as consisting essentially of and consisting of those certain elements. As used herein, and/or, refers to and encompasses any and all possible combinations of one or more of the associated listed items, as well as the lack of combinations were interpreted in the alternative (or).

Bot and Analytic Systems

A bot (also referred to as a skill, chatbot, chatterbot, or talkbot) is a computer program that can perform conversations with end users. The bot can generally respond to natural-language messages (e.g., questions or comments) through a messaging application that uses natural-language messages. Enterprises may use one or more bot systems to communicate with end users through a messaging application. The messaging application, which may be referred to as a channel, may be an end user preferred messaging application that the end user has already installed and familiar with. Thus, the end user does not need to download and install new applications in order to chat with the bot system. The messaging application may include, for example, over-the-top (OTT) messaging channels (such as Facebook Messenger, Facebook WhatsApp, WeChat, Line, Kik, Telegram, Talk, Skype, Slack, or SMS), virtual private assistants (such as Amazon Dot, Echo, or Show, Google Home, Apple HomePod, etc.), mobile and web app extensions that extend native or hybrid/responsive mobile apps or web applications with chat capabilities, or voice based input (such as devices or apps with interfaces that use Siri, Cortana, Google Voice, or other speech input for interaction).

In some examples, a bot system may be associated with a Uniform Resource Identifier (URI). The URI may identify the bot system using a string of characters. The URI may be used as a webhook for one or more messaging application systems. The URI may include, for example, a Uniform Resource Locator (URL) or a Uniform Resource Name (URN). The bot system may be designed to receive a message (e.g., a hypertext transfer protocol (HTTP) post call message) from a messaging application system. The HTTP post call message may be directed to the URI from the messaging application system. In some embodiments, the message may be different from a HTTP post call message. For example, the bot system may receive a message from a Short Message Service (SMS). While discussion herein may refer to communications that the bot system receives as a message, it should be understood that the message may be an HTTP post call message, a SMS message, or any other type of communication between two systems.

End users may interact with the bot system through a conversational interaction (sometimes referred to as a conversational user interface (UI)), just as interactions between people. In some cases, the interaction may include the end user saying “Hello” to the bot and the bot responding with a “Hi” and asking the end user how it can help. In some cases, the interaction may also be a transactional interaction with, for example, a banking bot, such as transferring money from one account to another; an informational interaction with, for example, a HR bot, such as checking for vacation balance; or an interaction with, for example, a retail bot, such as discussing returning purchased goods or seeking technical support.

In some embodiments, the bot system may intelligently handle end user interactions without interaction with an administrator or developer of the bot system. For example, an end user may send one or more messages to the bot system in order to achieve a desired goal. A message may include certain content, such as text, emojis, audio, image, video, or other method of conveying a message. In some embodiments, the bot system may convert the content into a standardized form (e.g., a representational state transfer (REST) call against enterprise services with the proper parameters) and generate a natural language response. The bot system may also prompt the end user for additional input parameters or request other additional information. In some embodiments, the bot system may also initiate communication with the end user, rather than passively responding to end user utterances. Described herein are various techniques for identifying an explicit invocation of a bot system and determining an input for the bot system being invoked. In some embodiments, explicit invocation analysis is performed by a master bot based on detecting an invocation name in an utterance. In response to detection of the invocation name, the utterance may be refined for input to a skill bot associated with the invocation name.

A conversation with a bot may follow a specific conversation flow including multiple states. The flow may define what would happen next based on an input. In some embodiments, a state machine that includes user defined states (e.g., end user intents) and actions to take in the states or from state to state may be used to implement the bot system. A conversation may take different paths based on the end user input, which may impact the decision the bot makes for the flow. For example, at each state, based on the end user input or utterances, the bot may determine the end user's intent in order to determine the appropriate next action to take. As used herein and in the context of an utterance, the term “intent” refers to an intent of the user who provided the utterance. For example, the user may intend to engage a bot in conversation for ordering pizza, so that the user's intent could be represented through the utterance “Order pizza.” A user intent can be directed to a particular task that the user wishes a chatbot to perform on behalf of the user. Therefore, utterances can be phrased as questions, commands, requests, and the like, that reflect the user's intent. An intent may include a goal that the end user would like to accomplish.

In the context of the configuration of a chatbot, the term “intent” is used herein to refer to configuration information for mapping a user's utterance to a specific task/action or category of task/action that the chatbot can perform. In order to distinguish between the intent of an utterance (i.e., a user intent) and the intent of a chatbot, the latter is sometimes referred to herein as a “bot intent.” A bot intent may comprise a set of one or more utterances associated with the intent. For instance, an intent for ordering pizza can be communicated by various permutations of utterances that express a desire to place an order for pizza. These associated utterances can be used to train an intent classifier of the chatbot to enable the intent classifier to subsequently determine whether an input utterance from a user matches the order pizza intent. A bot intent may be associated with one or more dialog flows for starting a conversation with the user and in a certain state. For example, the first message for the order pizza intent could be the question “What kind of pizza would you like?” In addition to associated utterances, a bot intent may further comprise named entities that relate to the intent. For example, the order pizza intent could include variables or parameters used to perform the task of ordering pizza, e.g., topping1, topping2, pizza type, pizza size, pizza quantity, and the like. The value of an entity is typically obtained through conversing with the user.

FIG.1is a simplified block diagram of an environment100incorporating a chatbot system according to some embodiments. Environment100comprises a digital assistant builder platform (DABP)102that enables users of DABP102to create and deploy digital assistants or chatbot systems. DABP102can be used to create one or more digital assistants (or DAs) or chatbot systems. For example, as shown inFIG.1, user104representing a particular enterprise can use DABP102to create and deploy a digital assistant106for users of the particular enterprise. For example, DABP102can be used by a bank to create one or more digital assistants for use by the bank's customers. The same DABP102platform can be used by multiple enterprises to create digital assistants. As another example, an owner of a restaurant (e.g., a pizza shop) may use DABP102to create and deploy a digital assistant that enables customers of the restaurant to order food (e.g., order pizza).

For purposes of this disclosure, a “digital assistant” is an entity that helps users of the digital assistant accomplish various tasks through natural language conversations. A digital assistant can be implemented using software only (e.g., the digital assistant is a digital entity implemented using programs, code, or instructions executable by one or more processors), using hardware, or using a combination of hardware and software. A digital assistant can be embodied or implemented in various physical systems or devices, such as in a computer, a mobile phone, a watch, an appliance, a vehicle, and the like. A digital assistant is also sometimes referred to as a chatbot system. Accordingly, for purposes of this disclosure, the terms digital assistant and chatbot system are interchangeable.

A digital assistant, such as digital assistant106built using DABP102, can be used to perform various tasks via natural language-based conversations between the digital assistant and its users108. As part of a conversation, a user may provide one or more user inputs110to digital assistant106and get responses112back from digital assistant106. A conversation can include one or more of inputs110and responses112. Via these conversations, a user can request one or more tasks to be performed by the digital assistant and, in response, the digital assistant is configured to perform the user-requested tasks and respond with appropriate responses to the user.

User inputs110are generally in a natural language form and are referred to as utterances. A user utterance110can be in text form, such as when a user types in a sentence, a question, a text fragment, or even a single word and provides it as input to digital assistant106. In some embodiments, a user utterance110can be in audio input or speech form, such as when a user says or speaks something that is provided as input to digital assistant106. The utterances are typically in a language spoken by the user108. For example, the utterances may be in English, or some other language. When an utterance is in speech form, the speech input is converted to text form utterances in that particular language and the text utterances are then processed by digital assistant106. Various speech-to-text processing techniques may be used to convert a speech or audio input to a text utterance, which is then processed by digital assistant106. In some embodiments, the speech-to-text conversion may be done by digital assistant106itself.

An utterance, which may be a text utterance or a speech utterance, can be a fragment, a sentence, multiple sentences, one or more words, one or more questions, combinations of the aforementioned types, and the like. Digital assistant106may be configured to apply natural language understanding (NLU) techniques to the utterance to understand the meaning of the user input. As part of the NLU processing for an utterance, digital assistant106may be configured to perform processing to understand the meaning of the utterance, which involves identifying one or more intents and one or more entities corresponding to the utterance. Upon understanding the meaning of an utterance, digital assistant106may perform one or more actions or operations responsive to the understood meaning or intents. For purposes of this disclosure, it is assumed that the utterances are text utterances that have been provided directly by a user108of digital assistant106or are the results of conversion of input speech utterances to text form. This however is not intended to be limiting or restrictive in any manner.

For example, a user108input may request a pizza to be ordered by providing an utterance such as “I want to order a pizza.” Upon receiving such an utterance, digital assistant106is configured to understand the meaning of the utterance and take appropriate actions. The appropriate actions may involve, for example, responding to the user with questions requesting user input on the type of pizza the user desires to order, the size of the pizza, any toppings for the pizza, and the like. The responses provided by digital assistant106may also be in natural language form and typically in the same language as the input utterance. As part of generating these responses, digital assistant106may perform natural language generation (NLG). For the user ordering a pizza, via the conversation between the user and digital assistant106, the digital assistant may guide the user to provide all the requisite information for the pizza order, and then at the end of the conversation cause the pizza to be ordered. Digital assistant106may end the conversation by outputting information to the user indicating that the pizza has been ordered.

At a conceptual level, digital assistant106performs various processing in response to an utterance received from a user. In some embodiments, this processing involves a series or pipeline of processing steps including, for example, understanding the meaning of the input utterance (sometimes referred to as Natural Language Understanding (NLU), determining an action to be performed in response to the utterance, where appropriate causing the action to be performed, generating a response to be output to the user responsive to the user utterance, outputting the response to the user, and the like. The NLU processing can include parsing the received input utterance to understand the structure and meaning of the utterance, refining and reforming the utterance to develop a better understandable form (e.g., logical form) or structure for the utterance. Generating a response may include using NLG techniques.

The NLU processing performed by a digital assistant, such as digital assistant106, can include various NLP related processing such as sentence parsing (e.g., tokenizing, lemmatizing, identifying part-of-speech tags for the sentence, identifying named entities in the sentence, generating dependency trees to represent the sentence structure, splitting a sentence into clauses, analyzing individual clauses, resolving anaphoras, performing chunking, and the like). In some embodiments, the NLU processing or portions thereof is performed by digital assistant106itself. In some other embodiments, digital assistant106may use other resources to perform portions of the NLU processing. For example, the syntax and structure of an input utterance sentence may be identified by processing the sentence using a parser, a part-of-speech tagger, and/or a named entity recognizer. In one implementation, for the English language, a parser, a part-of-speech tagger, and a named entity recognizer such as ones provided by the Stanford Natural Language Processing (NLP) Group are used for analyzing the sentence structure and syntax. These are provided as part of the Stanford CoreNLP toolkit.

While the various examples provided in this disclosure show utterances in the English language, this is meant only as an example. In some embodiments, digital assistant106is also capable of handling utterances in languages other than English. Digital assistant106may provide subsystems (e.g., components implementing NLU functionality) that are configured for performing processing for different languages. These subsystems may be implemented as pluggable units that can be called using service calls from an NLU core server. This makes the NLU processing flexible and extensible for each language, including allowing different orders of processing. A language pack may be provided for individual languages, where a language pack can register a list of subsystems that can be served from the NLU core server.

A digital assistant, such as digital assistant106depicted inFIG.1, can be made available or accessible to its users108through a variety of different channels, such as but not limited to, via certain applications, via social media platforms, via various messaging services and applications, and other applications or channels. A single digital assistant can have several channels configured for it so that it can be run on and be accessed by different services simultaneously.

A digital assistant or chatbot system generally contains or is associated with one or more skills. In some embodiments, these skills are individual chatbots (referred to as skill bots) that are configured to interact with users and fulfill specific types of tasks, such as tracking inventory, submitting timecards, creating expense reports, ordering food, checking a bank account, making reservations, buying a widget, and the like. For example, for the embodiment depicted inFIG.1, digital assistant or chatbot system106includes skills116-1,116-2, and so on. For purposes of this disclosure, the terms “skill” and “skills” are used synonymously with the terms “skill bot” and “skill bots”, respectively.

Each skill associated with a digital assistant helps a user of the digital assistant complete a task through a conversation with the user, where the conversation can include a combination of text or audio inputs provided by the user and responses provided by the skill bots. These responses may be in the form of text or audio messages to the user and/or using simple user interface elements (e.g., select lists) that are presented to the user for the user to make selections.

There are various ways in which a skill or skill bot can be associated or added to a digital assistant. In some instances, a skill bot can be developed by an enterprise and then added to a digital assistant using DABP102. In other instances, a skill bot can be developed and created using DABP102and then added to a digital assistant created using DABP102. In yet other instances, DABP102provides an online digital store (referred to as a “skills store”) that offers multiple skills directed to a wide range of tasks. The skills offered through the skills store may also expose various cloud services. In order to add a skill to a digital assistant being generated using DABP102, a user of DABP102can access the skills store via DABP102, select a desired skill, and indicate that the selected skill is to be added to the digital assistant created using DABP102. A skill from the skills store can be added to a digital assistant as is or in a modified form (for example, a user of DABP102may select and clone a particular skill bot provided by the skills store, make customizations or modifications to the selected skill bot, and then add the modified skill bot to a digital assistant created using DABP102).

Various different architectures may be used to implement a digital assistant or chatbot system. For example, in some embodiments, the digital assistants created and deployed using DABP102may be implemented using a master bot/child (or sub) bot paradigm or architecture. According to this paradigm, a digital assistant is implemented as a master bot that interacts with one or more child bots that are skill bots. For example, in the embodiment depicted inFIG.1, digital assistant106comprises a master bot114and skill bots116-1,116-2, etc. that are child bots of master bot114. In some embodiments, digital assistant106is itself considered to act as the master bot.

A digital assistant implemented according to the master-child bot architecture enables users of the digital assistant to interact with multiple skills through a unified user interface, namely via the master bot. When a user engages with a digital assistant, the user input is received by the master bot. The master bot then performs processing to determine the meaning of the user input utterance. The master bot then determines whether the task requested by the user in the utterance can be handled by the master bot itself, else the master bot selects an appropriate skill bot for handling the user request and routes the conversation to the selected skill bot. This enables a user to converse with the digital assistant through a common single interface and still provide the capability to use several skill bots configured to perform specific tasks. For example, for a digital assistance developed for an enterprise, the master bot of the digital assistant may interface with skill bots with specific functionalities, such as a CRM bot for performing functions related to customer relationship management (CRM), an ERP bot for performing functions related to enterprise resource planning (ERP), an HCM bot for performing functions related to human capital management (HCM), etc. This way the end user or consumer of the digital assistant need only know how to access the digital assistant through the common master bot interface and behind the scenes multiple skill bots are provided for handling the user request.

In some embodiments, in a master bot/child bots infrastructure, the master bot is configured to be aware of the available list of skill bots. The master bot may have access to metadata that identifies the various available skill bots, and for each skill bot, the capabilities of the skill bot including the tasks that can be performed by the skill bot. Upon receiving a user request in the form of an utterance, the master bot is configured to, from the multiple available skill bots, identify or predict a specific skill bot that can best serve or handle the user request. The master bot then routes the utterance (or a portion of the utterance) to that specific skill bot for further handling. Control thus flows from the master bot to the skill bots. The master bot can support multiple input and output channels. In some embodiments, routing may be performed with the aid of processing performed by one or more available skill bots. For example, as discussed below, a skill bot can be trained to infer an intent for an utterance and to determine whether the inferred intent matches an intent with which the skill bot is configured. Thus, the routing performed by the master bot can involve the skill bot communicating to the master bot an indication of whether the skill bot has been configured with an intent suitable for handling the utterance.

While the embodiment inFIG.1shows digital assistant106comprising a master bot114and skill bots116-1,116-2, and116-3, this is not intended to be limiting. A digital assistant can include various other components (e.g., other systems and subsystems) that provide the functionalities of the digital assistant. These systems and subsystems may be implemented only in software (e.g., code, instructions stored on a computer-readable medium and executable by one or more processors), in hardware only, or in implementations that use a combination of software and hardware.

DABP102provides an infrastructure and various services and features that enable a user of DABP102to create a digital assistant including one or more skill bots associated with the digital assistant. In some instances, a skill bot can be created by cloning an existing skill bot, for example, cloning a skill bot provided by the skills store. As previously indicated, DABP102provides a skills store or skills catalog that offers multiple skill bots for performing various tasks. A user of DABP102can clone a skill bot from the skills store. As needed, modifications or customizations may be made to the cloned skill bot. In some other instances, a user of DABP102created a skill bot from scratch using tools and services offered by DABP102. As previously indicated, the skills store or skills catalog provided by DABP102may offer multiple skill bots for performing various tasks.

In some embodiments, at a high level, creating or customizing a skill bot involves the following steps:(1) Configuring settings for a new skill bot(2) Configuring one or more intents for the skill bot(3) Configuring one or more entities for one or more intents(4) Training the skill bot(5) Creating a dialog flow for the skill bot(6) Adding custom components to the skill bot as needed(7) Testing and deploying the skill bot

Each of the above steps is briefly described below.

(1) Configuring settings for a new skill bot-Various settings may be configured for the skill bot. For example, a skill bot designer can specify one or more invocation names for the skill bot being created. These invocation names can then be used by users of a digital assistant to explicitly invoke the skill bot. For example, a user can input an invocation name in the user's utterance to explicitly invoke the corresponding skill bot.

(2) Configuring one or more intents and associated example utterances for the skill bot—The skill bot designer specifies one or more intents (also referred to as bot intents) for a skill bot being created. The skill bot is then trained based upon these specified intents. These intents represent categories or classes that the skill bot is trained to infer for input utterances. Upon receiving an utterance, a trained skill bot infers an intent for the utterance, where the inferred intent is selected from the predefined set of intents used to train the skill bot. The skill bot then takes an appropriate action responsive to an utterance based upon the intent inferred for that utterance. In some instances, the intents for a skill bot represent tasks that the skill bot can perform for users of the digital assistant. Each intent is given an intent identifier or intent name. For example, for a skill bot trained for a bank, the intents specified for the skill bot may include “CheckBalance,” “TransferMoney,” “DepositCheck,” and the like.

For each intent defined for a skill bot, the skill bot designer may also provide one or more example utterances that are representative of and illustrate the intent. These example utterances are meant to represent utterances that a user may input to the skill bot for that intent. For example, for the CheckBalance intent, example utterances may include “What's my savings account balance?”, “How much is in my checking account?”, “How much money do I have in my account,” and the like. Accordingly, various permutations of typical user utterances may be specified as example utterances for an intent.

The intents and the associated example utterances are used as training data to train the skill bot. Various different training techniques may be used. As a result of this training, a predictive model is generated that is configured to take an utterance as input and output an intent inferred for the utterance by the predictive model. In some instances, input utterances are provided to an intent analysis engine, which is configured to use the trained model to predict or infer an intent for the input utterance. The skill bot may then take one or more actions based upon the inferred intent.

(3) Configuring entities for one or more intents of the skill bot—In some instances, additional context may be needed to enable the skill bot to properly respond to a user utterance. For example, there may be situations where a user input utterance resolves to the same intent in a skill bot. For instance, in the above example, utterances “What's my savings account balance?” and “How much is in my checking account?” both resolve to the same CheckBalance intent, but these utterances are different requests asking for different things. To clarify such requests, one or more entities are added to an intent. Using the banking skill bot example, an entity called AccountType, which defines values called “checking” and “saving” may enable the skill bot to parse the user request and respond appropriately. In the above example, while the utterances resolve to the same intent, the value associated with the AccountType entity is different for the two utterances. This enables the skill bot to perform possibly different actions for the two utterances in spite of them resolving to the same intent. One or more entities can be specified for certain intents configured for the skill bot. Entities are thus used to add context to the intent itself. Entities help describe an intent more fully and enable the skill bot to complete a user request.

In some embodiments, there are two types of entities: (a) built-in entities provided by DABP102, and (2) custom entities that can be specified by a skill bot designer. Built-in entities are generic entities that can be used with a wide variety of bots. Examples of built-in entities include, without limitation, entities related to time, date, addresses, numbers, email addresses, duration, recurring time periods, currencies, phone numbers, URLs, and the like. Custom entities are used for more customized applications. For example, for a banking skill, an AccountType entity may be defined by the skill bot designer that enables various banking transactions by checking the user input for keywords like checking, savings, and credit cards, etc.

(4) Training the skill bot-A skill bot is configured to receive user input in the form of utterances parse or otherwise process the received input, and identify or select an intent that is relevant to the received user input. As indicated above, the skill bot has to be trained for this. In some embodiments, a skill bot is trained based upon the intents configured for the skill bot and the example utterances associated with the intents (collectively, the training data), so that the skill bot can resolve user input utterances to one of its configured intents. In some embodiments, the skill bot uses a predictive model that is trained using the training data and allows the skill bot to discern what users say (or in some cases, are trying to say). DABP102provides various different training techniques that can be used by a skill bot designer to train a skill bot, including various machine learning based training techniques, rules-based training techniques, and/or combinations thereof. In some embodiments, a portion (e.g., 80%) of the training data is used to train a skill bot model and another portion (e.g., the remaining 20%) is used to test or verify the model. Once trained, the trained model (also sometimes referred to as the trained skill bot) can then be used to handle and respond to user utterances. In certain cases, a user's utterance may be a question that requires only a single answer and no further conversation. In order to handle such situations, a Q&A (question-and-answer) intent may be defined for a skill bot. This enables a skill bot to output replies to user requests without having to update the dialog definition. Q&A intents are created in a similar manner as regular intents. The dialog flow for Q&A intents can be different from that for regular intents.

(5) Creating a dialog flow for the skill bot—A dialog flow specified for a skill bot describes how the skill bot reacts as different intents for the skill bot are resolved responsive to received user input. The dialog flow defines operations or actions that a skill bot will take, e.g., how the skill bot responds to user utterances, how the skill bot prompts users for input, how the skill bot returns data. A dialog flow is like a flowchart that is followed by the skill bot. The skill bot designer specifies a dialog flow using a language, such as markdown language. In some embodiments, a version of YAML called OBotML may be used to specify a dialog flow for a skill bot. The dialog flow definition for a skill bot acts as a model for the conversation itself, one that lets the skill bot designer choreograph the interactions between a skill bot and the users that the skill bot services.

In some embodiments, the dialog flow definition for a skill bot contains three sections:(a) a context section(b) a default transitions section(c) a states section

Context section—The skill bot designer can define variables that are used in a conversation flow in the context section. Other variables that may be named in the context section include, without limitation: variables for error handling, variables for built-in or custom entities, user variables that enable the skill bot to recognize and persist user preferences, and the like.

Default transitions section—Transitions for a skill bot can be defined in the dialog flow states section or in the default transitions section. The transitions defined in the default transition section act as a fallback and get triggered when there are no applicable transitions defined within a state, or the conditions required to trigger a state transition cannot be met. The default transitions section can be used to define routing that allows the skill bot to gracefully handle unexpected user actions.

States section—A dialog flow and its related operations are defined as a sequence of transitory states, which manage the logic within the dialog flow. Each state node within a dialog flow definition names a component that provides the functionality needed at that point in the dialog. States are thus built around the components. A state contains component-specific properties and defines the transitions to other states that get triggered after the component executes.

Special case scenarios may be handled using the states sections. For example, there might be times when you want to provide users the option to temporarily leave a first skill they are engaged with to do something in a second skill within the digital assistant. For example, if a user is engaged in a conversation with a shopping skill (e.g., the user has made some selections for purchase), the user may want to jump to a banking skill (e.g., the user may want to ensure that he/she has enough money for the purchase), and then return to the shopping skill to complete the user's order. To address this, an action in the first skill can be configured to initiate an interaction with the second different skill in the same digital assistant and then return to the original flow.

(6) Adding custom components to the skill bot—As described above, states specified in a dialog flow for a skill bot name components that provide the functionality needed corresponding to the states. Components enable a skill bot to perform functions. In some embodiments, DABP102provides a set of preconfigured components for performing a wide range of functions. A skill bot designer can select one of more of these preconfigured components and associate them with states in the dialog flow for a skill bot. The skill bot designer can also create custom or new components using tools provided by DABP102and associate the custom components with one or more states in the dialog flow for a skill bot.

(7) Testing and deploying the skill bot-DABP102provides several features that enable the skill bot designer to test a skill bot being developed. The skill bot can then be deployed and included in a digital assistant.

While the description above describes how to create a skill bot, similar techniques may also be used to create a digital assistant (or the master bot). At the master bot or digital assistant level, built-in system intents may be configured for the digital assistant. These built-in system intents are used to identify general tasks that the digital assistant itself (i.e., the master bot) can handle without invoking a skill bot associated with the digital assistant. Examples of system intents defined for a master bot include: (1) Exit: applies when the user signals the desire to exit the current conversation or context in the digital assistant; (2) Help: applies when the user asks for help or orientation; and (3) UnresolvedIntent: applies to user input that doesn't match well with the exit and help intents. The digital assistant also stores information about the one or more skill bots associated with the digital assistant. This information enables the master bot to select a particular skill bot for handling an utterance.

At the master bot or digital assistant level, when a user inputs a phrase or utterance to the digital assistant, the digital assistant is configured to perform processing to determine how to route the utterance and the related conversation. The digital assistant determines this using a routing model, which can be rules-based, AI-based, or a combination thereof. The digital assistant uses the routing model to determine whether the conversation corresponding to the user input utterance is to be routed to a particular skill for handling, is to be handled by the digital assistant or master bot itself per a built-in system intent, or is to be handled as a different state in a current conversation flow.

In some embodiments, as part of this processing, the digital assistant determines if the user input utterance explicitly identifies a skill bot using its invocation name. If an invocation name is present in the user input, then it is treated as explicit invocation of the skill bot corresponding to the invocation name. In such a scenario, the digital assistant may route the user input to the explicitly invoked skill bot for further handling. If there is no specific or explicit invocation, in some embodiments, the digital assistant evaluates the received user input utterance and computes confidence scores for the system intents and the skill bots associated with the digital assistant. The score computed for a skill bot or system intent represents how likely the user input is representative of a task that the skill bot is configured to perform or is representative of a system intent. Any system intent or skill bot with an associated computed confidence score exceeding a threshold value (e.g., a Confidence Threshold routing parameter) is selected as a candidate for further evaluation. The digital assistant then selects, from the identified candidates, a particular system intent or a skill bot for further handling of the user input utterance. In some embodiments, after one or more skill bots are identified as candidates, the intents associated with those candidate skills are evaluated (according to the intent model for each skill) and confidence scores are determined for each intent. In general, any intent that has a confidence score exceeding a threshold value (e.g., 70%) is treated as a candidate intent. If a particular skill bot is selected, then the user utterance is routed to that skill bot for further processing. If a system intent is selected, then one or more actions are performed by the master bot itself according to the selected system intent.

FIG.2is a simplified block diagram of a master bot (MB) system200according to some embodiments. MB system200can be implemented in software only, hardware only, or a combination of hardware and software. MB system200includes a pre-processing subsystem210, a multiple intent subsystem (MIS)220, an explicit invocation subsystem (EIS)230, a skill bot invoker240, and a data store250. MB system200depicted inFIG.2is merely an example of an arrangement of components in a master bot. One of ordinary skill in the art would recognize many possible variations, alternatives, and modifications. For example, in some implementations, MB system200may have more or fewer systems or components than those shown inFIG.2, may combine two or more subsystems, or may have a different configuration or arrangement of subsystems.

Pre-processing subsystem210receives an utterance “A”202from a user and processes the utterance through a language detector212and a language parser214. As indicated above, an utterance can be provided in various ways including audio or text. The utterance202can be a sentence fragment, a complete sentence, multiple sentences, and the like. Utterance202can include punctuation. For example, if the utterance202is provided as audio, the pre-processing subsystem210may convert the audio to text using a speech-to-text converter (not shown) that inserts punctuation marks into the resulting text, e.g., commas, semicolons, periods, etc.

Language detector212detects the language of the utterance202based on the text of the utterance202. The manner in which the utterance202is handled depends on the language since each language has its own grammar and semantics. Differences between languages are taken into consideration when analyzing the syntax and structure of an utterance.

Language parser214parses the utterance202to extract part of speech (POS) tags for individual linguistic units (e.g., words) in the utterance202. POS tags include, for example, noun (NN), pronoun (PN), verb (VB), and the like. Language parser214may also tokenize the linguistic units of the utterance202(e.g., to convert each word into a separate token) and lemmatize words. A lemma is the main form of a set of words as represented in a dictionary (e.g., “run” is the lemma for run, runs, ran, running, etc.). Other types of pre-processing that the language parser214can perform include chunking of compound expressions, e.g., combining “credit” and “card” into a single expression “credit_card.” Language parser214may also identify relationships between the words in the utterance202. For example, in some embodiments, the language parser214generates a dependency tree that indicates which part of the utterance (e.g. a particular noun) is a direct object, which part of the utterance is a preposition, and so on. The results of the processing performed by the language parser214form extracted information205and are provided as input to MIS220together with the utterance202itself.

As indicated above, the utterance202can include more than one sentence. For purposes of detecting multiple intents and explicit invocation, the utterance202can be treated as a single unit even if it includes multiple sentences. However, in some embodiments, pre-processing can be performed, e.g., by the pre-processing subsystem210, to identify a single sentence among multiple sentences for multiple intents analysis and explicit invocation analysis. In general, the results produced by MIS220and EIS230are substantially the same regardless of whether the utterance202is processed at the level of an individual sentence or as a single unit comprising multiple sentences.

MIS220determines whether the utterance202represents multiple intents. Although MIS220can detect the presence of multiple intents in the utterance202, the processing performed by MIS220does not involve determining whether the intents of the utterance202match to any intents that have been configured for a bot. Instead, processing to determine whether an intent of the utterance202matches a bot intent can be performed by an intent classifier242of the MB system200or by an intent classifier of a skill bot (e.g., as shown in the embodiment ofFIG.3). The processing performed by MIS220assumes that there exists a bot (e.g., a particular skill bot or the master bot itself) that can handle the utterance202. Therefore, the processing performed by MIS220does not require knowledge of what bots are in the chatbot system (e.g., the identities of skill bots registered with the master bot) or knowledge of what intents have been configured for a particular bot.

To determine that the utterance202includes multiple intents, the MIS220applies one or more rules from a set of rules252in the data store250. The rules applied to the utterance202depend on the language of the utterance202and may include sentence patterns that indicate the presence of multiple intents. For example, a sentence pattern may include a coordinating conjunction that joins two parts (e.g., conjuncts) of a sentence, where both parts correspond to a separate intent. If the utterance202matches the sentence pattern, it can be inferred that the utterance202represents multiple intents. It should be noted that an utterance with multiple intents does not necessarily have different intents (e.g., intents directed to different bots or to different intents within the same bot). Instead, the utterance could have separate instances of the same intent, e.g. “Place a pizza order using payment account X, then place a pizza order using payment account Y.”

As part of determining that the utterance202represents multiple intents, the MIS220also determines what portions of the utterance202are associated with each intent. MIS220constructs, for each intent represented in an utterance containing multiple intents, a new utterance for separate processing in place of the original utterance, e.g., an utterance “B”206and an utterance “C”208, with respect toFIG.2. Thus, the original utterance202can be split into two or more separate utterances that are handled one at a time. MIS220determines, using the extracted information205and/or from analysis of the utterance202itself, which of the two or more utterances should be handled first. For example, MIS220may determine that the utterance202contains a marker word indicating that a particular intent should be handled first. The newly formed utterance corresponding to this particular intent (e.g., one of utterance206or utterance208) will be the first to be sent for further processing by EIS230. After a conversation triggered by the first utterance has ended (or has been temporarily suspended), the next highest priority utterance (e.g., the other one of utterance206or utterance208) can then be sent to the EIS230for processing.

EIS230determines whether the utterance that it receives (e.g., utterance206or utterance208) contains an invocation name of a skill bot. In some embodiments, each skill bot in a chatbot system is assigned a unique invocation name that distinguishes the skill bot from other skill bots in the chatbot system. A list of invocation names can be maintained as part of skill bot information254in data store250. An utterance is deemed to be an explicit invocation when the utterance contains a word match to an invocation name. If a bot is not explicitly invoked, then the utterance received by the EIS230is deemed a non-explicitly invoking utterance234and is input to an intent classifier (e.g., intent classifier242) of the master bot to determine which bot to use for handling the utterance. In some instances, the intent classifier242will determine that the master bot should handle a non-explicitly invoking utterance. In other instances, the intent classifier242will determine a skill bot to route the utterance to for handling.

The explicit invocation functionality provided by the EIS230has several advantages. It can reduce the amount of processing that the master bot has to perform. For example, when there is an explicit invocation, the master bot may not have to do any intent classification analysis (e.g., using the intent classifier242), or may have to do reduced intent classification analysis for selecting a skill bot. Thus, explicit invocation analysis may enable selection of a particular skill bot without resorting to intent classification analysis.

Also, there may be situations where there is an overlap in functionalities between multiple skill bots. This may happen, for example, if the intents handled by the two skill bots overlap or are very close to each other. In such a situation, it may be difficult for the master bot to identify which of the multiple skill bots to select based upon intent classification analysis alone. In such scenarios, the explicit invocation disambiguates the particular skill bot to be used.

In addition to determining that an utterance is an explicit invocation, the EIS230is responsible for determining whether any portion of the utterance should be used as input to the skill bot being explicitly invoked. In particular, EIS230can determine whether part of the utterance is not associated with the invocation. The EIS230can perform this determination through analysis of the utterance and/or analysis of the extracted information205. EIS230can send the part of the utterance not associated with the invocation to the invoked skill bot in lieu of sending the entire utterance that was received by the EIS230. In some instances, the input to the invoked skill bot is formed simply by removing any portion of the utterance associated with the invocation. For example, “I want to order pizza using Pizza Bot” can be shortened to “I want to order pizza” since “using Pizza Bot” is relevant to the invocation of the pizza bot, but irrelevant to any processing to be performed by the pizza bot. In some instances, EIS230may reformat the part to be sent to the invoked bot, e.g., to form a complete sentence. Thus, the EIS230determines not only that there is an explicit invocation, but also what to send to the skill bot when there is an explicit invocation. In some instances, there may not be any text to input to the bot being invoked. For example, if the utterance was “Pizza Bot”, then the EIS230could determine that the pizza bot is being invoked, but there is no text to be processed by the pizza bot. In such scenarios, the EIS230may indicate to the skill bot invoker240that there is nothing to send.

Another way in which skill bot invoker240can invoke a skill bot is through implicit invocation using the intent classifier242. The intent classifier242can be trained, using machine learning and/or rules-based training techniques, to determine a likelihood that an utterance is representative of a task that a particular skill bot is configured to perform. The intent classifier242is trained on different classes, one class for each skill bot. For instance, whenever a new skill bot is registered with the master bot, a list of example utterances associated with the new skill bot can be used to train the intent classifier242to determine a likelihood that a particular utterance is representative of a task that the new skill bot can perform. The parameters produced as result of this training (e.g., a set of values for parameters of a machine learning model) can be stored as part of skill bot information254.

In some embodiments, the intent classifier242is implemented using a machine learning model, as described in further detail herein. Training of the machine learning model may involve inputting at least a subset of utterances from the example utterances associated with various skill bots to generate, as an output of the machine learning model, inferences as to which bot is the correct bot for handling any particular training utterance. For each training utterance, an indication of the correct bot to use for the training utterance may be provided as ground truth information. The behavior of the machine learning model can then be adapted (e.g., through back-propagation) to minimize the difference between the generated inferences and the ground truth information.

In some embodiments, the intent classifier242determines, for each skill bot registered with the master bot, a confidence score indicating a likelihood that the skill bot can handle an utterance (e.g., the non-explicitly invoking utterance234received from EIS230). The intent classifier242may also determine a confidence score for each system level intent (e.g., help, exit) that has been configured. If a particular confidence score meets one or more conditions, then the skill bot invoker240will invoke the bot associated with the particular confidence score. For example, a threshold confidence score value may need to be met. Thus, an output245of the intent classifier242is either an identification of a system intent or an identification of a particular skill bot. In some embodiments, in addition to meeting a threshold confidence score value, the confidence score must exceed the next highest confidence score by a certain win margin. Imposing such a condition would enable routing to a particular skill bot when the confidence scores of multiple skill bots each exceed the threshold confidence score value.

After identifying a bot based on evaluation of confidence scores, the skill bot invoker240hands over processing to the identified bot. In the case of a system intent, the identified bot is the master bot. Otherwise, the identified bot is a skill bot. Further, the skill bot invoker240will determine what to provide as input247for the identified bot. As indicated above, in the case of an explicit invocation, the input247can be based on a part of an utterance that is not associated with the invocation, or the input247can be nothing (e.g., an empty string). In the case of an implicit invocation, the input247can be the entire utterance.

Data store250comprises one or more computing devices that store data used by the various subsystems of the master bot system200. As explained above, the data store250includes rules252and skill bot information254. The rules252include, for example, rules for determining, by MIS220, when an utterance represents multiple intents and how to split an utterance that represents multiple intents. The rules252further include rules for determining, by EIS230, which parts of an utterance that explicitly invokes a skill bot to send to the skill bot. The skill bot information254includes invocation names of skill bots in the chatbot system, e.g., a list of the invocation names of all skill bots registered with a particular master bot. The skill bot information254can also include information used by intent classifier242to determine a confidence score for each skill bot in the chatbot system, e.g., parameters of a machine learning model.

FIG.3is a simplified block diagram of a skill bot system300according to some embodiments. Skill bot system300is a computing system that can be implemented in software only, hardware only, or a combination of hardware and software. In some embodiments such as the embodiment depicted inFIG.1, skill bot system300can be used to implement one or more skill bots within a digital assistant.

Skill bot system300includes an MIS310, an intent classifier320, and a conversation manager330. The MIS310is analogous to the MIS220inFIG.2and provides similar functionality, including being operable to determine, using rules352in a data store350: (1) whether an utterance represents multiple intents and, if so, (2) how to split the utterance into a separate utterance for each intent of the multiple intents. In some embodiments, the rules applied by MIS310for detecting multiple intents and for splitting an utterance are the same as those applied by MIS220. The MIS310receives an utterance302and extracted information304. The extracted information304is analogous to the extracted information205inFIG.1and can be generated using the language parser214or a language parser local to the skill bot system300.

Intent classifier320can be trained in a similar manner to the intent classifier242discussed above in connection with the embodiment ofFIG.2and as described in further detail herein. For instance, in some embodiments, the intent classifier320is implemented using a machine learning model. The machine learning model of the intent classifier320is trained for a particular skill bot, using at least a subset of example utterances associated with that particular skill bot as training utterances. The ground truth for each training utterance would be the particular bot intent associated with the training utterance.

The utterance302can be received directly from the user or supplied through a master bot. When the utterance302is supplied through a master bot, e.g., as a result of processing through MIS220and EIS230in the embodiment depicted inFIG.2, the MIS310can be bypassed so as to avoid repeating processing already performed by MIS220. However, if the utterance302is received directly from the user, e.g., during a conversation that occurs after routing to a skill bot, then MIS310can process the utterance302to determine whether the utterance302represents multiple intents. If so, then MIS310applies one or more rules to split the utterance302into a separate utterance for each intent, e.g., an utterance “D”306and an utterance “E”308. If utterance302does not represent multiple intents, then MIS310forwards the utterance302to intent classifier320for intent classification and without splitting the utterance302.

Intent classifier320is configured to match a received utterance (e.g., utterance306or308) to an intent associated with skill bot system300. As explained above, a skill bot can be configured with one or more intents, each intent including at least one example utterance that is associated with the intent and used for training a classifier. In the embodiment ofFIG.2, the intent classifier242of the master bot system200is trained to determine confidence scores for individual skill bots and confidence scores for system intents. Similarly, intent classifier320can be trained to determine a confidence score for each intent associated with the skill bot system300. Whereas the classification performed by intent classifier242is at the bot level, the classification performed by intent classifier320is at the intent level and therefore finer grained. The intent classifier320has access to intents information354. The intents information354includes, for each intent associated with the skill bot system300, a list of utterances that are representative of and illustrate the meaning of the intent and are typically associated with a task performable by that intent. The intents information354can further include parameters produced as a result of training on this list of utterances.

Conversation manager330receives, as an output of intent classifier320, an indication322of a particular intent, identified by the intent classifier320, as best matching the utterance that was input to the intent classifier320. In some instances, the intent classifier320is unable to determine any match. For example, the confidence scores computed by the intent classifier320could fall below a threshold confidence score value if the utterance is directed to a system intent or an intent of a different skill bot. When this occurs, the skill bot system300may refer the utterance to the master bot for handling, e.g., to route to a different skill bot. However, if the intent classifier320is successful in identifying an intent within the skill bot, then the conversation manager330will initiate a conversation with the user.

The conversation initiated by the conversation manager330is a conversation specific to the intent identified by the intent classifier320. For instance, the conversation manager330may be implemented using a state machine configured to execute a dialog flow for the identified intent. The state machine can include a default starting state (e.g., for when the intent is invoked without any additional input) and one or more additional states, where each state has associated with it actions to be performed by the skill bot (e.g., executing a purchase transaction) and/or dialog (e.g., questions, responses) to be presented to the user. Thus, the conversation manager330can determine an action/dialog335upon receiving the indication322identifying the intent, and can determine additional actions or dialog in response to subsequent utterances received during the conversation.

Data store350comprises one or more computing devices that store data used by the various subsystems of the skill bot system300. With respect toFIG.3, the data store350includes the rules352and the intents information354. In some embodiments, data store350can be integrated into a data store of a master bot or digital assistant, e.g., the data store250inFIG.2.

Digital Assistant Using Large Language Model Block Handling

FIG.4illustrates an example system400for enabling the integration of large language models (LLMs) with digital assistants (e.g., DAs described with respect toFIGS.1-3) to enhance skills with generative AI capabilities. These capabilities include handling small talk with a user, generating written summaries of data, automating challenging or repetitive business tasks, such as those required for talent acquisition, and providing sentiment analysis of a given piece of text to determine whether it reflects a positive, negative, or neutral opinion. Using the Invoke Large Language Model component, a skill bot developer can plug these capabilities into their dialog flow wherever they're needed. This dialog flow component is the primary integration piece for generative AI in that it contacts the LLM that are hosted on one or more computing platforms such as cloud platforms, on-premises platforms, edge platforms, etc. through a call (e.g., a REST call), then sends the LLM a prompt (the natural language instructions to the LLM) along with related parameters. It then returns the results generated by the model (which are also known as completions) and manages the state of the LLM-user interactions so that its responses remain in context after successive rounds of user queries and feedback. The LLM component can call any LLM. A user can add one or more LLM component states (or LLM blocks) to flows. A user can also chain the LLM calls so that the output of one LLM request can be passed to a subsequent LLM request.

The system400includes a cloud computing platform405(e.g., an IaaS platform such as Oracle Cloud Infrastructure as described in detail with respect toFIGS.8-12) and other computing platforms410configured to provide services including the capability to interact with digital assistants enhanced with the LLM component for invoking LLMs415hosted by one or more LLM service providers. In some embodiments, the cloud computing platform405hosts the LLMs415for the one or more LLM service providers. In other embodiments, the one or more other computing platform(s)410such as one or more other cloud platforms, one or more on-premises platforms, one or more edge platforms, etc. hosts the LLMs415for the one or more LLM service providers. In other embodiments, the cloud computing platform405hosts some of the LLMs415for some of the one or more LLM service providers and the one or more other computing platform(s)410hosts some of the LLMs415for some of the one or more LLM service providers. The LLMs415include a collection of multiple LLMs (e.g., GPT-4, LaMDA, etc.) that can be used for processing various generative artificial intelligence tasks (e.g., natural language understanding and processing) to provide efficient, user centric and context aware responses to one or more users.

Besides the LLM component, the other major pieces of the LLM integration include endpoints for the one or more LLM service provider and transformation handlers for converting the request and response payloads to and from the digital assistant's format using the Common LLM Interface (CLMI) (also described herein as the GenAI Interface420). Follows are the high-level steps for adding these and other components to create the LLM integration for a skill:Register an API service in the digital assistant instance for the LLM's endpoint (e.g., REST endpoint).For the skill, create a LLM Transformation Event Handler to convert the LLM request and response payloads to and from CLMI using the GenAI Interface420.In some instances, prebuilt handlers are provided for example if a user is integrating their skill with the Cohere model or with Oracle Generative AI Service. If they are accessing other models, such as Azure OpenAI, the user can update the starter transformation code that is provided using a declarative process.Define an LLM service for the skill that maps to the service that the user has registered to the instance with an LLM Transformation Handler.In the flow of the skill where the user wants to use the LLM, insert and configure an LLM component by adding the prompt text and setting other parameters.The prompt text and/or template can be added using a Prompt Builder (accessed through the LLM component) to perfect and test the prompt.

Once the LLM integration is configured, the CLMI or GenAI interface420enables the LLM component to handle these request and response payloads (e.g., translate, moderate, and validate responses and requests). In general, the GenAI interface420is comprised of various components for handling the following:A request body specificationA success response body specification, applicable when LLM call returns an standard response such as a HTTP200statusAn error response body specification, applicable when the LLM call returns a status other than an standard response, and the LLM invocation itself was successful. For example, in case of HTTP status code 401 (not authorized) or 500 (internal server error) the LLM is not successfully invoked hence no response body is expected. The VFD LLM component will handle these status codes separately.A moderation request bodyA moderation response body

The system400further includes one or more client devices425(e.g., personal computing device, mobile device, kiosk, IoT device, etc.) that can be used by one or more users to interact with the services provided by the cloud computing platform405and other computing platforms410(optionally via the one or more networks430, which may host applications or websites that are used to interact with the services). As discussed below in greater detail with respect toFIGS.5and6, users using the client devices425may send utterances (e.g., queries) or commands to the digital assistant/chatbot system for processing including LLM integration via the LLM component and the CLMI or GenAI interface420.

FIG.5illustrates an example simplified GenAI Bot Infrastructure500that implements LLM integration (e.g., via GenAI interface420described with respect toFIG.4) for transforming, processing, and validating response and request payloads, according to various embodiments. The GenAI Bot Infrastructure500may include one or more components from devices ofFIG.1-4or8-12, and/or operate according to methods, processes or techniques as inFIG.6or7. By way of example, the GenAI Bot Infrastructure500includes a GenAI Interface508for error and/or validation handling of payloads related from client device(s)525(e.g., smartphone, web interface, etc.) operated by users (e.g., users of DA108with respect toFIG.1). The users, without limitation, may be customers of enterprises, developers of software, or any user capable of providing an utterance502a(e.g., utterance A202with respect toFIG.2). For example, a user may access a website which includes chatbot support (e.g., DA/chatbot system106with respect toFIG.1) and request assistance ordering a new ladder, but is unsure which sizes are available. The chatbot may receive a question from the user such as, “I am looking for a collapsible twelve-foot ladder”. The chatbot may then invoke subsystems to determine an intent (e.g., multiple intent subsystem220with respect toFIG.2), various rules (e.g., rules252with respect toFIG.2), and respond with an answer or information to the user (e.g., dialog output335to user with respect toFIG.3) such as providing a link to collapsible twelve-foot ladders, offering to add a twelve-foot ladder to the user's shopping cart, or similar resolutions.

As discussed previously, the users may use the client device(s)525to provide the utterance502aover a network592(e.g., Internet). That utterance502amay then be relayed from an interface (e.g., web-based storefront) to a Digital Assistant (DA) Chatbot System507(e.g., DA/Chatbot System106with respect toFIG.1) for handling by a chatbot (e.g., master bot, skill bot #1-#3, etc.) as discussed in more detail further on.

Some conventional chatbot systems may be limited by pre-existing and/or preset responses and/or guidelines which may limit the utterances that the chatbot can process and/or the responses the chatbot system can provide. For example, users may provide requests that require knowledge or actions outside of the capabilities of the chatbot (e.g., complex utterances). For example, a skill bot may receive an utterance from a user, “I'm forty-three and I would like to know what my options are for 401k investment strategies for a target retirement by sixty years old.”. In these instances, the DA/Chatbot System507selects one or more appropriate skill bots (e.g., skill bot #1, skill bot #2, etc.) to attempt to provide a response. One or more of the skill bots may be unable to provide a full and adequate response to the user due to the complexity of the utterance502a. While the skill bot may be able to provide 401k investment strategies, or target strategies for retiring by sixty years old, the skill bot may be unable to combine the two ideas into one coherent deterministic response. In these examples, the DA/Chatbot System507may use LLM integration to enhance the skills with generative AI capabilities, which includes invoking a LLM component, creating a request payload550that includes the utterance502a, and communicating the request payload550to the GenAI Interface508for further processing.

Nonetheless, each provider has its own format for the request, response, and error payloads. Because of this, the LLM provider and digital assistant can't communicate directly, so to facilitate the exchange between the skill and its LLM providers, these payloads are transformed into a digital assistant's Common LLM Interface (CLMI or GenAI Interface) and back again into provider specific formats). For example, in response to use of LLM integration, the DA/Chatbot System507generates a request payload550having a common request body specification which includes the utterance502a. The request payload550may be a transformed payload of the utterance502aand may be represented based on JSON syntax and contain, but not limited to, one or more of the following properties:i) messagesii) streamResponseiii) maxTokensiv) temperaturev) uservi) providerExtension.

i) messages: The request may include a list of messages. The message may be a prompt with a role property (e.g., the user that created the message). In some examples, the role property may be from a system (e.g., chatbot, client deice525, or similar). The message may include the utterance502a(e.g., the original natural language message from the user), a “turn” (e.g., a number indicating a current refinement turn of the chat messages exchange with a first prompt representing turn “1”), a retry (e.g., flag that may indicate where the message set sent to fix an GenAI Model505error), or a tag (e.g., a custom tag to mark a specific prompt). For example, the tag may be set to “criticize” or “improve” so that custom logic in a validation handler (e.g., validation handler510) may detect a “position” in the process. If the GenAI Model505(discussed in more detail further on) supports a multi-turn conversation to enhance the GenAI Model505response, subsequent messages may be pairs of user and assistant role messages (e.g., the user message contains the follow-up instruction/question for the GenAI Model505, the assistant message contains the GenAI Model505response to the user message). If the GenAI Model505does not support multi-turn conversations, then the messages array may contain a single system message holding the prompt.

ii) streamResponse: If set to true, the GenAI Model505response may be streamed back to the user. A Visual Flow Designer (VFD) LLM Component516(discussed in more detail further on) may then send a partial response messages back to the user which may lead to an enhanced experience because the user may not have to wait until the GenAI Model505completed the response. In this manner, the user will get intermediate results back more quickly.

iii) maxTokens: The maximum number of tokens the GenAI Model505may use to generate the response. Tokens can be thought of as pieces of words, one hundred tokens roughly equal seventy-five words in English.

iv) temperature: Temperature may be used by the GenAI Model505to govern a randomness and thus a creativity of the responses. The temperature may be a number between zero and one. A temperature of zero may mean the responses may be straightforward and substantially deterministic (e.g., producing substantially similar responses to a given prompt). A temperature of one may mean the responses can vary probabilistically (e.g., producing substantially different responses to a given prompt). For GenAI Provider(s)503that may support a wider range than zero to one. In these examples, the validation handler510may be used to apply a multiplier.

v) user: A unique identifier that may represent an end-user which may help monitoring and detecting errors, content, moderation, or abuse of the system.

vi) providerExtension: The property may allow for GenAI Model Providers503specific configuration options that are may not be defined as part of GenAI Interface508. In some examples, a chatbot developer may add provider specific configurations for the validation handler510.

While the context of the request payloads550are discussed in reference to JSON, it should not be considered limiting and one skilled in the art would recognize that any suitable syntax language and/or schema may be used for communication with various components of the infrastructure500.

According to some embodiments, the validation handler510of GenAI Interface508implements a translator515to process incoming request payloads550. This translator515serves as the intermediary between incoming request payloads550(e.g., JSON payloads) from client device(s)525and the request/response transformer513. One non-limiting approach for handling this scenario would be for a first request payload550to trigger a translation of the utterance502afrom a JSON format to a free text (or other query) to be fed to the GenAI Providers503. However, this approach may use a number of back-and-forth transformations for every request payload550and response payload551(discussed in more detail further on). Thus, some embodiments instead integrate the translator515to automatically convert commands to free text.

In some examples, a translate function itself may not be used by the translator515though the initialization may be implemented to call commands for requesting a prompt (e.g., from prompt module514) and validation may be done by the validation handler510. In addition, or alternatively, in lieu of directly using a “translate” function, the translator515may process these commands to extract the prompts and any additional information required for interaction. For example, a “createRequestPrompt” function may be implemented that can take the prompts from the commands and transform them in a format suitable. This may involve structuring the prompts514as a request to be later relayed to the GenAI Providers503.

According to some embodiments, the translator515invokes guardrails and content moderation. The guardrails may be implemented so as to dynamically, and in real-time, process utterances502afor which a request payload550has been requested to be processed and relayed to the GenAI Providers503. The guardrails may perform checks for potential malicious input and/or indirect attacks. Here, the validation handler510of the GenAI Interface508may be used to perform validation of data input to the GenAI Model Providers503or output from the GenAI Models505. Using the validation handler510may facilitate easier integration with interfaces, information and understandings associated with client device(s)525. For example, the validation handler510may reject any output with a format that may not be consistent with the example data fed to the GenAI Model505via a prompt.

The GenAI Interface508provides multiple forms of guardrails to enhance the security of prompts communication. Preventive guardrails implement access control policies on the users prompts that they provide the prompts to the GenAI Model Providers503by implementing compliance standards that disallow a set of actions that might violate pre-existing policies. The guardrails enable valid data provision to chatbots and GenAI Models505preventing attacks such as SQL injection and cross-site scripting (XSS) by rejecting or sanitizing malicious input. In some examples, rate-limiting guardrails are implemented to prevent brute force and denial-of-service attacks by restricting the number of requests that are made to conversational applications and GenAI Models505within a specified time frame. By implementing these technical guardrails, strong security measures are provided for the chatbots and GenAI Models505.

The guardrails may minimize the risk of malicious input and attacks, which may disrupt enterprise flows. By ensuring that only valid and safe inputs are processed by GenAI Models505and chatbots, businesses can maintain the determinism of their processes. Guardrails, such as data encryption and access controls, may protect sensitive business data from unauthorized access or data breaches. This ensures that the integrity and confidentiality of data are maintained within the deterministic business flow. With security measures in place, the business may confidently integrate GenAI Models505without worrying about potential security risks that could disrupt operations. This allows the business to maintain its deterministic flow even in the presence of advanced AI components.

In some examples, when the prompts are received by the validation handler510from the prompt module514, it may also involve structure validation and client-specific content moderation by providing a content moderator. Some types of content are required to be moderated via laws or regulations of applicable jurisdictions. When a request payload550is received at the GenAI Interface508, a moderating sub-system may implement any additional content moderation and may view statistics pertaining to any default content moderation (e.g., performed in accordance with various jurisdictions' laws or regulations). Further, each client device525may define an additional constraint to be imposed on utterances502aand/or data access. It will be appreciated that each such additional constraint may be evaluated to ensure that it accords with system-level constraints and is consistent with data privacy, data security, data integrity, etc. Thus, in some embodiments, when the request payload550is received, generating a response payload551may include evaluating baseline requirements (e.g., based on applicable laws and/or regulations) and using an independent API that combines filtering chatbot messages and filtering user messages. In addition, or alternative, various flags may be used to predict whether a message is from a user or a chatbot, as filtering bot messages may be of higher priority.

In some examples, once the prompts are validated by the content moderator, the validation handler510may return an error if a problem was detected in the request payload550(e.g., by way of request handler511) or the response payload (e.g., by way of the response handler512). The request handler511and/or the response handler512may be sub-functions/modules/routines of the validation handler510. In addition, or alternatively, upon detecting a problem in the request payload550, the validation handler510may recommend a revised utterance to the user. Upon detecting a problem in the request payload550, the validation handler510may iteratively route corresponding utterances to one or more other GenAI Providers503and/or may generate an updated utterance for a same GenAI Model505, where the updated utterance may be generated to include a component that corresponds to an instruction or clarification (e.g., via VFD LLM Component516) to avoid the detected problem. For this purpose, the validation handler510may offer a prompt designer module (included in the prompt module514) in which prompts can be dynamically analyzed in a step-by-step fashion, and feedback can be provided in real-time. The analysis may include transforming a prompt to detect both a system instruction and the utterance502athat are to collectively be provided to the GenAI Model505. The system instruction and utterance502a, as detected, can be dynamically provided via an interface in real-time, such that the user can revise the prompt and/or edit the system instruction and/or user input. The prompt designer may forward the validated prompts to GenAI Model Providers503through APIs. The GenAI Interface508may process the request payload550using natural language processing capabilities and relay the request payload550to the GenAI Providers503.

In some embodiments, the GenAI Interface508selects one or more GenAI Model Providers503that may be capable in providing a full and adequate response to the utterance502a. However, many GenAI Providers503take specific inputs and may not always be receptive to any arbitrary input. One example of a GenAI Model Provider is OpenAI™ which has a preferred prompt format and an unpreferred prompt format shown here:

i) Preferred Format:“Extract the important entities mentioned in the text below. First extract allcompany names, then extract all people names, then extract specific topics which fit the contentand finally extract general overarching themes:Desired format:company names: <comma_separated_list_of_company_names>People names: -||-Specific topics: -||-General themes: -||-Utterance: {Johnny works at CarpetCo. And Jane works at TileCorp. Mattwould like to work in the tile industry, but only has skills in the carpet industry.}”ii) Not Preferred Format:“Extract the entities mentioned in the text below. Extract the following 4 entitytypes: company names, people names, specific topics and themes:Utterance: {Johnny works at CarpetCo. And Jane works at TileCorp. Mattwould like to work in the tile industry, but only has skills in the carpet industry.}”

The GenAI Interface508may create the custom request body specification based on the GenAI Providers503preferred format which is stored on memory or communicated by the GenAI Providers503to the GenAI Interface508. Once the GenAI Interface508selects the appropriate GenAI Model Providers503, the request/response transformer513converts the common request body specification, which is part of the request payload550, into a custom request body specification in order communicate the request payload550to the selected GenAI Provider503including a preferred prompt style (as discussed above). The custom request body specification may include the utterance502aand details that were present in the common request body specification but catered, and/or tailored to a preferred format/style for the selected AI Provider503. For example, the GenAI Interface503may use the request/response transformer513in order to take the utterance502of “I'm forty-three and I would like to know what my options are for 401k investment strategies for a target retirement by sixty years old.” and transform it into the custom request body specification:

“Your persona is that of a retirement financial adviser. Extract the important entities mentioned in the text below. First identify all relevant federal regulations and policy, then retrieve retirement program information, then identify specific topics which fit the content and finally extract general overarching themes:

Desired format:Retirement options: <bullet_point_list_of_retirement_options>Alternative options: -||-Detailed Summary of Retirement Options: -||-Federal Aid Programs: -||-Model: ChatGPTTemperature: 0Max_tokens: maximum valueUtterance: {I'm forty-three and I would like to know what my optionsarefor 401k investment strategies for a target retirement by sixty years old.}”.

The GenAI Providers503then relay the request payload, which includes the custom request body specification, to one or more GenAI Models505. If more than one GenAI Provider503is selected, multiple custom request body specifications are sent the GenAI Providers503. In some examples, some custom body specifications, by way of the request payload, sent to GenAI Models505may result in a response that is unsatisfactory. This is more problematic with stateless models (e.g., LLM (stateless)), which may fail to capture a state of a prior interaction that was not satisfactory. In some instances, history (e.g., previous prompts, custom body request specifications, etc.) is embedded in the prompt using various encoding techniques. In some instances, historical response assessments performed at the cloud-computing platform (e.g., cloud computing platform401with respect toFIG.4) are used to dynamically rank or score each of GenAI Models505, via GenAI Providers503, with respect to any new utterances based on a predicted response quality and/or likelihood that a response will be free of errors (as detected by the validation handler510or as determined based on user feedback).

In some examples, GenAI Interface508includes an error handling service to responses in the cloud environment. By way of example, the validation handler510is used to validate a response (e.g., a JSON file) representing a custom response payload55sent from the GenAI Model505, via the GenAI Provider503, against criteria imposed in an initial utterance502a. If a validation is not satisfied, additional event handler logic can be used to further process the response to facilitate accurate translation into the desired format (e.g., by way of request/response transformer513) such as JSON. Error tracking can be complicated when the cloud environment interfaces with a GenAI Model505/GenAI Provider503. An error may be due to an improper prompt, a validation error, a system unavailability, or a data-interpretability error, etc. Due to this uncertainty, a quantity of retries triggered from the validation handler510are tracked. This quantity may be returned to the client device525as subsequent retries are being prepared for transmission. The user (e.g., developer, customer) may define a rule (and/or modify a default rule) that indicates when retries are to be terminated.

In some examples, multiple runtime checks can be performed confirming a presence of a minimum set of field values are in the output of the GenAI Models505(e.g., opportunity name should be in summary, account name, etc.) and confirming that select restricted values are not in the GenAI Model505output (e.g., when generating emails: only these email addresses should be in the output). According to some embodiments, using composite bag (CB) entity functionality may avoid too much complexity in configuring the checks within the VFD LLM Component516. Composite bag entities allow a user and/or developer to write much shorter, more compact dialog flow definitions because they can be resolved using just one component (either Resolve Entities or a Common Response). A user may add a component property, for example, “Composite Bag (CB) Entity for Output Validation” such that when a CB entity is specified in this property, the intent server may be invoked and the GenAI Model505output may be used as an entity matching query. The CB items may be populated for which a matching entity value may have been found. The CB item values may then be validated by ensuring that all bag items that have ‘Prompt for Value’ are considered required; enforcing bag item validation rules; and calling the validation handler510.

In some examples, if validation fails, a session with the VFD LLM component516can end, setting a new transition action “outputValidationError”. In another instance, if validation fails, a validation error message may be sent back to the GenAI Models505, so the GenAI Models505can correct the error. The validation error to send can be configured with the CB item or set within a standard entity event handler. This can be restricted to a maximum number of turns to prevent an endless loop. In some examples with streaming being disabled to enable output validation in the first place, waiting time for the user may increase and a means can be provided to allow a user (e.g., skilled developer) to send a “status update” message. This approach may be combined with the validation handler510and VFD LLM Component516such that a developer may inspect the CB entity (passed in the CB entity as a handler event property), and code any custom logic to validate the GenAI Model505response using the entity matches (e.g., discussed in more detail further on) stored in the various bag items. A long GenAI Model505response may result in unexpected/wrong entity matches in the CB entity, so a form of prompting (where the criticize prompt might include entity validation instructions) may be used.

In some examples, the GenAI Interface508may use the GenAI Models505as a supportive tool within, or in conjunction with, business operations, by maintaining at least partial control over the data and how it is used, rather than letting the GenAI Models505dictate the information flow. This approach allows them to harness the capabilities of the language model to improve the business processes without letting it define their information needs. The validation handlers510ensures that the responses from the GenAI Models505meets specific quality and accuracy standards that are set by the business corporations. This can help in maintaining data integrity and reliability to make informed decision-making by using reliable business processes. After receiving the response from the GenAI Model505, the validation handler510may then be enhanced using TypeChat prompt enhancements (in JSON). These enhancements can include formatting LLM-generated text, adding context or metadata to it, or doing additional processing to improve the quality or relevance of the response to a submitted prompt. The enhanced custom response payload (e.g. payload from the GenAI Models505a, b, etc.), which may now include the original LLM-generated content along with any TypeChat prompt enhancements, may then be sent as a custom response payload551to the client device525that issued the initial prompt, command, or utterance502a, assuming no errors have been identified by the validation handler510.

In some embodiments, the cloud computing platform may utilize a recursive framework for integrating client-associated feedback to improve prompt responses. The cloud computing platform may receive the request payload550from the client device525, and the cloud-computing platform may a query for the same, where the query is then routed to a specific GenAI Model505. Upon receiving the response from the GenAI Model505, a representation of the custom response payload551is availed to the client device525via an interface. The interface is configured to receive feedback about the response. For example, the interface may be configured to receive indications including, but not limited to, an accuracy of the custom response payload551; a degree to which the custom response payload551addressed the query; an extent to which a level of detail in the custom response payload551matched that of interest for the request payload550. This type of feedback may be iteratively received for each custom response payload551, and an updated request payload550may be iteratively generated that converted the feedback into an instruction (e.g., new prompt for GenAI Models505). For example, content from the initial request payload and a prior response payload may be represented in a context of the query, and an instruction in the query may identify an indicate how a next response is to improve with regard to the feedback. The iterations can proceed until an iteration-termination criterion (which may be defined by a client device, a cloud-computing platform, a developer, etc.) is satisfied.

In some embodiments, the GenAI Interface508component can be embedded into a processing flow or directly invoked to facilitate interaction with webpages. The GenAI Interface508can detect various components of a website and automatically identify, based on initial client-specific objective information, which portions of the website pertain to the client's objective. For example, a website may include one or more pages, sections, content objects, etc. that are irrelevant with respect to a given client's objective. Such relevancy can be estimated using the GenAI Models505. The estimated relevancy can then be used to determine how to process, rank, or interact with a webpage.

For some GenAI Models505which do not have proper training, knowledge set, or request details, the GenAI Models505provide responses as though it is confident of a quality of the response (e.g., hallucinations). This situation is common in out-of-domain (OOD) or out-of-scope (OOS) circumstances referring to the capability of recognizing when a user input or query is unrelated or irrelevant to the intended purpose of the GenAI Models505. Moreover, when multi-turn conversations have been enabled between the user and GenAI Models505, OOS and OOD detection is important for the response refinements and follow-up queries. Thus, some embodiments relate to using prompt engineering to request that the GenAI Models505indicate, as part of its output, whether or a degree to which the query may request a response that is out of the model's domain or scope. The indication may be used to determine whether to return the custom response payload551to the client device525, whether to reroute the prompt (e.g., custom response body specification including the utterance502a) to another GenAI Model505, etc. In some instances, another GenAI Model505may be called to provide context and/or information that can be routed to the initial GenAI Model505in an updated request payload. According to some embodiments, the GenAI Interface508may continuously analyze and monitor the user input to understand their intent within a context by using natural language understanding (NLU) techniques. An effective OOS/OOD detection requires proper context management (e.g., to remember the previous turns in the conversation by assessing whether the current input is in or out of a scope as discussed above). Context management may include maintaining a conversation history and understanding the relationships between previous user inputs and system responses. For OOS or OOD detection, a multi-turn dialog state may be maintained, which includes the current context and conversation history. In these examples, the dialog state may be updated after each user tum and the state helps the LLM to understand the flow of the conversation and to detect when it goes OOS or OOD.

In some examples, a single request is fed to a single GenAI Model505. However, if the model is not well configured to respond to the request (e.g., due to OOS or OOD reasons), a response can be of poor quality (as determined by response handler512). Embodiments of the present disclosure may provide the request payload to many models and generate potential response payloads, of which provide many options for review by the response handler512. A new request payload can then be generated by the request/response transformer513and fed to a different GenAI Model505, where the new request payload provides the initial request, the response options (or a representation thereof), and an instruction to generate an output based on the response options and the request. For example, the instruction may be to select a single response option as a favored option, to rank-order the response options, or to assign a score to each response option. In some instances, this process is repeated multiple times, where—for each iteration-a different GenAI Model505is selected to evaluate the new request payload and may be omitted from the set of GenAI Model505used to generate the potential response payload options.

According to some embodiments, contextual routes can be used to enable OOS intents routing before invocation of a LLM component. Upon receiving, at a cloud computing platform (e.g., cloud computing platform401with respect toFIG.4), a request payload550, a set of requests can be generated. Each request can be generated to comply with input-specification criteria (e.g., developer assigned via VFD LLM Component516by way of error criteria module517) of given GenAI Model505. Each request can provide information about the request as context, and request an estimation as to how well equipped (e.g., in terms of a training experience or knowledge base) the GenAI Model505is to respond to the request. As mentioned previously, the requests can be fed to the respective GenAI Models505, and responses can be received that include the estimated degree of how well-equipped each GenAI Model505is to handle the request. When the GenAI Models505are equipped with the contextual information, the GenAI Models505may generate coherent and contextually relevant responses. However, the quality of these response may depend on how accurately the input context is the provided. For users, providing a platform to perform complex tasks such as multi-tum conversations that involve keeping a track of the complete conversation history and the current state of the conversation, the correct context helps GenAI Models505to generate accurate and personalized responses. To understand complex phrases, ambiguous words, or acronyms in the user utterance502s, GenAI Models505may utilize context to disambiguate the ambiguity in user input.

According to some embodiments, various few-shot techniques may be used to respond to and/or address the aforementioned OOS/OOD situations. A few-shot technique can provide a set of exemplary prompts and responses that GenAI Models505use to inform themselves as to how to respond to a given request payload. This approach is used to provide information to GenAI Models505about a format of response that is expected. In some embodiments, a few-shot technique is used to provide exemplary request-response data that illustrates knowledge or scope that is or might be outside a knowledge or scope domain of the GenAI Models505. The request payload can then request that a custom response payload551is generated consistent with the exemplary request-response data.

In some examples, some third party GenAI Providers503are susceptible to data leakage, responding in a problematic manner to malicious input, developing bias, passing disinformation, generating inconsistent responses, lacking interpretability, etc. As a result, the GenAI Interface508may interact with multiple different GenAI Providers503which have not been previously validated. This approach may facilitate adversarial responses in that one or more GenAI Providers503can be recruited (e.g., external sources607with respect toFIG.6) to generate utterances/prompts that test whether and/or an extent to which another GenAI Model505generates a response that may be inconsistent with a target performance metric (e.g., no data leakage).

In some examples, the validation handler510provides client devices525with efficient and optimized SQL queries to offer data analytics services. The GenAI Models505can be used to generate SQL dialogs based on user utterances to enhance exploration of data and semantics understanding. For large databases, the GenAI Model Providers503may be integrated into a cloud platform (e.g., cloud computing platform401with respect toFIG.4) that can help explain the purpose and structure of a table or data within a database by analyzing its schema and relations. The GenAI Models505may provide guidance in exploring the data efficiently and effectively and can suggest relevant tables, columns, or utterances to help users (by way of the DA/Chatbot System507) extract valuable insights from the dataset that otherwise would require advance business intelligence methods. Thus, explaining the meaning and relationships between tables, columns, and data points to the users who are not familiar with a domain of databases can enable them to use natural language prompts to interact with databases.

Returning now to the functionality of the VFD LLM Component516, using the GenAI models505, several capabilities may be included into a dialog flow where suitable (e.g., instances where a new prompt does not have a pre-defined or pre-learned response). The dialog flow component may be the primary integration piece for generative AI in that it contacts the GenAI Model505through a call (e.g., a REST call), then sends the GenAI Model505a prompt (e.g., natural language instructions to the LLM) along with related parameters (e.g., context, metadata, etc.). The GenAI Model505then returns a response generated by the model (which are also known as completions) and manages the state of the GenAI Model505so that response may remain in context after successive rounds of user utterances502aand feedback. In addition, or alternatively, one or more LLM component states519(or LLM blocks) may be suitably added and/or removed to flows (e.g., developer added/defined prior to, during, and/or after the request payload550being transmitted). Chaining the GenAI Model505calls may be performed so that the output of one GenAI Model505request can be passed to a subsequent GenAI Model505request. GenAI Model505integration may include endpoints for the GenAI Model Providers503, and the request/response transformation handler513for converting the request payload550and response to and from various GenAI Model Providers503formats. In some examples, the request/response transformation handler513may include a look-up table (e.g., database) of formats that yield successful responses and/or requested formats per GenAI Providers503.

In some examples, the request/response transformation handler513functions in tandem with the VFD LLM Component516. For example, a developer may be able to set predefined criteria (e.g., by way of error criteria module517), the results of which may be passed to the validation handler510(e.g., as input and/or output) for processing based on developer configurations (e.g., configuration(s) module518). For example, the developer may choose to raise an error, transition to another state, or request clarification from the user, or re-prompt the GenAI Model505to improve the response payload.

In some examples, the VFD LLM Component516receives the response payload from the GenAI Models505(e.g., by way of response handler512). For example, the data within the response payload is generated by the VFD LLM Component516using one or more predicted completions (e.g., messages). The data may be represented based on JSON syntax and contain some, none, or all properties that the request payload550included. In some examples, a set of candidate messages may be batched into a list of response items, to reduce the number of validation handler510calls.

In some examples, the validation handler510may determine that the response payload from the GenAI Models505, via the GenAI Providers503, may include errors, successfully completion, processing instructions, or combinations thereof. For example, an error response body specification may be generated when a REST call returns a HTTP status other than HTTP200-Status (e.g., data is represented based on JSON). The one or more errors may be transformed from the GenAI Models505specific format for the given GenAI Model505and/or GenAI Interface508into an error body specification (e.g., a common response body specification). Some examples of errors provided in the error body specification may include, but are not limited to:i) notAuthorizedii) modelLengthExceedediii) requestFlaggediv) responseFlaggedv) requestInvalidvi) responseInvalidvii) unknown.

i) notAuthorized: Indicates the GenAI Model505request does not have proper authorization key.

ii) modelLengthExceeded: Indicates that the combination of request payloads (system prompt plus user and assistant refinement messages) and the maximum number of tokens exceeds the GenAI Models505maximum supported length.

iii) requestFlagged: Indicates that the GenAI Model505request payload is against the moderation policies of the GenAI Model505, for example when the request contains regulated content.

iv) responseFlagged: Indicates that the GenAI Model505response payload is against the moderation policies of the GenAI Model505, for example when the response contains regulated content.

v) requestInvalid: Indicates that the request payload is invalid, for example because it failed some validation rules set in the validation handler, or the format is not understood by the GenAI Model505.

vi) responseInvalid: Indicates that the response payload is invalid, for example because it failed some validation rules set in the validation handler.

In some examples, the validation handler510may validate an input (e.g., JSON input), or request payload, representing the prompt sent to the GenAI Model505or a response payload from the GenAI Model505, respectively, against predefined criteria such as criteria stored in the error criteria module517. If a validation is not satisfied, additional validation handler510logs may be used to further process the input or response to facilitate accurate translation into the correct format (e.g., JSON, etc.). In some examples, an error may be due to an improper prompt, a validation error, a system unavailability, or a data-interpretability error, etc. Due to this uncertainty, a quantity of retires triggered from the validation handler510may be tracked periodically, according to a schedule, or substantially in real-time. The quantity of retries may be returned to the DA/Chatbot System507and/or the client device525as subsequent retires are prepared for transmission. A developer may define a rule (and/or modify a default rule) that indicates when retries are to be terminated (e.g., by way of developer pathways522and VFD LLM component516). In addition, or alternatively, the user may define the rules as well.

In some examples, functions for the validation handler510may be written during the creation of the validation handler510. A service validation handler (e.g., a REST service) may be created by way of an interface (e.g., GUI of the DA/Chatbot System507) and/or a Bots-Node-SDK Command Line Interface (e.g., an Oracle Bots-Node-SDK Command Line Interface). By way of example, a first argument of each event method may be an event object. The properties available in this event object may depend on a type of event. A second argument of each event method may include a context object. The object may reference a GenAI Model505context function (e.g., LLMContext) that may provide access to create the functions for the validation handler510.

In some examples, the validation handler510may include, without limitation, several functions. For example, the validation handler510may include a validateRequestPayload function to validate or invalidate the request payload550to fix a prompt (e.g., prompt associated with utterance502a) and send the prompt to the GenAI Model505, and/or set a validation error. The validation handler510may also include a validateResponsePayload function that may validate or invalidate a response payload from the GenAI Models505that may retry sending the request payload550by invoking the GenAI Models505again using a retry prompt that specifics what was wrong and asking the GenAI Model505to fix it, for example because the response payload does not conform to a specific format (e.g., JSON, preferred prompt format, etc.) that was requested in the initial prompt. In addition, or alternatively, a validation error may be defined (discussed in more detail further on).

In some examples, if the validation handler510has provided a modelLengthExceeded error code, the VFD LLM Component516may try to automatically handle the error by performing, without limitation, a check if there are previous refinement turns in the chat history within the LLM component state519were invoked. For example, when a GenAI Model505has returned a response payload, and the user or developer has requested a refinement, and the GenAI Model505returned a new version of the response payload. In an instance when previous refinement turns exist, one or more components of the VFD LLM Component516may remove the oldest refinement turn, which may include a user refinement message and GenAI Interface508“response”, and invoke the GenAI Model505again. The “loop” may continue until the GenAI Models505succeeds or when there are no more prior refinement turns to remove. In addition, or alternatively, if the GenAI Model505is unable to provide an adequate response (e.g., continues to fail while there are no refinement turns), the error transition action may be set and the error may be stored as a context variable for future reference. In some examples, the number of retries trigger from event handlers may allow the user and/or developer to easily check the number of retries that have been done before prior to attempting another retry prompt.

In some embodiments, the GenAI Interface508executes one or more actions responsive to determining that the response payload from the GenAI Providers503includes an error or invalid data (e.g., as discussed previously). The GenAI Interface508includes an action module(s)520and other action module(s)521. The action module(s)520performs an operation when the error or invalid data is determined to exist in the response payload. The operation may include, without limitation, modifying the request payload based on the error or invalid data to generate a modified request payload where the modified request payload may include an instruction that informs the GenAI Model Providers503, the GenAI models505, or both of missing matches and requests that the GenAI Model Providers503, the GenAI Model505, or both to revise the response payload to include the values for the entities associated with missing matches, and communicating the modified request payload to the GenAI Model Providers503for processing by the GenAI model505, notifying the user of the error or invalid data, transmitting a notification to the client device525of the error or invalid data, logging of the error or invalid data in memory, modifying the request payload based on the error or invalid data to generate a modified request payload such that the modified request payload includes an instruction that informs the GenAI Model Providers503, the GenAI Model505, or both of the error or invalid data and requests that the GenAI Model Providers503, the GenAI Model505, or both correct the error or invalid data, modifying the response payload based on the error or invalid data to generate a modified response payload such that the modified response payload includes and instruction that informs the GenAI Model Providers503, the GenAI Model505, or both of the error or invalid data and requests that the GenAI Model Providers503, the GenAI Model505, or both correct the error or invalid data, or combinations thereof.

In some embodiments, the other action module(s)521may perform an operation when the error or invalid data is not found in the response payload. For example, the operation may include, without limitation, transmitting the custom response payload to the client device525, logging the custom response payload data in memory, communicating the successful response payload to the GenAI Model Providers503for processing by the GenAI Model505for training, or combinations thereof.

Large Language Model Handling OOS and OOD Detection for Digital Assistant

FIG.6illustrates the handling of OOS and OOD detection and subsequent state or flow transition in accordance with various embodiments. As shown, a user may be engaged with a digital assistant/chatbot system600in one or more conversations605(in some instances its multiple conversations). A first utterance610amay be communicated by a user to the digital assistant/chatbot system600. As discussed in detail with respect toFIGS.1-3, the digital assistant/chatbot system600determines if the first utterance610aexplicitly identifies a skill bot using its invocation name. If an invocation name is present in the user input, then it is treated as explicit invocation of the skill bot corresponding to the invocation name (e.g., skill bot615a). In such a scenario, the digital assistant600may route the first utterance610ato the explicitly invoked skill bot for further handling.

If there is no specific or explicit invocation, in some embodiments, the digital assistant600evaluates the first utterance610aand computes confidence scores for the system intents and the skill bots615a-nassociated with the digital assistant600, as discussed in detail with respect toFIGS.1-3. The score computed for a skill bot615a-nor system intent represents how likely the first utterance610ais representative of a task that the skill bot615a-nis configured to perform or is representative of a system intent. Any system intent or skill bot615a-nwith an associated computed confidence score exceeding a threshold value (e.g., a Confidence Threshold routing parameter) is selected as a candidate for further evaluation. The digital assistant600then selects, from the identified candidates, a particular system intent or a skill bot (e.g., skill bot615a) for further handling of the first utterance610a. In some embodiments, after one or more skill bots are identified as candidates, the intents associated with those candidate skills are evaluated (according to the intent model for each skill) and confidence scores are determined for each intent. In general, any intent that has a confidence score exceeding a threshold value (e.g., 70%) is treated as a candidate intent. If a particular skill bot (e.g., skill bot615a) is selected, then the first utterance610ais routed to that skill bot for further processing. If a system intent is selected, then one or more actions are performed by the master bot620itself according to the selected system intent.

Once the master bot620or a skill bot (e.g., skill bot615a) is identified for further handling of the first utterance610a, then the digital assistant600(e.g., conversation manager330as described with respect toFIG.3) will initiate a conversation605with the user. The conversation605initiated is a conversation specific to the intent identified by the intent classifier. For instance, the conversation manager may be implemented using a state machine configured to execute a dialog flow625a-n(also described herein as a flow or workflow) for the identified intent. A dialog flow625a-nspecified for a skill bot (e.g., skill bot615a) describes how the skill bot reacts as different intents for the skill bot are resolved responsive to received user input. The dialog flow625a-ndefines operations or actions that a skill bot will take, e.g., how the skill bot responds to user utterances, how the skill bot prompts users for input, how the skill bot returns data. The dialog flow definition for a skill bot acts as a model for the conversation itself, one that lets the skill bot designer choreograph the interactions between a skill bot and the users that the skill bot services. The state machine can include a default starting state (e.g., for when the intent is invoked without any additional input) and one or more additional states, where each state has associated with it actions to be performed by the skill bot (e.g., executing a purchase transaction) and/or dialog (e.g., questions, responses) to be presented to the user. Thus, the conversation manager can determine an action/dialog upon receiving the indication identifying the intent and can determine additional actions or dialog in response to subsequent utterances received during the conversation.

Using the Invoke Large Language Model component (the LLM component-described in detail with respect toFIGS.4and5), a skill bot developer can plug LLM capabilities into their dialog flow625a-nwherever they're needed (see, e.g., LLM component #1in dialog flow625A or LLM component #1in dialog flow625N). This dialog flow component is the primary integration piece for generative AI in that it contacts the LLM through a call (e.g., REST call), then sends the LLM a prompt (the natural language instructions to the LLM) along with related parameters. It then returns the results generated by the model (which are also known as completions) and manages the state of the LLM-user interactions so that its responses remain in context after successive rounds of user queries and feedback. The LLM component can call any LLM. A user can add one or more LLM component states (or LLM blocks) to flows. A user can also chain the LLM calls so that the output of one LLM request can be passed to a subsequent LLM request. See the description ofFIGS.4and5for a detailed explanation of using LLMs via the LLM component.

With respect to the LLM component, OOS and OOD detection presents unique challenges because once a user is interacting with the LLM the user may present the LLM with utterances that are OOS and/or OOD for the present skill and associated LLM component (see, e.g., utterance610dand Skill Bot #1), and thus get stuck in the conversation with the LLM. It is important for the LLM to be able to identify such OOS and OOD utterances such that proper responsive actions can be taken. In particular, when multi-turn conversations have been enabled, OOS and OOD detection is important for the response refinements and follow-up queries. For example, upon detecting an OOS or OOD utterance, the LLM should be able to end the conversation and allow for the current skill bot to either proceed with the dialog flow for a given intent (e.g., proceed to Dialog #1in Flow625A) or a context aware router to route the utterance from the current skill bot such as Skill Bot #1to the most relevant skill bot such as Skill Bot #2(i.e., state or flow transition).

When the LLM identifies OOS and OOD utterances, it generates an invalid input variable to trigger transitions to other states (e.g., Dialog #1in Flow625A) or flows (e.g., Flow625B or625N). To enable the LLM to handle OOS and OOD detection and generate an invalid input variable, various prompt engineering techniques are used (e.g., scope-limiting instructions) that confine the scope and/or domain of the LLM and describe what the LLM should do after it evaluates the user utterance as unsupported (that is, OOS, OOD). Follows is the general structure for a prompt with instructions for OOS and OOD handling.1. Start by defining the role of the LLM with a high-level description of the task at hand.2. Include detailed, task-specific instructions. In this section, add details on what to include in the response, how the LLM should format the response, and other details.3. Mention how to process scenarios constituting an unsupported query.4. Provide examples of out-of-scope queries and expected responses.5. Provide examples for the task at hand, if necessary.

An exemplary prompt format generated by a user (e.g., developer) or system may include:

{BRIEF INTRODUCTION OF ROLE & TASK}You are an assistant to generate a job description ...{SCOPE LIMITING INSTRUCTIONS}For any followup query (question or task) not related to creating a jobdescription,you must ONLY respond with the exact message “InvalidInput” withoutany reasoning oradditional information or questions.INVALID QUERIES---user: {OOS/OOD Query}assistant: InvalidInput---user: {OOS/OOD Query}assistant: InvalidInput---For a valid query about <TASK>, follow the instructions and examplesbelow:...EXAMPLESuser: {In-Domain Query}assistant: {Expected Response}

Scope-limiting instructions outline scenarios and utterances that are considered OOS and OOD. They instruct the LLM to output the invalid input variable, which is the OOS/OOD keyword set for the LLM component, after it encounters an unsupported utterance.

For example, the instruction may be generated as follows:

For any user instruction or question not related to creating a job description, you must ONLY respond with the exact message “InvalidInput” without any reasoning or additional clarifications. Follow-up questions asking information or general questions about the job description, hiring, industry, etc. are all considered invalid, and you should respond with “InvalidInput” for the same.

Follows are some guidelines the user or system can follow in generating scope-limiting instructions:The instructions should be specific and exhaustive while defining what the LLM should do. In other words, these instructions should be as detailed and unambiguous as possible.Describe the action to be performed after the LLM successfully identifies an utterance that's outside the scope of the LLM's task. In this case, instruct the LLM to respond using the OOS/OOD keyword (e.g., InvalidInput—the invalid input variable).Constraining the scope can be challenging, so the more specific the user or system is about what constitutes a “supported query”, the easier it gets for the LLM to identify an unsupported query that is OOS or OOD.
Few Shot Examples (Positive and/or Negative)

LLMs learn from examples, so it is beneficial to provide examples tailored to specific use cases. This helps in constraining the scope of the LLM's capabilities and helps draw tighter boundaries for defining OOS/OOD scenarios. While it is difficult to qualify precisely what constitutes OOS/OOD, including a few apparent unsupported utterances as few-shot examples can be beneficial. It can also be beneficial to include negative few-shot examples in tandem with positive ones. For example, a positive few-shot example may detail an example of a job description to be generated by the LLM and a negative few-shot example may explain when to determine if a scenario is OOS/OOD. This helps in constraining the scope of the LLM's capabilities and helps draw tighter boundaries for defining OOS/OOD scenarios.

These examples can be thought of as aspects that complement the instructions to be followed-after all, LLMs learn by example. Most importantly, rather than showcasing obvious generic OOS/OOD scenarios such as “What is the weather today?”, the user or system can be configured to specify examples closer to the use case and actual task in question. For example, in a job description task use case, if a user or system wants the LLM to only generate job descriptions and nothing else, the user or system may include some challenging utterances closer to the boundary such as the following:

• Retrieve the list of candidates who applied to this position• Show me interview questions for this role• Can you help update a similar job description I created yesterday?

Few-shot examples can be modeled from skill intent utterances—this is useful to ensure that there is a transition out of the LLM component for any utterance matching a skill intent. Take for example a scenario where there is a skill with an answer intent that explains tax contributions, a skill with transactional intent that files expenses, and the LLM block for creating job descriptions. In this case, the prompt can be generated to include some commonly encountered utterances as few-shot examples so that the LLM does not hallucinate on responses to be retrieved from the answerer or transactional intent:

• What's the difference between Roth and 401k?• Please file an expense for me• How do tax contributions work?

As for structure in the prompt, the few-shot examples can be in included the prompt as a section and coupled along with the scope-limiting instructions→LLMs pick up instructions easier when suitable examples follow. Common failing queries can be appended to the few-shot examples list, but attention should be paid that the text does not exceed the prompt length. Additionally, as the conversation history and subsequently context size grows in length, the LLM accuracy may start to drop (e.g., after more than ˜3 turns, GPT 3.5 starts to hallucinate responses for OOS queries), thus it can be helpful to use minimal examples that are concise and cover the biggest issues the LLM may face when determining OOS/OOD utterances or tasks.

For conversations that include the LLM component (e.g., multi-turn conversations), once the LLM responds using the OOS/OOD keyword (e.g., InvalidInput—the invalid input variable), the digital assistant (e.g., conversation manager330as described with respect toFIG.3) is capable of the following transition capabilities (as described in greater detail with respect toFIGS.1-3):flow transition, the user wants to trigger another flow (e.g., flow625B), like a non-sequitur, it's very dynamic, for instance, the user wants to update the project details while she's working on the job description for that project or ask some questions.state transition, move to a designated state within the current flow (e.g., Action #2within the flow615A). Usually, there's a short list of actions that the user can do for the transition, some of them are very use-case specific and others are generic and may be provided out of the box.generic system actions:I'm done, for instance, if the user completes the edits on the job description, she simply said “I”m done”, and the dialog will be moved to the next state in which the job description is submitted to the system.start over: the context is cleared, removing all the previous interactions with the LLMgive up: discard the generated content and move to the state which is mapped to the action. NOTE: this is different than Exit system intent, Exit will exit the user from the current flow entirely.custom actionssend email, create a new email with the generated content and send it, etc.

FIG.7is a flowchart of a process700for using a LLM to detect OOS and OOD utterances input into a digital assistant in accordance with various embodiments. The processing depicted inFIG.7may be implemented in software (e.g., code, instructions, program) executed by one or more processing units (e.g., processors, cores) of the respective systems, hardware, or combinations thereof. The software may be stored on a non-transitory storage medium (e.g., on a memory device). The process presented inFIG.7and described below is intended to be illustrative and non-limiting. AlthoughFIG.7illustrates the various processing steps occurring in a particular sequence or order, this is not intended to be limiting. In certain alternative embodiments, the steps may be performed in some different order or some steps may also be performed at least partially in parallel. The example method700may be performed by some or all components of any device, system, or apparatus illustrated and described herein with respect toFIGS.1-6and8-12.

The process700may begin at step705where an utterance is routed to a skill bot. The skill bot is configured to execute an action for completing a task associated with the utterance, and a workflow associated with the action includes a generative artificial intelligence (GenAI) component state configured to facilitate completion of at least part of the task. In some instances, the utterance is received from a user during a session with a digital assistant, an intent of the user is determined based on the utterance using one or more machine learning models, the skill bot is identified based on the intent, and the action for completing the task associated with the utterance is identified by the skill bot.

At step710, a prompt is generated by the GenAI component state. The prompt is generated to include the utterance and one or more scope-related elements based on a prompt template. The one or more scope-related elements (as described in greater detail with respect toFIG.6) include: (i) one or more scenarios, (ii) one or more negative few-shot examples that are considered out of scope (OOS) or out of domain (OOD), and (iii) instructions that teach a GenAI model to output an invalid input variable when the GenAI model determines an utterance is OOS or OOD. In some instances, the prompt further includes: (i) a definition of a role or persona for the GenAI model and (ii) a description of the task. The one or more scenarios may comprise an invalid scenario, and the one or more negative few-shot examples are associated with the invalid scenario. In some instances, the prompt further includes one or more positive few-shot examples, which include: (i) one or more additional example utterances that are considered to be in-scope or in-domain (not OOS or OOD), and (ii) instructions that teach the GenAI model to output a response based on sample responses that enforce format and structure of the response to be generated when an utterance is determined to be in-scope or in-domain (not OOS or OOD). The one or more scenarios may further comprise a valid scenario, and the one or more positive few-shot examples are associated with the valid scenario.

At step715, the GenAI component state communicates the prompt to a GenAI provider for processing by the GenAI model (as described in greater detail with respect toFIGS.4and5).

At step720, the GenAI component state receives from the GenAI model provider, a response generated by the GenAI model processing the prompt. When the GenAI model determines the utterance is OOS or OOD as part of the processing the prompt, the response includes the invalid input variable. When the GenAI model determines the utterance is in-scope or in-domain (not OOS or OOD) as part of the processing the prompt, the response does not include the invalid input variable. Responsive to the response not including the invalid input variable, the GenAI component state is maintained. In other words, the interaction with the GenAI model continues (e.g., subsequent utterances and/or actions may be processed by the GenAI model).

At step725, responsive to the response including the invalid input variable, the GenAI component state transitions to another state different from that of the GenAI component state another workflow different from the workflow associated with the action. The state transition can be dictated or controlled via the workflow (e.g., the next state or action to be executed for completing the task associated with the utterance). In some instances, the GenAI component state is a multi-turn interaction with the GenAI model and the workflow further includes the another state. In other instances, the GenAI component state is a multi-turn interaction with the GenAI model and the another state is associated with the another workflow that is different from the workflow.

In some instances, the another state is another GenAI component state different from the GenAI component state, and the process700further comprises: generating, by the another GenAI component state, another prompt to include the utterance or another utterance and one or more scope-related elements based on another prompt template; communicating, by the another GenAI component state, the another prompt to another GenAI provider for processing by another GenAI model; receiving, at the another GenAI component state from the another GenAI model provider, another response generated by the another GenAI model processing the another prompt, wherein when the another GenAI model determines the another utterance is OOS or OOD as part of the processing the another prompt, the another response includes the invalid input variable; and responsive to the another response including the invalid input variable, transitioning from the another GenAI component state to a different state or a different workflow.

Illustrative Systems

As noted above, infrastructure as a service (IaaS) is one particular type of cloud computing. IaaS can be configured to provide virtualized computing resources over a public network (e.g., the Internet). In an IaaS model, a cloud computing provider can host the infrastructure components (e.g., servers, storage devices, network nodes (e.g., hardware), deployment software, platform virtualization (e.g., a hypervisor layer), or the like). In some cases, an IaaS provider may also supply a variety of services to accompany those infrastructure components (example services include billing software, monitoring software, logging software, load balancing software, clustering software, etc.). Thus, as these services may be policy-driven, IaaS users may be able to implement policies to drive load balancing to maintain application availability and performance.

FIG.8is a block diagram800illustrating an example pattern of an IaaS architecture, according to at least one embodiment. Service operators802can be communicatively coupled to a secure host tenancy804that can include a virtual cloud network (VCN)806and a secure host subnet808. In some examples, the service operators802may be using one or more client computing devices, which may be portable handheld devices (e.g., an iPhone®, cellular telephone, an iPad®, computing tablet, a personal digital assistant (PDA)) or wearable devices (e.g., a Google Glass® head mounted display), running software such as Microsoft Windows Mobile®, and/or a variety of mobile operating systems such as iOS, Windows Phone, Android, BlackBerry 8, Palm OS, and the like, and being Internet, e-mail, short message service (SMS), Blackberry®, or other communication protocol enabled. Alternatively, the client computing devices can be general purpose personal computers including, by way of example, personal computers and/or laptop computers running various versions of Microsoft Windows®, Apple Macintosh®, and/or Linux operating systems. The client computing devices can be workstation computers running any of a variety of commercially-available UNIX® or UNIX-like operating systems, including without limitation the variety of GNU/Linux operating systems, such as for example, Google Chrome OS. Alternatively, or in addition, client computing devices may be any other electronic device, such as a thin-client computer, an Internet-enabled gaming system (e.g., a Microsoft Xbox gaming console with or without a Kinect® gesture input device), and/or a personal messaging device, capable of communicating over a network that can access the VCN806and/or the Internet.

The VCN806can include a local peering gateway (LPG)810that can be communicatively coupled to a secure shell (SSH) VCN812via an LPG810contained in the SSH VCN812. The SSH VCN812can include an SSH subnet814, and the SSH VCN812can be communicatively coupled to a control plane VCN816via the LPG810contained in the control plane VCN816. Also, the SSH VCN812can be communicatively coupled to a data plane VCN818via an LPG810. The control plane VCN816and the data plane VCN818can be contained in a service tenancy819that can be owned and/or operated by the IaaS provider.

The control plane VCN816can include a control plane demilitarized zone (DMZ) tier820that acts as a perimeter network (e.g., portions of a corporate network between the corporate intranet and external networks). The DMZ-based servers may have restricted responsibilities and help keep breaches contained. Additionally, the DMZ tier820can include one or more load balancer (LB) subnet(s)822, a control plane app tier824that can include app subnet(s)826, a control plane data tier828that can include database (DB) subnet(s)830(e.g., frontend DB subnet(s) and/or backend DB subnet(s)). The LB subnet(s)822contained in the control plane DMZ tier820can be communicatively coupled to the app subnet(s)826contained in the control plane app tier824and an Internet gateway834that can be contained in the control plane VCN816, and the app subnet(s)826can be communicatively coupled to the DB subnet(s)830contained in the control plane data tier828and a service gateway836and a network address translation (NAT) gateway838. The control plane VCN816can include the service gateway836and the NAT gateway838.

The control plane VCN816can include a data plane mirror app tier840that can include app subnet(s)826. The app subnet(s)826contained in the data plane mirror app tier840can include a virtual network interface controller (VNIC)842that can execute a compute instance844. The compute instance844can communicatively couple the app subnet(s)826of the data plane mirror app tier840to app subnet(s)826that can be contained in a data plane app tier846.

The data plane VCN818can include the data plane app tier846, a data plane DMZ tier848, and a data plane data tier850. The data plane DMZ tier848can include LB subnet(s)822that can be communicatively coupled to the app subnet(s)826of the data plane app tier846and the Internet gateway834of the data plane VCN818. The app subnet(s)826can be communicatively coupled to the service gateway836of the data plane VCN818and the NAT gateway838of the data plane VCN818. The data plane data tier850can also include the DB subnet(s)830that can be communicatively coupled to the app subnet(s)826of the data plane app tier846.

The Internet gateway834of the control plane VCN816and of the data plane VCN818can be communicatively coupled to a metadata management service852that can be communicatively coupled to public Internet854. Public Internet854can be communicatively coupled to the NAT gateway838of the control plane VCN816and of the data plane VCN818. The service gateway836of the control plane VCN816and of the data plane VCN818can be communicatively coupled to cloud services856.

In some examples, the service gateway836of the control plane VCN816or of the data plane VCN818can make application programming interface (API) calls to cloud services856without going through public Internet854. The API calls to cloud services856from the service gateway836can be one-way: the service gateway836can make API calls to cloud services856, and cloud services856can send requested data to the service gateway836. But, cloud services856may not initiate API calls to the service gateway836.

In some examples, the secure host tenancy804can be directly connected to the service tenancy819, which may be otherwise isolated. The secure host subnet808can communicate with the SSH subnet814through an LPG810that may enable two-way communication over an otherwise isolated system. Connecting the secure host subnet808to the SSH subnet814may give the secure host subnet808access to other entities within the service tenancy819.

The control plane VCN816may allow users of the service tenancy819to set up or otherwise provision desired resources. Desired resources provisioned in the control plane VCN816may be deployed or otherwise used in the data plane VCN818. In some examples, the control plane VCN816can be isolated from the data plane VCN818, and the data plane mirror app tier840of the control plane VCN816can communicate with the data plane app tier846of the data plane VCN818via VNICs842that can be contained in the data plane mirror app tier840and the data plane app tier846.

In some examples, users of the system, or customers, can make requests, for example create, read, update, or delete (CRUD) operations, through public Internet854that can communicate the requests to the metadata management service852. The metadata management service852can communicate the request to the control plane VCN816through the Internet gateway834. The request can be received by the LB subnet(s)822contained in the control plane DMZ tier820. The LB subnet(s)822may determine that the request is valid, and in response to this determination, the LB subnet(s)822can transmit the request to app subnet(s)826contained in the control plane app tier824. If the request is validated and requires a call to public Internet854, the call to public Internet854may be transmitted to the NAT gateway838that can make the call to public Internet854. Metadata that may be desired to be stored by the request can be stored in the DB subnet(s)830.

In some examples, the data plane mirror app tier840can facilitate direct communication between the control plane VCN816and the data plane VCN818. For example, changes, updates, or other suitable modifications to configuration may be desired to be applied to the resources contained in the data plane VCN818. Via a VNIC842, the control plane VCN816can directly communicate with, and can thereby execute the changes, updates, or other suitable modifications to configuration to, resources contained in the data plane VCN818.

In some embodiments, the control plane VCN816and the data plane VCN818can be contained in the service tenancy819. In this case, the user, or the customer, of the system may not own or operate either the control plane VCN816or the data plane VCN818. Instead, the IaaS provider may own or operate the control plane VCN816and the data plane VCN818, both of which may be contained in the service tenancy819. This embodiment can enable isolation of networks that may prevent users or customers from interacting with other users', or other customers', resources. Also, this embodiment may allow users or customers of the system to store databases privately without needing to rely on public Internet854, which may not have a desired level of threat prevention, for storage.

In other embodiments, the LB subnet(s)822contained in the control plane VCN816can be configured to receive a signal from the service gateway836. In this embodiment, the control plane VCN816and the data plane VCN818may be configured to be called by a customer of the IaaS provider without calling public Internet854. Customers of the IaaS provider may desire this embodiment since database(s) that the customers use may be controlled by the IaaS provider and may be stored on the service tenancy819, which may be isolated from public Internet854.

FIG.9is a block diagram900illustrating another example pattern of an IaaS architecture, according to at least one embodiment. Service operators902(e.g., service operators802ofFIG.8) can be communicatively coupled to a secure host tenancy904(e.g., the secure host tenancy804ofFIG.8) that can include a virtual cloud network (VCN)906(e.g., the VCN806ofFIG.8) and a secure host subnet908(e.g., the secure host subnet808ofFIG.8). The VCN906can include a local peering gateway (LPG)910(e.g., the LPG810ofFIG.8) that can be communicatively coupled to a secure shell (SSH) VCN912(e.g., the SSH VCN812ofFIG.8) via an LPG810contained in the SSH VCN912. The SSH VCN912can include an SSH subnet914(e.g., the SSH subnet814ofFIG.8), and the SSH VCN912can be communicatively coupled to a control plane VCN916(e.g., the control plane VCN816ofFIG.8) via an LPG910contained in the control plane VCN916. The control plane VCN916can be contained in a service tenancy919(e.g., the service tenancy819ofFIG.8), and the data plane VCN918(e.g., the data plane VCN818ofFIG.8) can be contained in a customer tenancy921that may be owned or operated by users, or customers, of the system.

The control plane VCN916can include a control plane DMZ tier920(e.g., the control plane DMZ tier820ofFIG.8) that can include LB subnet(s)922(e.g., LB subnet(s)822ofFIG.8), a control plane app tier924(e.g., the control plane app tier824ofFIG.8) that can include app subnet(s)926(e.g., app subnet(s)826ofFIG.8), a control plane data tier928(e.g., the control plane data tier828ofFIG.8) that can include database (DB) subnet(s)930(e.g., similar to DB subnet(s)830ofFIG.8). The LB subnet(s)922contained in the control plane DMZ tier920can be communicatively coupled to the app subnet(s)926contained in the control plane app tier924and an Internet gateway934(e.g., the Internet gateway834ofFIG.8) that can be contained in the control plane VCN916, and the app subnet(s)926can be communicatively coupled to the DB subnet(s)930contained in the control plane data tier928and a service gateway936(e.g., the service gateway836ofFIG.8) and a network address translation (NAT) gateway938(e.g., the NAT gateway838ofFIG.8). The control plane VCN916can include the service gateway936and the NAT gateway938.

The control plane VCN916can include a data plane mirror app tier940(e.g., the data plane mirror app tier840ofFIG.8) that can include app subnet(s)926. The app subnet(s)926contained in the data plane mirror app tier940can include a virtual network interface controller (VNIC)942(e.g., the VNIC of842) that can execute a compute instance944(e.g., similar to the compute instance844ofFIG.8). The compute instance944can facilitate communication between the app subnet(s)926of the data plane mirror app tier940and the app subnet(s)926that can be contained in a data plane app tier946(e.g., the data plane app tier846ofFIG.8) via the VNIC942contained in the data plane mirror app tier940and the VNIC942contained in the data plane app tier946.

The Internet gateway934contained in the control plane VCN916can be communicatively coupled to a metadata management service952(e.g., the metadata management service852ofFIG.8) that can be communicatively coupled to public Internet954(e.g., public Internet854ofFIG.8). Public Internet954can be communicatively coupled to the NAT gateway938contained in the control plane VCN916. The service gateway936contained in the control plane VCN916can be communicatively coupled to cloud services956(e.g., cloud services856ofFIG.8).

In some examples, the data plane VCN918can be contained in the customer tenancy921. In this case, the IaaS provider may provide the control plane VCN916for each customer, and the IaaS provider may, for each customer, set up a unique compute instance944that is contained in the service tenancy919. Each compute instance944may allow communication between the control plane VCN916, contained in the service tenancy919, and the data plane VCN918that is contained in the customer tenancy921. The compute instance944may allow resources, that are provisioned in the control plane VCN916that is contained in the service tenancy919, to be deployed or otherwise used in the data plane VCN918that is contained in the customer tenancy921.

In other examples, the customer of the IaaS provider may have databases that live in the customer tenancy921. In this example, the control plane VCN916can include the data plane mirror app tier940that can include app subnet(s)926. The data plane mirror app tier940can reside in the data plane VCN918, but the data plane mirror app tier940may not live in the data plane VCN918. That is, the data plane mirror app tier940may have access to the customer tenancy921, but the data plane mirror app tier940may not exist in the data plane VCN918or be owned or operated by the customer of the IaaS provider. The data plane mirror app tier940may be configured to make calls to the data plane VCN918but may not be configured to make calls to any entity contained in the control plane VCN916. The customer may desire to deploy or otherwise use resources in the data plane VCN918that are provisioned in the control plane VCN916, and the data plane mirror app tier940can facilitate the desired deployment, or other usage of resources, of the customer.

In some embodiments, the customer of the IaaS provider can apply filters to the data plane VCN918. In this embodiment, the customer can determine what the data plane VCN918can access, and the customer may restrict access to public Internet954from the data plane VCN918. The IaaS provider may not be able to apply filters or otherwise control access of the data plane VCN918to any outside networks or databases. Applying filters and controls by the customer onto the data plane VCN918, contained in the customer tenancy921, can help isolate the data plane VCN918from other customers and from public Internet954.

In some embodiments, cloud services956can be called by the service gateway936to access services that may not exist on public Internet954, on the control plane VCN916, or on the data plane VCN918. The connection between cloud services956and the control plane VCN916or the data plane VCN918may not be live or continuous. Cloud services956may exist on a different network owned or operated by the IaaS provider. Cloud services956may be configured to receive calls from the service gateway936and may be configured to not receive calls from public Internet954. Some cloud services956may be isolated from other cloud services956, and the control plane VCN916may be isolated from cloud services956that may not be in the same region as the control plane VCN916. For example, the control plane VCN916may be located in “Region1,” and cloud service “Deployment8,” may be located in Region1and in “Region2.” If a call to Deployment8is made by the service gateway936contained in the control plane VCN916located in Region1, the call may be transmitted to Deployment8in Region1. In this example, the control plane VCN916, or Deployment8in Region1, may not be communicatively coupled to, or otherwise in communication with, Deployment8in Region2.

FIG.10is a block diagram1000illustrating another example pattern of an IaaS architecture, according to at least one embodiment. Service operators1002(e.g., service operators802ofFIG.8) can be communicatively coupled to a secure host tenancy1004(e.g., the secure host tenancy804ofFIG.8) that can include a virtual cloud network (VCN)1006(e.g., the VCN806ofFIG.8) and a secure host subnet1008(e.g., the secure host subnet808ofFIG.8). The VCN1006can include an LPG1010(e.g., the LPG810ofFIG.8) that can be communicatively coupled to an SSH VCN1012(e.g., the SSH VCN812ofFIG.8) via an LPG1010contained in the SSH VCN1012. The SSH VCN1012can include an SSH subnet1014(e.g., the SSH subnet814ofFIG.8), and the SSH VCN1012can be communicatively coupled to a control plane VCN1016(e.g., the control plane VCN816ofFIG.8) via an LPG1010contained in the control plane VCN1016and to a data plane VCN1018(e.g., the data plane818ofFIG.8) via an LPG1010contained in the data plane VCN1018. The control plane VCN1016and the data plane VCN1018can be contained in a service tenancy1019(e.g., the service tenancy819ofFIG.8).

The control plane VCN1016can include a control plane DMZ tier1020(e.g., the control plane DMZ tier820ofFIG.8) that can include load balancer (LB) subnet(s)1022(e.g., LB subnet(s)822ofFIG.8), a control plane app tier1024(e.g., the control plane app tier824ofFIG.8) that can include app subnet(s)1026(e.g., similar to app subnet(s)826ofFIG.8), a control plane data tier1028(e.g., the control plane data tier828ofFIG.8) that can include DB subnet(s)1030. The LB subnet(s)1022contained in the control plane DMZ tier1020can be communicatively coupled to the app subnet(s)1026contained in the control plane app tier1024and to an Internet gateway1034(e.g., the Internet gateway834ofFIG.8) that can be contained in the control plane VCN1016, and the app subnet(s)1026can be communicatively coupled to the DB subnet(s)1030contained in the control plane data tier1028and to a service gateway1036(e.g., the service gateway ofFIG.8) and a network address translation (NAT) gateway1038(e.g., the NAT gateway838ofFIG.8). The control plane VCN1016can include the service gateway1036and the NAT gateway1038.

The data plane VCN1018can include a data plane app tier1046(e.g., the data plane app tier846ofFIG.8), a data plane DMZ tier1048(e.g., the data plane DMZ tier848ofFIG.8), and a data plane data tier1050(e.g., the data plane data tier850ofFIG.8). The data plane DMZ tier1048can include LB subnet(s)1022that can be communicatively coupled to trusted app subnet(s)1060and untrusted app subnet(s)1062of the data plane app tier1046and the Internet gateway1034contained in the data plane VCN1018. The trusted app subnet(s)1060can be communicatively coupled to the service gateway1036contained in the data plane VCN1018, the NAT gateway1038contained in the data plane VCN1018, and DB subnet(s)1030contained in the data plane data tier1050. The untrusted app subnet(s)1062can be communicatively coupled to the service gateway1036contained in the data plane VCN1018and DB subnet(s)1030contained in the data plane data tier1050. The data plane data tier1050can include DB subnet(s)1030that can be communicatively coupled to the service gateway1036contained in the data plane VCN1018.

The untrusted app subnet(s)1062can include one or more primary VNICs1064(1)-(N) that can be communicatively coupled to tenant virtual machines (VMs)1066(1)-(N). Each tenant VM1066(1)-(N) can be communicatively coupled to a respective app subnet1067(1)-(N) that can be contained in respective container egress VCNs1068(1)-(N) that can be contained in respective customer tenancies1070(1)-(N). Respective secondary VNICs1072(1)-(N) can facilitate communication between the untrusted app subnet(s)1062contained in the data plane VCN1018and the app subnet contained in the container egress VCNs1068(1)-(N). Each container egress VCNs1068(1)-(N) can include a NAT gateway1038that can be communicatively coupled to public Internet1054(e.g., public Internet854ofFIG.8).

The Internet gateway1034contained in the control plane VCN1016and contained in the data plane VCN1018can be communicatively coupled to a metadata management service1052(e.g., the metadata management system852ofFIG.8) that can be communicatively coupled to public Internet1054. Public Internet1054can be communicatively coupled to the NAT gateway1038contained in the control plane VCN1016and contained in the data plane VCN1018. The service gateway1036contained in the control plane VCN1016and contained in the data plane VCN1018can be communicatively coupled to cloud services1056.

In some examples, the customer of the IaaS provider may grant temporary network access to the IaaS provider and request a function to be attached to the data plane app tier1046. Code to run the function may be executed in the VMs1066(1)-(N), and the code may not be configured to run anywhere else on the data plane VCN1018. Each VM1066(1)-(N) may be connected to one customer tenancy1070. Respective containers1071(1)-(N) contained in the VMs1066(1)-(N) may be configured to run the code. In this case, there can be a dual isolation (e.g., the containers1071(1)-(N) running code, where the containers1071(1)-(N) may be contained in at least the VM1066(1)-(N) that are contained in the untrusted app subnet(s)1062), which may help prevent incorrect or otherwise undesirable code from damaging the network of the IaaS provider or from damaging a network of a different customer. The containers1071(1)-(N) may be communicatively coupled to the customer tenancy1070and may be configured to transmit or receive data from the customer tenancy1070. The containers1071(1)-(N) may not be configured to transmit or receive data from any other entity in the data plane VCN1018. Upon completion of running the code, the IaaS provider may kill or otherwise dispose of the containers1071(1)-(N).

In some embodiments, the trusted app subnet(s)1060may run code that may be owned or operated by the IaaS provider. In this embodiment, the trusted app subnet(s)1060may be communicatively coupled to the DB subnet(s)1030and be configured to execute CRUD operations in the DB subnet(s)1030. The untrusted app subnet(s)1062may be communicatively coupled to the DB subnet(s)1030, but in this embodiment, the untrusted app subnet(s) may be configured to execute read operations in the DB subnet(s)1030. The containers1071(1)-(N) that can be contained in the VM1066(1)-(N) of each customer and that may run code from the customer may not be communicatively coupled with the DB subnet(s)1030.

In other embodiments, the control plane VCN1016and the data plane VCN1018may not be directly communicatively coupled. In this embodiment, there may be no direct communication between the control plane VCN1016and the data plane VCN1018. However, communication can occur indirectly through at least one method. An LPG1010may be established by the IaaS provider that can facilitate communication between the control plane VCN1016and the data plane VCN1018. In another example, the control plane VCN1016or the data plane VCN1018can make a call to cloud services1056via the service gateway1036. For example, a call to cloud services1056from the control plane VCN1016can include a request for a service that can communicate with the data plane VCN1018.

FIG.11is a block diagram1100illustrating another example pattern of an IaaS architecture, according to at least one embodiment. Service operators1102(e.g., service operators802ofFIG.8) can be communicatively coupled to a secure host tenancy1104(e.g., the secure host tenancy804ofFIG.8) that can include a virtual cloud network (VCN)1106(e.g., the VCN806ofFIG.8) and a secure host subnet1108(e.g., the secure host subnet808ofFIG.8). The VCN1106can include an LPG1110(e.g., the LPG810ofFIG.8) that can be communicatively coupled to an SSH VCN1112(e.g., the SSH VCN812ofFIG.8) via an LPG1110contained in the SSH VCN1112. The SSH VCN1112can include an SSH subnet1114(e.g., the SSH subnet814ofFIG.8), and the SSH VCN1112can be communicatively coupled to a control plane VCN1116(e.g., the control plane VCN816ofFIG.8) via an LPG1110contained in the control plane VCN1116and to a data plane VCN1118(e.g., the data plane818ofFIG.8) via an LPG1110contained in the data plane VCN1118. The control plane VCN1116and the data plane VCN1118can be contained in a service tenancy1119(e.g., the service tenancy819ofFIG.8).

The control plane VCN1116can include a control plane DMZ tier1120(e.g., the control plane DMZ tier820ofFIG.8) that can include LB subnet(s)1122(e.g., LB subnet(s)822ofFIG.8), a control plane app tier1124(e.g., the control plane app tier824ofFIG.8) that can include app subnet(s)1126(e.g., app subnet(s)826ofFIG.8), a control plane data tier1128(e.g., the control plane data tier828ofFIG.8) that can include DB subnet(s)1130(e.g., DB subnet(s)1030ofFIG.10). The LB subnet(s)1122contained in the control plane DMZ tier1120can be communicatively coupled to the app subnet(s)1126contained in the control plane app tier1124and to an Internet gateway1134(e.g., the Internet gateway834ofFIG.8) that can be contained in the control plane VCN1116, and the app subnet(s)1126can be communicatively coupled to the DB subnet(s)1130contained in the control plane data tier1128and to a service gateway1136(e.g., the service gateway ofFIG.8) and a network address translation (NAT) gateway1138(e.g., the NAT gateway838ofFIG.8). The control plane VCN1116can include the service gateway1136and the NAT gateway1138.

The data plane VCN1118can include a data plane app tier1146(e.g., the data plane app tier846ofFIG.8), a data plane DMZ tier1148(e.g., the data plane DMZ tier848ofFIG.8), and a data plane data tier1150(e.g., the data plane data tier850ofFIG.8). The data plane DMZ tier1148can include LB subnet(s)1122that can be communicatively coupled to trusted app subnet(s)1160(e.g., trusted app subnet(s)1060ofFIG.10) and untrusted app subnet(s)1162(e.g., untrusted app subnet(s)1062ofFIG.10) of the data plane app tier1146and the Internet gateway1134contained in the data plane VCN1118. The trusted app subnet(s)1160can be communicatively coupled to the service gateway1136contained in the data plane VCN1118, the NAT gateway1138contained in the data plane VCN1118, and DB subnet(s)1130contained in the data plane data tier1150. The untrusted app subnet(s)1162can be communicatively coupled to the service gateway1136contained in the data plane VCN1118and DB subnet(s)1130contained in the data plane data tier1150. The data plane data tier1150can include DB subnet(s)1130that can be communicatively coupled to the service gateway1136contained in the data plane VCN1118.

The untrusted app subnet(s)1162can include primary VNICs1164(1)-(N) that can be communicatively coupled to tenant virtual machines (VMs)1166(1)-(N) residing within the untrusted app subnet(s)1162. Each tenant VM1166(1)-(N) can run code in a respective container1167(1)-(N), and be communicatively coupled to an app subnet1126that can be contained in a data plane app tier1146that can be contained in a container egress VCN1168. Respective secondary VNICs1172(1)-(N) can facilitate communication between the untrusted app subnet(s)1162contained in the data plane VCN1118and the app subnet contained in the container egress VCN1168. The container egress VCN can include a NAT gateway1138that can be communicatively coupled to public Internet1154(e.g., public Internet854ofFIG.8).

The Internet gateway1134contained in the control plane VCN1116and contained in the data plane VCN1118can be communicatively coupled to a metadata management service1152(e.g., the metadata management system852ofFIG.8) that can be communicatively coupled to public Internet1154. Public Internet1154can be communicatively coupled to the NAT gateway1138contained in the control plane VCN1116and contained in the data plane VCN1118. The service gateway1136contained in the control plane VCN1116and contained in the data plane VCN1118can be communicatively coupled to cloud services1156.

In some examples, the pattern illustrated by the architecture of block diagram1100ofFIG.11may be considered an exception to the pattern illustrated by the architecture of block diagram1000ofFIG.10and may be desirable for a customer of the IaaS provider if the IaaS provider cannot directly communicate with the customer (e.g., a disconnected region). The respective containers1167(1)-(N) that are contained in the VMs1166(1)-(N) for each customer can be accessed in real-time by the customer. The containers1167(1)-(N) may be configured to make calls to respective secondary VNICs1172(1)-(N) contained in app subnet(s)1126of the data plane app tier1146that can be contained in the container egress VCN1168. The secondary VNICs1172(1)-(N) can transmit the calls to the NAT gateway1138that may transmit the calls to public Internet1154. In this example, the containers1167(1)-(N) that can be accessed in real-time by the customer can be isolated from the control plane VCN1116and can be isolated from other entities contained in the data plane VCN1118. The containers1167(1)-(N) may also be isolated from resources from other customers.

In other examples, the customer can use the containers1167(1)-(N) to call cloud services1156. In this example, the customer may run code in the containers1167(1)-(N) that requests a service from cloud services1156. The containers1167(1)-(N) can transmit this request to the secondary VNICs1172(1)-(N) that can transmit the request to the NAT gateway that can transmit the request to public Internet1154. Public Internet1154can transmit the request to LB subnet(s)1122contained in the control plane VCN1116via the Internet gateway1134. In response to determining the request is valid, the LB subnet(s) can transmit the request to app subnet(s)1126that can transmit the request to cloud services1156via the service gateway1136.

It should be appreciated that IaaS architectures800,900,1000,1100depicted in the figures may have other components than those depicted. Further, the embodiments shown in the figures are only some examples of a cloud infrastructure system that may incorporate an embodiment of the disclosure. In some other embodiments, the IaaS systems may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration or arrangement of components.

FIG.12illustrates an example computer system1200, in which various embodiments may be implemented. The system1200may be used to implement any of the computer systems described above. As shown in the figure, computer system1200includes a processing unit1204that communicates with a number of peripheral subsystems via a bus subsystem1202. These peripheral subsystems may include a processing acceleration unit1206, an I/O subsystem1208, a storage subsystem1218and a communications subsystem1224. Storage subsystem1218includes tangible computer-readable storage media1222and a system memory1210.

Processing unit1204, which can be implemented as one or more integrated circuits (e.g., a conventional microprocessor or microcontroller), controls the operation of computer system1200. One or more processors may be included in processing unit1204. These processors may include single core or multicore processors. In some embodiments, processing unit1204may be implemented as one or more independent processing units1232and/or1234with single or multicore processors included in each processing unit. In other embodiments, processing unit1204may also be implemented as a quad-core processing unit formed by integrating two dual-core processors into a single chip.

In various embodiments, processing unit1204can execute a variety of programs in response to program code and can maintain multiple concurrently executing programs or processes. At any given time, some or all of the program code to be executed can be resident in processor(s)1204and/or in storage subsystem1218. Through suitable programming, processor(s)1204can provide various functionalities described above. Computer system1200may additionally include a processing acceleration unit1206, which can include a digital signal processor (DSP), a special-purpose processor, and/or the like.

Computer system1200may comprise a storage subsystem1218that provides a tangible non-transitory computer-readable storage medium for storing software and data constructs that provide the functionality of the embodiments described in this disclosure. The software can include programs, code modules, instructions, scripts, etc., that when executed by one or more cores or processors of processing unit1204provide the functionality described above. Storage subsystem1218may also provide a repository for storing data used in accordance with the present disclosure.

With respect to the example inFIG.12, storage subsystem1218can include various components including a system memory1210, computer-readable storage media1222, and a computer readable storage media reader1220. System memory1210may store program instructions that are loadable and executable by processing unit1204. System memory1210may also store data that is used during the execution of the instructions and/or data that is generated during the execution of the program instructions. Various different kinds of programs may be loaded into system memory1210including but not limited to client applications, Web browsers, mid-tier applications, relational database management systems (RDBMS), virtual machines, containers, etc.

System memory1210may also store an operating system1216. Examples of operating system1216may include various versions of Microsoft Windows®, Apple Macintosh®, and/or Linux operating systems, a variety of commercially-available UNIX® or UNIX-like operating systems (including without limitation the variety of GNU/Linux operating systems, the Google Chrome® OS, and the like) and/or mobile operating systems such as iOS, Windows® Phone, Android® OS, BlackBerry® OS, and Palm® OS operating systems. In certain implementations where computer system1200executes one or more virtual machines, the virtual machines along with their guest operating systems (GOSs) may be loaded into system memory1210and executed by one or more processors or cores of processing unit1204.

System memory1210can come in different configurations depending upon the type of computer system1200. For example, system memory1210may be volatile memory (such as random access memory (RAM)) and/or non-volatile memory (such as read-only memory (ROM), flash memory, etc.) Different types of RAM configurations may be provided including a static random access memory (SRAM), a dynamic random access memory (DRAM), and others. In some implementations, system memory1210may include a basic input/output system (BIOS) containing basic routines that help to transfer information between elements within computer system1200, such as during start-up.

Computer-readable storage media1222may represent remote, local, fixed, and/or removable storage devices plus storage media for temporarily and/or more permanently containing, storing, computer-readable information for use by computer system1200including instructions executable by processing unit1204of computer system1200.

Computer-readable storage media1222can include any appropriate media known or used in the art, including storage media and communication media, such as but not limited to, volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage and/or transmission of information. This can include tangible computer-readable storage media such as RAM, ROM, electronically erasable programmable ROM (EEPROM), flash memory or other memory technology, CD-ROM, digital versatile disk (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or other tangible computer readable media.

Machine-readable instructions executable by one or more processors or cores of processing unit1204may be stored on a non-transitory computer-readable storage medium. A non-transitory computer-readable storage medium can include physically tangible memory or storage devices that include volatile memory storage devices and/or non-volatile storage devices. Examples of non-transitory computer-readable storage medium include magnetic storage media (e.g., disk or tapes), optical storage media (e.g., DVDs, CDs), various types of RAM, ROM, or flash memory, hard drives, floppy drives, detachable memory drives (e.g., USB drives), or other type of storage device.

Communications subsystem1224provides an interface to other computer systems and networks. Communications subsystem1224serves as an interface for receiving data from and transmitting data to other systems from computer system1200. For example, communications subsystem1224may enable computer system1200to connect to one or more devices via the Internet. In some embodiments communications subsystem1224can include radio frequency (RF) transceiver components for accessing wireless voice and/or data networks (e.g., using cellular telephone technology, advanced data network technology, such as 3G, 4G or EDGE (enhanced data rates for global evolution), WiFi (IEEE 802.11 family standards, or other mobile communication technologies, or any combination thereof)), global positioning system (GPS) receiver components, and/or other components. In some embodiments communications subsystem1224can provide wired network connectivity (e.g., Ethernet) in addition to or instead of a wireless interface.

In some embodiments, communications subsystem1224may also receive input communication in the form of structured and/or unstructured data feeds1226, event streams1228, event updates1230, and the like on behalf of one or more users who may use computer system1200.

Communications subsystem1224may also be configured to output the structured and/or unstructured data feeds1226, event streams1228, event updates1230, and the like to one or more databases that may be in communication with one or more streaming data source computers coupled to computer system1200.