Skip to content

Any Slots

Any Slots are catch-all placeholder slots that allow you to match keyphrases of arbitrary length outside of your Lexicons. If user input matches the placeholder slot exactly it will populate a Cognigy Slot with the matched content. The result is the same as if the matched user input had been added to an attached Lexicon as a keyphrase.

To add an Any Slot, simply annotate a single word in your example sentence and select the "Any-Slot" type. Then enter the desired slot name.

An example sentence with Any Slot "movie_title" such as...

...will dynamically add user input that matches the pattern exactly to the slot movie_title:

Any input content that matches the pattern of an Any Slot in your example sentences exactly will be populated as a new Cognigy Slot. The result will be the same as if you had populated a Lexicon with the tag of your placeholder Any Slot and a keyphrase identical to the matched user input.

  • Works best when only a single word is annotated
  • Up to 4 different Any Slots per sentence
  • Up to 500 example sentences with Any Slots per Flow
  • Example sentences with Any Slots must be less than 400 characters long
  • Any Slot patterns are interpreted exact matching and will always trigger a 1 score on the intent. Lexicon Synonyms or Annotations are treated synonymous for the purpose of matching.


Any Slot at the end of a sentence

Consider the following example:

This will dynamically add user input that matches the pattern exactly to the slot fruit:

Note that because the Any Slot annotation is located at the very end of the training sentence, any number of words after "This is an" will be matched to the slot fruit:

This is by design and does not seem to make sense for this specific example. However, consider the example above with the sentence "Who is the director of Titanic", where the Any Slot would be matched with any movie title, also titles including spaces.

Any Slot in the middle of a sentence

Lets "fix" the issue we discovered above by adjusting the example sentence a little bit:

We placed the Any Slot annotation in the middle of a sentence. Now, the word of an input sentence that has exactly the structure of the training sentence will be mapped to the slot fruit:

Grammatical issues aside, using multiple words does also work:

Any Slot in combination with Lexicon Slot

When using Any Slots, we rely on the user to use the exact word structure of that sentence. To remain rather flexible with what the user may say for the Any Slot to still be detected, we can make use of a Lexicon Slot.

Lets annotate the example sentence from the previous example with a Lexicon Slot:

Keep in mind that we also need to create and attach a lexicon to the flow to be able to annotate Lexicon Slots:

As seen in the following examples, the user has more flexibility in wording the sentence:

Grammatical issues aside, using completely different words than from the training sentence does also work:


Any Slots are insensitive to punctuation. That means that any extra or unexpected punctuation in the input sentence will not influence the Any Slot mapping.

See the following input with the same training sentence as the previous examples:

Any Slots from past inputs

Any Slots that were found in earlier sentences are applied to the input object of the current sentence, if that sentence contains those slots. For that, the sentence needs not match an intent or a training sentence. This allows for an easier flow of conversation, should a topic from an earlier part arise again in a later part of the conversation.

Lets consider the following training sentences.

In the following, in the first two inputs the two corresponding Any Slots are detected by the agent. The third input does not contain any word to be mapped to a slot. At this point, you can imagine the conversation to be of any length, until the topic of apples and tastiness arises again.

Known Issues

There are some edge cases to Any Slot matching where seemingly odd behaviors occur that are related to the implementation. These edge cases are listed here for completeness, but should in practice not be of concern.

  • An input sentence without spaces will be mapped.
  • Excessive punctuation may cause problems with word mapping.
  • Conflicting training sentences may yield undesired results.
Back to top