- The
Cancel Credit CardIntent should be recognized if the user has a credit card. - The
Schedule AppointmentIntent should be recognized during business hours.
Key Benefits
- Granular control. Compared to States, which are designed for managing a set of Intents, Intent conditions offer more fine-grained control over individual Intents. They allow you to enable or disable specific Intents based on multiple factors, providing greater flexibility in handling dynamic scenarios.
- Improved AI Agent Precision. Prevents the AI from triggering irrelevant Intents, reducing false positives and improving the user experience.
How to Use
To set a condition for a specific Intent, navigate to NLU > Intents in the Flow editor. Open the Intent, then go to Advanced > Condition to configure the condition. If no condition is set, the Intent is always available.Syntax
You can define Intent conditions using CognigyScript:Single Condition
Single Condition
A single Intent condition is an expression that evaluates to Check if the
true or false. The AI Agent will detect the Intent only if the condition is true.The !! operator ensures the value is evaluated as a boolean.Examples:Check if the Keyphrase of the first item in the city Slot is equal to Düsseldorf:topics array in the Context object doesn’t include the term Cognigy:Multiple Conditions
Multiple Conditions
To apply multiple Intent conditions, combine them using logical operators:Enable Intent if the user asks about Düsseldorf or Cognigy:
- AND (
&&) – requires all conditions to be true. - OR (
||) – requires at least one condition to be true.
Use Cases
Restricting an Intent Based on User Profile
Restricting an Intent Based on User Profile
A bank AI Agent should allow users to cancel their credit cards only if they have one.Condition:Result: the Intent is only active for users with a credit card.
Checking Multiple Profile Attributes
Checking Multiple Profile Attributes
The AI Agent should allow credit card cancellation only if the user owns a card that is activated.Condition:Result: the Intent is enabled only for customers with an active credit card.