Cognigy.AI Flow Developer Training

The Cognigy.AI Flow Developer Training explains advanced concepts of Cognigy.AI and enables you to build complex, powerful Virtual Agents. If you have no prior bot-building experience, please watch the Cognigy.AI Foundation Training for a general introduction.

Other than the final chapter of this training, Coding with CognigyScript, this training does not require coding experience.

To get the most out of the training, watch the videos once and then follow along with the trainer to get hands-on experience.

Trainer: Derek Roberti
Playtime: 160 minutes
Last update: March 2021
Version: Cognigy.AI v4.1

Chapter 1: Understanding the Input and the Context

See what's going on behind the curtains and use Input & Context to build complex conversational logic.

You'll find an example CSV file at the bottom of this article if you want to follow along.

Links & Resources Transcript
  • JSON Path Finder
  • If you didn’t complete the Foundations course, you can find the Baggage Rules Intents below in Baggage intents.csv and the Bag Type lexicon in Baggage types.csv.
  • Example sentences for the Baggage Rules – Permitted Items:
    Am I allowed to bring tweezers
    Can I bring antlers
    Is a waffle iron allowed on the plane
    Do I need to check my bowling balls
    Can I bring fidget spinners through security
    Will I be allowed on the plane with a Harry Potter wand
    Item is permitted on the plane
    Item is prohibited on the plane
    item is allowed through security
    permitted through security
  • Documentation on Input
  • Documentation on Context

Chapter 2: Simplifying Flows with Go To

Break conversations down into seperate flows to handle complex interactions

Links & Resources Transcript
  • See below for the travel-related FAQs referenced in the video. Note that these FAQs don’t have a typical number of example sentences as they are just used to illustrate attached flows and default replies in this chapter.

Chapter 3: Using HTTP Requests to Access External Data

Retrieve data and execute commands using HTTP Request Nodes

Links & Resources Transcript

Chapter 4: Using Slot Fillers to make conversations flow naturally

How Slot Fillers enable natural conversations by avoiding redundant bot questions

Links & Resources Transcript

Chapter 5: Speak your customers' language with Locales

Use Locales to build multi-lingual bots at scale

Links & Resources Transcript

Chapter 6: Manage Agents with Snapshots

Capture, restore, export & import Virtual Agents with Snapshots

Links & Resources Transcript

Chapter 7: Testing Flows with Playbooks

See how Playbooks are used to continuously test Virtual Agents by simulating user input

Links & Resources Transcript

Chapter 8: Personalizing Conversations with Profiles

Leverage User Profiles to store contact-specific data while staying compliant with data protection regulations

Links & Resources Transcript

Chapter 9: Publishing Flows with Endpoints

Learn how to publish Virtual Agents to a variety of channels using Endpoints

Links & Resources Transcript

Chapter 10: Coding with CognigyScript

Customize Cognigy.AI and create advanced conversational experiences with CognigyScript

Links & Resources Transcript
  • Greeting based on time of day:
    Hi {{ profile.firstname !== null ? profile.firstname : '' }}, {{ ci.currentTime.hour < 12 ? 'Good morning' : 'Good afternoon' }}
  • Sample images for Gallery: Morning, Afternoon
  • Token with greeting:
    `Hi, ${profile.firstname !== null ? profile.firstname : ''}, ${ci.currentTime.hour < 12 ? 'Good morning' : 'Good afternoon'}`
  • Default context:
    {
    	"packMissingSlotMessage": "Which item would you like to pack?"
    }
  • Dynamic token:
    if (ci.slots.pack) { ci.slots.pack[0].data.explanation } else cc.packMissingSlotMessage
  • Ambiguous condition:
    ci.slots.airport_code && (ci.slots.airport_code.length > 1 || ci.slots.airport_code[0].data.ambiguous
  • Dynamic quick replies with the Messenger API:
    let builder = new MessengerPlatform.QuickRepliesMessageBuilder('Select a scheduled flight for more details:');
  • Dynamic quick replies with the Messenger API:
    let builder = new MessengerPlatform.QuickRepliesMessageBuilder('Select a scheduled flight for more details:');
    
    flights.forEach(function(f) {
        builder.addTextOption(f.flight.iata,f.flight.iata)
    });
    
    actions.output(null, { "_cognigy": { "_webchat": {"message": builder.buildMessage() }}});
  • Flight Detail with Adaptive Cards:
    let flightDetail = _.find(context.schedule.data, function(f) { return f.flight.iata === ci.text });
    
    api.output("", {
    					"_plugin": {
    						"type": "adaptivecards",
    						"payload": {
    							"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
    							"type": "AdaptiveCard",
    							"version": "1.0",
    							"body": [
    								{
    									"type": "ColumnSet",
    									"columns": [
    										{
    											"type": "Column",
    											"width": "auto",
    											"items": [
    												{
    													"type": "Image",
    													"size": "Small",
    													"url": "https://adaptivecards.io/content/airplane.png"
    												}
    											]
    										},
    										{
    											"type": "Column",
    											"width": "stretch",
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": "Flight Status",
    													"horizontalAlignment": "Right",
    													"isSubtle": true,
    													"wrap": true
    												},
    												{
    													"type": "TextBlock",
    													"text": flightDetail.flight_status,
    													"horizontalAlignment": "Right",
    													"spacing": "None",
    													"size": "Large",
    													"color": "default",
    													"wrap": true
    												}
    											]
    										}
    									]
    								},
    								{
    									"type": "ColumnSet",
    									"spacing": "Medium",
    									"separator": true,
    									"columns": [
    										{
    											"type": "Column",
    											"width": 1,
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": "Flight",
    													"isSubtle": true,
    													"weight": "Bolder",
    													"wrap": true
    												},
    												{
    													"type": "TextBlock",
    													"text": flightDetail.flight.iata,
    													"spacing": "Small",
    													"wrap": true
    												}
    											]
    										},
    										{
    											"type": "Column",
    											"width": 1,
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": "Departs",
    													"isSubtle": true,
    													"horizontalAlignment": "Center",
    													"weight": "Bolder",
    													"wrap": true
    												},
    												{
    													"type": "TextBlock",
    													"text": flightDetail.departure.scheduled,
    													"color": "Attention",
    													"weight": "Bolder",
    													"horizontalAlignment": "Center",
    													"spacing": "Small",
    													"wrap": true
    												}
    											]
    										},
    										{
    											"type": "Column",
    											"width": 1,
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": "Arrives",
    													"isSubtle": true,
    													"horizontalAlignment": "Right",
    													"weight": "Bolder",
    													"wrap": true
    												},
    												{
    													"type": "TextBlock",
    													"text": flightDetail.arrival.scheduled,
    													"color": "Attention",
    													"horizontalAlignment": "Right",
    													"weight": "Bolder",
    													"spacing": "Small",
    													"wrap": true
    												}
    											]
    										}
    									]
    								},
    								{
    									"type": "ColumnSet",
    									"spacing": "Medium",
    									"separator": true,
    									"columns": [
    										{
    											"type": "Column",
    											"width": 1,
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": flightDetail.departure.airport,
    													"isSubtle": true,
    													"wrap": true
    												},
    												{
    													"type": "TextBlock",
    													"text": flightDetail.departure.iata,
    													"size": "ExtraLarge",
    													"color": "Accent",
    													"spacing": "None",
    													"wrap": true
    												}
    											]
    										},
    										{
    											"type": "Column",
    											"width": "auto",
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": " ",
    													"wrap": true
    												},
    												{
    													"type": "Image",
    													"url": "https://adaptivecards.io/content/airplane.png",
    													"size": "Small"
    												}
    											]
    										},
    										{
    											"type": "Column",
    											"width": 1,
    											"items": [
    												{
    													"type": "TextBlock",
    													"text": flightDetail.arrival.airport,
    													"isSubtle": true,
    													"horizontalAlignment": "Right",
    													"wrap": true
    												},
    												{
    													"type": "TextBlock",
    													"text": flightDetail.arrival.airport,
    													"horizontalAlignment": "Right",
    													"size": "ExtraLarge",
    													"color": "Accent",
    													"spacing": "None",
    													"wrap": true
    												}
    											]
    										}
    									]
    								}
    							]
    						}
    					}
    				})
    
  • Using Moment to format dates:
    flightDetail.departure.scheduled = moment(flightDetail.departure.scheduled).format('hh:mm A');
    flightDetail.arrival.scheduled = moment(flightDetail.arrival.scheduled).format('hh:mm A');

Example files


Comments

0 comments

Please sign in to leave a comment.

Was this article helpful?
1 out of 1 found this helpful