Slot Fillersยถ
Slot Fillers let you monitor every user input for specific Slot matches
and store them in the Context object.
This way, if an answer is already provided, the AI Agent skips the corresponding question in the Question Node.
For example, if a user says
I'm flying from San Francisco on United
and the AI Agent asks
What city are you departing from?
โ this question would be redundant and create a poor user experience.
Instead, Slot Fillers ensure that only missing information is requested.
Key Benefitsยถ
- Collecting and Remembering Information. With Slot Fillers, all required data is gathered and retained throughout the conversation, reducing errors and making conversations with the AI Agent smoother and more natural.
- Handling Different Input Types. Slot Fillers accept various formats, for example, dates and numbers, making it flexible for user inputs.
To learn more about the benefits of using Slot Fillers and how they work, watch this video:
Restrictionsยถ
- Slot Fillers fail when multiple values share the same Slot type, making it impossible to distinguish between them. For example,
I'm flying from SFO to ORD on United
. The AI Agent can't distinguish between departure airport and arrival airport because both matchairport_code
. To avoid this restriction, you can:- Create separate Slot Fillers for each value:
Departure Airport
โ use a Context Key, for example,departure_city
.Arrival Airport
โ use a Context Key, for example,arrival_city
.
- Modify the Flow to ask distinct questions for each Slot instead of extracting both from a single user input.
- Create separate Slot Fillers for each value:
Working with Slot Fillersยถ
You can create, edit, and delete Slot Fillers in NLU > Slot Fillers in the Flow editor.
You can create, edit, and delete Slot Fillers by using Cognigy.AI API.
To capture and store Slot matches, ensure you specify the Slot Filler in your Question Node by selecting the Slot question type, then activate the Skip if answer exists in Context option in the Node.
Slot Filler Settingsยถ
Required Fields
Field | Description | Example |
---|---|---|
Name | The display name of the Slot Filler, used for identification. | Departure Airport Slot |
Type | Defines the type of input expected. You can select from the following Slot types: - Slot โ a Lexicon Slot. Make sure a Lexicon is attached and that this Slot is included in it. - Regular Expression โ a Regex Slot. - Intent โ extracts values based on recognized Intents. Useful when Slot filling is tied to Intent classification. - System Slot โ predefined Slot types that automatically extract common entity types such as dates, numbers, temperatures, and more. |
- |
Slot Name | This parameter appears if the Slot type is selected. Specifies which Slot this Filler is associated with. | airport_code , date , name |
Regular Expression | This parameter appears if the Regular Expression type is selected. Enter the regular expression to extract specific patterns from user input. Regex expressions must start with / and end with /g for global matching, for example, /^\d{3}-\d{3}-\d{4}$/g . |
|
Context Key | The variable name used to store the extracted value in the Context object. | departure_city , arrival_date |
Optional Fields
Field | Description | Example |
---|---|---|
Additional Validation | Allows extra validation rules to ensure correct formatting or values. | Ensure date format is YYYY-MM-DD . |
Result Location | Determines where the extracted data is stored. | Context or Contact Profile. |
Store result in Context | Stores the extracted value in the Context object. | "departure_city": "SFO" . |
Store result in Contact Profile | Stores the extracted value in the Contact Profile for future interactions. | Store "preferred_airline" for returning users. |
Store Detailed Results | Stores metadata about the extracted Slot, for example, confidence scores. | Confidence score of 0.92 for "ORD" . |
Use Positive Keyphrases Only | Limits Slot extraction to predefined keyphrases. | Only accept "San Francisco" for departure_city . |
Skip if the result is already in Context | Prevents asking for the Slot again if a valid value already exists in the Context object. | If "departure_city": "LAX" is set, donโt ask again. |
Exampleยถ
Step 1. Add Slots
- Create a new Flow called
Slot Fillers
. - Navigate to the NLU tab and attach relevant Lexicons, for example,
airports
andairlines
. - On the Slot Fillers tab, follow these steps:
- Create a new Slot Filler named
Airline
. - Select Slot from the Type list.
- Create a new Slot Filler named
- Enter
airline
in both the Slot name and Context Key fields. - Repeat the steps 3.1 and 3.2 to create another Slot Filler named
Airport
, enterairport_code
in the Slot name and Context Key fields. - Click Build Model.
Step 2. Configure Question Nodes
- Create a Question Node, enter
What is your departure airport?
in the Text field and select Slot from the Question Type list. - Enter
airport_code
in Slot Name and Context Key to use. - Enable Skip if answer exists in Context.
- Repeat the process for
What is your airline?
, enterairline
in the Slot name and Context Key fields.
Step 3. Test Slot Fillers
Provide all information at once:
User Input: I'm leaving San Francisco on United.
Result: No additional questions are asked.
Provide partial information:
User Input: I'm flying on United.
AI Agent: What is your departure airport?
User Input: SFO
Result: The AI Agent skips asking for the airline.