Dialog script concepts

The design of a conversion flow starts with creating a dialog script in Alan AI Studio. In the dialog script, you implement the logic for your assistant: cover all conversational turns that the user should be able to follow and requests that the virtual assistant must handle.

The number of dialog scripts in the virtual assistant project is determined by the project’s size and complexity. A single dialog script may be enough for a simple virtual assistant. If you create a more complex assistant, you may want to split its code into multiple scripts for better organization. Scripts in such projects are executed in the order they appear in the script panel in Alan AI Studio, up to bottom.

Dialog scripts are written in JavaScript. Alan AI supports standard JavaScript and augments it with its own predefined functions and objects. This enables dialog script developers to support any app scenario or workflow and create unique conversational experiences.

You can use the following functionality and tools for dialog script design:

Requests and responses

Learn how to match the user’s input to intents and provide responses

Patterns

Learn how to define request and response phrases

Slots

Learn how to pick out important information from the user’s input

Contexts

Learn how to design a multi-branched conversation flow

Predefined objects

Learn what predefined objects Alan AI exposes

Built-in JavaScript libraries

Learn how to use popular JavaScript libraries in the dialog script

Error handling and re-prompts

Learn how to gracefully handle errors in the dialog

Lifecycle callbacks

Learn how to use callbacks as the dialog transitions between states