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

Q&A service

Learn how to add a conversational experience on top of existing text content

Built-in JavaScript libraries

Learn how to use popular JavaScript libraries in the dialog script

Predefined objects

Learn what predefined objects Alan AI exposes

Visual state

Learn how to use the visual state to pass the information about the current visual context

Project API

Learn how to use Alan AI’s project API functionality to pass information and trigger activities

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

Alan AI button popups

Learn how to display popups to engage the user to interact with the virtual assistant

User events

Learn how to listen to events driven by the user’s interaction with the virtual assistant

Client object

Learn how to get general information about the user

API reference

Get reference information about all Alan AI’s functions and objects