Speech-to-Intent Expression Syntax

Cheat Sheet

Intents & Expressions

Create a context to detect intent from speech, intents such as "Make Coffee" or "Turn on Lights".

Intents are composed of a collection of expressions. When a user's utterance matches any expression within an intent, the intent is detected. For example, "make coffee" or "make me coffee" could be expressions, each of which signal the "Make Coffee" intent.


Match a series of words from a spoken language, exactly.

Phrases are made up of words, strings of alphabetic characters and apostrophes, each separated by spaces.

All other elements of expressions are built on phrases, and a phrase by itself is a valid expression.

Pronunciation checks are performed as you edit your context. Each word in the phrase must be present in the Picovoice dictionary.


word1 word2 … wordN


  1. make me coffee
  2. turn on the lights


Allow an optional phrase within a larger expression.

Useful for capturing variations on articles, politeness, and formality.




  1. (please) make me coffee
  2. turn on (the) lights


Logical "or" for allowing phrasing choices.

Use it especially when the specific phrasing is unimportant to the intent.


[phrase1, phrase2, … , phraseN]


  1. [make, brew] me coffee
  2. [turn on, activate] the lights


Provide a choice from a collection, and capture the specific choice.

Slot types are defined as a list of possible phrases. A beverage slot might be a list of e.g. "coffee", "tea", "latte", and "london fog". Any of these phrases will match the slot, and the specific choice is returned in a callback.

Even if you are not interested in the specific value that matched the slot type, slots still serve as a convenient "macro" for choices, especially ones with several values, and/or choices that are used many times in expressions.

When using the same slot type multiple times in one expression, the variable names must be unique to avoid ambiguity.




(Assuming slot types "beverage" and "room" have been defined, and populated with phrases)
  1. make me $beverage:bev1
  2. turn on lights in $room:r1 and $room:r2

Example Results

  1. {intent: "makeDrink", bev1: "coffee"}
  2. {intent: "turnOnLights", r1: "living room", r2: "study"}