The role of the Slang Voice Assistant is to enable the users of the app (where it's integrated into) to complete one or more User Journeys by voice, either fully, or partially, aided by touch. Technically, this is achieved through back-and-forth interactions between the Assistant and the app, in which the Assistant repeatedly notifies the app of the User Journey requested by the user, along with the accompanying data, while the app responds by informing the Assistant of the various App State transitions it wants to make and requires some input from the user or wants to communicate some information back to the user.
Slang provides a bunch of domain-specific Assistants that can be configured and added to apps of that domain. Every Assistant supports a specific set of user journeys for which it has been trained already.
Eg domains: Retail Assistant, Travel Assistant, Banking Assistant
Sub-domains are variants inside the domain. They clarify which sub-categories of the domain, the Assistant has been trained for.
Eg sub-domains: Inside the Retail Assistant, the sub-domains supported as "Grocery" and "Pharmacy"
A user journey is a path a user may take to reach their goal when using a web or mobile app
User journeys, in Slang's context, represent various journeys or functionalities that are supported by the Assistant, which would result in the user reaching some logical end-point inside an app from that domain.
A User Journey can consist of an initial App State, a final App State, and zero or more intermediate App States.
The user journeys begin in one of two ways -
The user speaks a command that the Assistant is able to recognize as the beginning of a new user journey. Eg: "show me onions" or "where is my last order". The Assistant will analyze the utterance and determine which user journey belongs to it and will call an appropriate method (eg onSearch or onOrderManagement) that the app is expected to instantiate (more details in the Getting Started section)
The app launches an explicit user journey programmatically, eg to fill a form optionally by voice, as soon as the user lands on a relevant page.
Sample user journeys: Search, Order management, Offers
The data associated with every user journey. It's the data that the Assistant extracted from what the user spoke or from what the user did on the UI or something that the app wants to pre-inform the Assistant.
Sample Context items: Item, brand, quantity, unit, source & destination stations
An app state is a point in the user journey path that represents a specific form and context the app is in or wants to be in, based on the data it received from the Assistant or directly from the end-user via the screen.
That's a mouthful. Let's try to simplify it.
From a developer's perspective, in its simplest form, you can think of the various screens through which a user transitions while completing a User Journey as the various App States for that journey.
As an example, for the Search User journey, here are some sample app-states.
The search user journey will be triggered when the user is trying to search for an item and can optionally give enough details to uniquely identify an item (eg: aashirvaad 2 kg aata - here the brand and the size variant is also specified and the app can potentially map this to a specific SKU item in a retail e-commerce app)
SEARCH_RESULTS - when the app is showing the search listing based on the input it received from the user
PRODUCT_DETAILS - when the app is showing a product detail page that is specific to the item that user searched for
CART_DETAILS - when the app wants to automatically add the item to cart based on what the user asked for
An App State is fully self-sufficient, which means that it is descriptive enough to provide all the necessary information to the Slang Assistant by itself, but it can optionally be enhanced with more details (conditions) to provide more fine-grained information that better represents the true state of the application at that point.
For eg, in the SEARCH_RESULTS app state (which should be triggered when the app wants to show a search listing, based on a search command that the user gave), the following additional conditions are available for the app to inform the Assistant a more precise state of the app.
SearchSuccess - when the app is showing the user the search listing
ItemNotFound - when the app is not able to find the item being searched
ItemInvalid - when the app does not match to any existing SKU item
For another example the PRODUCT_DETAILS app state (which should be triggered when the app was able to narrow down an item explicitly based on the search command that the user gave), the following conditions are available for the app -
QuantityRequired - when the app wants to know the quantity the user is interested in
AddToCartSuccess - when the app has added the item to cart
In the QuantityRequired case, the Assistant will automatically prompt the user to specify the quantity and it will inform the app with the details but also preserve details of the user journey up to that point.
Every App State has a default condition.
Non-terminal Conditions - Conditions that conceptually represent points in the app where the journey is not complete. It will require some input from the user to move ahead and the same will be collected by the Assistant. The app could also allow collecting the same information from the screen. Eg is when the app needs the user to specify the quantity of an item they are requested to be added to the cart
Terminal Condition - Conditions that conceptually represent points in the app where the journey has ended. The Assistant will speak out the details of the state to the user. The app would also be showing something related to that app state on the screen. Eg is when the app is showing a search result and they want to speak out a successful showing of the listing
The final piece of the puzzle is the things that the Assistant speaks back to the user. There are 4 types of prompts that the Assistant handles today -
The message that the Assistant will speak when the user starts using the Assistant. Eg like "Welcome to Retail Assistant. What item do you want to buy?".
There are different types of Greeting prompts
Global greeting - The greeting that is spoken when the Assistant is invoked without any explicit user journey affinity. Eg: "Welcome to BigBasket. What do you want to do today?"
User journey specific greeting - The greeting that is spoken when the Assistant is invoked having an affinity for a specific user journey. Eg: "What item do you want to buy?"
The message that the Assistant will speak whenever it does not understand what the user is saying. Eg: "Sorry I did not understand. Please try again".
There are again two types of Clarification prompts
Global clarification - The clarification message that is spoken when the Assistant is invoked without any explicit user journey affinity. Eg: "Sorry I did not understand. Please try again"
User journey specific clarification - The clarification that is spoken when the Assistant is invoked having an affinity for a specific user journey. Eg: "Sorry I did not understand that item. Please try again" - notice the mention of the word item which is what it would be if the user journey was Search
The message that the Assistant will speak when asking for a very specific input from the user. Eg: "Please mention the amount you want to buy?".
This would happen when the app sets a non-terminal app state condition.
The message that the Assistant will speak when it wants to tell some information to the user. Eg: "Showing you onions"
This would happen when the app sets a terminal app state condition.