Understanding intents and vocabularies

Siri is a powerful, smart, and ever-learning personal assistant that aims to give natural responses to natural speech input. This means that there is often more than one way to say something to Siri. Some users like to be extremely polite to Siri, saying please and thank you whenever they ask for something. Other users like to be short and to the point; they simply tell Siri what they want and that's it.

This means that Siri has to be really smart about how it interprets language and how it converts the user's requests to actionable items. Not only does Siri take into account the language used, it's also aware of how a user is using Siri. If user activates Siri by saying Hey Siri, Siri will be more vocal and verbose than when a user activates Siri by pressing and holding the home button, because it's likely that the user is not looking at their device if they didn't press the home button.

To convert a user's spoken requests into actions, Siri uses intents. An intent is a way to describe an action. These intents are supported by app-specific vocabularies; this allows you to make sure that your users can use terms that are familiar to them because they are also used in your app.

Siri does not handle an unlimited amount of intents. All of the intents that Siri can handle belong to a predefined set of domains. If you plan to create a Siri extension for your own app, it must fit into one of the predefined domains that Siri understands. Currently, Siri handles a handful of domains:

If your app is not in one of these domains, Siri won't be able to integrate with your app very well and your app might even be rejected during review for the App Store if your integration does not implement the appropriate handling for certain intents. In order to integrate Siri with your app, your app must ask the user for permission for it to be used with Siri. It's recommended that you do this as soon as your user first opens your app, because this ensures that your app is available to Siri as soon as possible. Make sure that you ask for permission appropriately though, you don't want to unpleasantly surprise your user with a permission request. You also need to add the NSSiriUsageDescription key to your Info.plist file and you need to enable the Siri capability in your main app's capabilities tab.

You can only enable the Siri capability for your app if you are a paying member of Apple's Developer Program. Unfortunately, you can't enable or test Siri if you haven't got such a membership.

In order for Siri to work with your app, it's important that a user mentions your app's name to Siri when asking it something related to your app. This is to make sure that apps don't hijack certain words or verbs, which would result in a confusing experience. It doesn't matter exactly how or when the user does this. Siri is all about natural language and it will even understand if your app name is used as a verb. For example, MyBankApp some money to John Doe would be interpreted as a money transfer action from an app named MyBankApp to a person named John Doe.

However, if a user were to ask Siri to perform this task, it would not have all of the information needed to send money to John Doe yet. To handle incomplete requests like this one, intents are used. Let's see what these intents are and how they work.