From Bright Pattern Documentation
< 5.19:Tutorials-for-admins‎ | IA
Revision as of 15:29, 2 March 2026 by Emma.stutzman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
• 5.19

Grammar Intent Syntax Reference

Keyword & Phrase Matching

To detect intents using exact keyword or phrase matching, place the target keyword(s) or phrase(s) in quotes (“”).

Keyword and phrase matching is case-insensitive.

For example:

  • "thank you"


Info.40x40.png

Matching exact keywords and phrases in languages transcribed without surrounding whitespace (e.g., Chinese or Japanese) requires the target keywords to be wrapped in wildcard (*) characters, for example:

  • "*インターネット*"
  • "*遅い*"


Fillers & Placeholders

Placement holders can be used in between words allowing for any filler words in your phrases.

Fill words are represented using an asterisk (*).

To represent multiple fill words, you can multiple asterisks separated by spaces (* * *) or with a single asterisk and a number in square brackets (*[3]).

For example:

  • “thank you * * for your business”
  • “thank you *[2] for your business”


Using a placeholder does not need a fill word present to match. This means that using *[2] can have 0, 1, or up to 2 fill words present and still match.

For instance, In the previous examples, the following sentences would match:

  • “thank you for your business”
  • “thank you all for your business”
  • “thank you so much for your business”


Info.40x40.png

Multiple asterisks (* * * or *[3]) cannot match multiple fill words in languages transcribed without surrounding whitespace (e.g., Chinese or Japanese). If you have a case where this syntax is required, please contact Bright Pattern support to discuss possible solutions.


Affixes (Prefixes & Suffixes)

Keywords can be extended by using an asterisk (*) at the beginning or end of a word.

For example:

  • “*end” matches “send” or “bend”
  • “end*” matches “ended” or “ends”

Alternative Words

You can specify alternative words or phrases within a phrase by using angle brackets and a pipe in between each word/phrase (“<first word or phrase | second word or phrase>").

Doing this allows your phrases to match when one or other word or phrase is detected.

For example, “have a good <day | week>” would match with the phrases:

  • “have a good day”
  • “have a good week”

Speaking Party

Grammar intent patterns must indicate whose speech should be evaluated for a match. The supported speaking party qualifiers are:

AGENT - matches text spoken by an agent

CUSTOMER - matches text spoken by a customer

ANY - matches text spoken by either party


Standard Behavior

In typical configurations, grammar intents are evaluated against the current message being processed. The party qualifier must be followed by a colon (:) and then the keyword or phrase to match. For example:

  • AGENT: "hello"
    • triggers when the agent says “hello"
  • CUSTOMER: "appointment"
    • triggers when the customer says “appointment”
  • ANY: "support"
    • triggers when either participant says “support”


Autoscoring Behavior

Some additional qualifiers and modifiers apply when grammar intents are used in Autoscoring:

Other

The OTHER qualifier is available in Autoscoring scenarios that involve multiple agents. When more than one agent participates in an interaction, Autoscoring evaluates each agent independently. For each evaluation, the system generates a partial transcript in which:

  • AGENT represents the agent currently being scored
  • CUSTOMER represents the customer
  • OTHER represents all remaining participants, including additional agents or supervisors


This allows scoring logic to distinguish between the target agent’s statements and statements made by others in the same interaction.

Enable Context

The ENABLE_CONTEXT modifier can be used with speaking party qualifiers when Autoscoring cases. During case processing, Autoscoring evaluates agent responses individually. By default, intent matching is limited to:

  • the agent message currently being evaluated, and
  • the associated customer message


If your intent depends on information introduced earlier in the conversation, append [ENABLE_CONTEXT] to the party qualifier.

For example:

  • CUSTOMER: "appointment"
    • matches only if the customer says “appointment” in the current message
  • CUSTOMER[ENABLE_CONTEXT]: "appointment"
    • matches if the customer mentioned “appointment” either in the current message or in an earlier message within the same case
  • ANY[ENABLE_CONTEXT]: "support"
    • matches if either party referenced “support” previously or in the current message


Use [ENABLE_CONTEXT] when an intent relies on context established earlier in the interaction (for example, when verifying a precondition mentioned in a prior message).


Time Specification

You can specify the period of time when a keyword or phrase was said by adding a square brackets and a start and end time in seconds separated by a colon to the right of the specified speaking party variable (AGENT[0s:30s]:).

Leaving the first time slot blank will represent “from the very beginning of the call” and leaving the second timeslot blank will represent “to the end of the call”.

Negative values time values will represent the amount of time from the end of the call.

For example:

  • AGENT[0s:30s]:  “thank you for calling bright pattern”
    • will match when the agent said the phrase in the first 30 seconds of the call.
  • AGENT[:30s]:  “thank you for calling bright pattern”
    • will match also when the agent said the phrase in the first 30 seconds of the call.
  • AGENT[-180s:]: “is there anything else I can help you with today”
    • will match when the agent said the phrase in the last 180 seconds of the call.
  • AGENT[-180s:-5s]: “is there anything else I can help you with today”
    • will match when the agent said the phrase anytime from the last 180 seconds to the last 5 seconds of the call.

Word Specification

Alternatively, you can use the number of words said instead of seconds using “w” instead of “s”.

For example:

  • AGENT[:10w]:  “thank you for calling bright pattern”
    • will match if the agent said the phrase in the first 10 words.
  • AGENT[-10w:]:  “thank you for calling bright pattern”
    • will match if the agent said the phrase in the last 10 words.

Interruption

You can detect when an interruption occurs by using the variable INTERRUPTION. An interruption is detected when a person begins talking while the other person has already been talking for more than a second.

You can also indicate how many times an interruption has to occur before being detected by using square brackets with the number value inside (INTERRUPTION[3]).

For example:

  • AGENT: INTERRUPTION
    • will match when the agent interrupts the customer once.
  • CUSTOMER: INTERRUPTION[3]
    • will match when the customer interrupts the agent three times.

Operators

Local “AND”

You can detect multiple keywords or phrases in a single spoken phrase using an ampersand (&). The order of the keywords and phrases do not have an effect.

For example:

  • CUSTOMER: “want to schedule” & “appointment”
    • will match when both the word “appointment” AND the phrase “want to schedule” are present in the same spoken phrase said by the customer.
    • For example, the intent would match if the customer said “I want to schedule an appointment”.

Grouping

You can group keywords and phrases joined by operators using parentheses “()”. This is useful when working with multiple joined phrases

For example:

  • CUSTOMER: (“want to schedule” | “need to reschedule) & “appointment”

Local “OR”

You can detect for one of many keywords or phrases in a single spoken phrase using a pipe (|). The order of the keywords and phrases do not have an effect.

For example:

  • CUSTOMER: (“cancel” | “postpone”) & “subscription”
    • will match if “cancel” OR “postpone” are present with the word “appointment” in the same spoken phrase said by the customer.
    • For example, the intent would match if the customer said “I want to cancel my subscription” or “I want to postpone my subscription”.

Local “NOT”

You can match an intent when specified keywords or phrases are NOT present in a single spoken phrase using an exclamation point (!).

For example:

  • CUSTOMER: “want” & “subscription” & !(”cancel” & “my”)
    • will match if the words “want” and “subscription” are present in the same spoken phrase but only if the word “cancel” is also not present.
    • For example, the intent would match if the customer said “I want to purchase a subscription” but would NOT match if the customer said “I want to cancel my subscription”.

Global “AND”

You can detect multiple keywords or phrases said by a spoken party at any point in the entire conversation using a double ampersand (&&). The order of the keywords and phrases do not have an effect. You can also join multiple speaking party’s phrases using the global AND.

For example:

  • CUSTOMER: “want to schedule an appointment” && “available next week”
    • will match if the customer said the phrases “want to schedule an appointment” AND “available next week” at any point in the conversation.
    • For example, the intent would match if the customer said “I want to schedule an appointment.” and then later said “I am available next week”.
  • AGENT: “hi” && CUSTOMER: “hi”
    • will match if the agent said “hi” at any point in the conversation AND if the customer also said “hi” at any point in the conversation.

Global “OR”

You can detect for one of many keywords or phrases said by a spoken party at any point in the entire conversation using a double pipe (||). The order of the keywords and phrases do not have an effect. You can also join multiple speaking party’s phrases using the global OR.

For example:

  • CUSTOMER: “schedule an appointment” || “available next week”
    • will match if the customer said the phrase “want to schedule an appointment” OR “available next week” at any point in the conversation.
    • For example, the intent would match if the customer said “I want to schedule an appointment.” or “are you available next week for an appointment”.
  • AGENT: “schedule an appointment” || CUSTOMER: “schedule an appointment”
    • will match if the agent said the phrase “do you want to schedule an appointment” OR if the customer said the phrase “i want to schedule an appointment”.

Global “NOT”

You can match an intent when specified keywords or phrases are NOT present at any point in the entire conversation using a double exclamation point (!!).

For example:

  • CUSTOMER: !!“have used * services before”
    • will detect the intent if the customer never mentions the phrase “have used __ services before”.
    • For example, the intent would NOT match if the customer says “I have used your services before”.

Global AFTER

You can detect when a speaking party said a word or phrase at any point after another speaking party by using the variable AFTER.

For example:

  • CUSTOMER: “i would like to” AFTER AGENT: “would you like to purchase”
    • will match when the agent says “would you like to purchase” and the customer says “i would like to purchase” at any point afterwards.

Global BEFORE

You can detect when a speaking party said a word or phrase at any point before another speaking party by using the variable BEFORE.

For example:

  • AGENT: “would you like to purchase” BEFORE CUSTOMER: “i would like to”
    • will match when the agent says “would you like to purchase” before the customer says “i would like to purchase” at any point.

Global NEAR

You can detect when a word or phrase between both speaking parties are said within a certain time period or within a few words of each other using the variable NEAR. To indicate the period of time or number of words between the spoken words or phrases, you can use a square bracket with a number value inside - using “s” for seconds and “w” for words (NEAR[30s] or NEAR[20w]).

For example:

  • CUSTOMER: “need help” NEAR[10s] AGENT: “let me assist”
    • will match if the customer said the phrase “i need help” within 10 seconds of the agent saying “let me assist” and vice versa.


Related:

The ENABLE_CONTEXT modifier provides a targeted way to match a specific party’s prior messages in a case. While global operators evaluate logical relationships across the conversation, PARTY[ENABLE_CONTEXT] extends the search scope for a single speaking party without requiring logical operators.

< Previous | Next >