5.4.1 Task templates
Figure 5-2: Sample Tasks using Task Template
Input to agent is driven by a set of templates that detect the pattern in the input text and ask the user to enter specific fields. Template is driven by data organized in a tree structure shown in Figure 5-2 above. It begins with a verb for the activity, and then based on the selected verb, subsequent parameters are presented to the user for entry.
Following is a set of sample verbs supported by the agent:
1. Get is an information gathering activity that can be executed by the agent by using web services or linked data sources. Agent then asks for specific
information needed by the user, and asks the user to select from a dropdown list which has items such as ‘weather, ‘restaurant list’, ‘restaurant list – Indian’ etc.
2. Reserve is a verb used to identify online reservation tasks that can be automatically executed by the agent. For example, reserving a specific restaurant for a group of people using web services such as OpenTable to book restaurants.
3. Buy is a verb that can be used to capture general day-to-day buying activities related to buying groceries, books, electronics etc., that involve shopping at a retailer store.
4. Drive is a verb that can be used with tasks related to driving to particular locations. Agent will follow up with questions on vehicle, location to drive to and when the user wants to start the driving activity.
Input System, uses the first word entered by the user to detect the pattern, and dynamically updates the UI to capture rest of the input parameters for the task. Hierarchy of nodes in the task template is used to follow a naming convention to capture attributes of the task, as well as to capture input and output parameters of the task. For example, ‘Reserve restaurant’ task is identified by the name
Reserve.Restaurant and has input parameters Name of the restaurant, location of the restaurant, date and time of reservation and number of people going to
restaurant. Web service manager module will use the task template name to capture integration details of the task with the web services that offer capability to complete this task.
5.4.2 Web Service Integration
Agent uses web services to query for information as well as to execute actions by calling the external web services offered by third parties thru the web service manager module. There are two types of web services agent integrates with – informational web services, which are used to gather information given a set of input parameters, and another set of web services to execute actions on behalf of the user.
Figure 5-3: Web Services Manager
Figure 5-3 shows sub-systems involved in integrating agent with web services and forms Web services Manager module.
Web Services controller is the central component that orchestrates web service integration within the agent. It takes inputs from Input Parameters Model as well as from Context Model and then uses Web service mapping module to identify which web service to call, and also what parameters to be passed. It will then call web service adapter with the input parameters, and parse the response.
Context Model contains contextual information about the user such as user’s current location, current time, calendar appointments, other tasks currently in progress, past history of tasks, user interests, and likes. This model provides input to the web services module, parameters that are not explicitly entered by the user, but are relevant for the web service.
Input Parameters model is a generic model that stores all the information collected by the agent from the user. In cases of use cases such as ‘Get weather report for a location’ – this would include location name, date and time of the report. Output Parameters model captures expected responses from the web services, format of this output. For example, weather service will respond with weather conditions for a location such as temperature, humidity, wind, sunrise/sunset timings, etc.
Web Service Adapters handle connectivity to specific web services, passing input parameters in the desired form and transforming the output from the web service in the desired form for the agent. In addition, it will also translate any data elements
between the two sides so that each side understands the other. Some examples of these adapters include Google Calendar adapter, Google Contacts web service adapter, Weather.com web service adapter, OpenTable web service adapter etc. Web Service Mapping module, will map a task to a web service and the input parameters to specific parameters accepted by that web service. This module, in conjunction with specific web service adapters enables invocation of external web services from the agent. In can be conceived that, support for new web service can be enabled by adding a new adapter to the web service and then adding a new mapping information regarding the service and its input/output parameters.
Figure 5-4: Web Service Mapping Example
Figure 5-4 shows how web service mappings are arranged for each of the supported tasks. It contains mapping of generic parameters such as location, date and time captured in the task template model to specific parameters expected by the web service that needs to be invoked by the agent. It also contains details about web service adapter that needs to be called along with parameters that need to be passed for input as well as parameters that are expected as output.
These mappings enable the agent to bind generic data gathered in the UI to specifics of the web service on the input side, and transform the response from the web service to display output to the user.
5.4.3 Task Model
Task Model is used to capture information related to the task such as task name, actor, start time, end time, duration of task, urgency, importance, dependencies with other tasks, sub-tasks, and status of the task.
Figure 5-5: Task Model
Task Model is used to capture details of the task, its sub tasks, dependencies with other tasks, status of the task. It also includes information on
importance and urgency of the task used to prioritize the task during planning stage. Actor and Delegatability fields enable the agent to identify who this task can be assigned to. It also includes references to Wordnet and OpenCyc to gather additional information on the task. Knowledge databases provide useful information on sub-tasks associated with the task that are then form part of this task model.