Stay organized with collections
Save and categorize content based on your preferences.
Before trying this tutorial,
you should be familiar with Dialogflow basics covered in
Quickstarts.
Create an agent
Use the Dialogflow ES console to create an agent named "PackageTracker".
If you are unsure how to do this,
revisit the Quickstarts.
If you prefer to work with an existing agent, that is okay too. Just be sure that you
enable auto speech adaptation
in the agent settings. This is enabled by default for new agents.
Create a sequence recognizer entity
The core function of this agent is understanding alphanumeric sequences over
voice. Specifically, you'll set up the agent to listen for a handful of characters
at a time, eventually putting all sub-sequences together before validating the
final sequence against a data store. Let's start by defining an entity to
recognize the partial sequences.
Create the regexp sequence entities
We need to use a regexp entity to capture sequences so that auto speech
adaptation will know to listen for "ABC" instead of "a bee sea".
We'll set up the entity to accept any alphanumeric sequence of at least 3
characters. Later, you'll add a webhook so that you can validate the final
sequence against a data store or API.
Create a new entity. We'll name it "alphanumeric" because it will accept any
alphanumeric input.
Check the box for Regexp entity
Add a single entry, ^[a-zA-Z0-9]{3}[a-zA-Z0-9]*$
Click SAVE.
Notice that the regexp you added is very strict in that it is looking only for
a string of alphanumerics, without any spaces or dashes. This is important for
two reasons:
This regexp follows the auto speech adaptation
requirements
for enabling the "spelled-out sequence" recognizer mode.
By not looking for spaces and only looking for entire phrases (^...$),
you allow end-users to easily exit the sequence recognition. For example,
when you prompt "what's your order number" and an end-user replies
"no I want to place an order", the regexp will reject and Dialogflow will
know to look for another intent that might match that phrase.
If you are only interested in numeric values, you could create a more tailored
entity like [0-9]{3}[0-9]*, or even just use the built-in @sys.number-sequence
entity.
The rest of the tutorial assumes you are collecting alphanumeric sequences. Jump
to the next section to see how to set up intents to collect these sequences.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThis tutorial guides users through setting up a Dialogflow agent to recognize alphanumeric sequences over voice input.\u003c/p\u003e\n"],["\u003cp\u003eUsers should first create a new Dialogflow agent, or use an existing one that has auto speech adaptation enabled in the agent settings.\u003c/p\u003e\n"],["\u003cp\u003eA regexp entity, named "alphanumeric," is created to recognize partial alphanumeric sequences, adhering to auto speech adaptation guidelines with the format \u003ccode\u003e^[a-zA-Z0-9]{3}[a-zA-Z0-9]*$\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe defined regexp entity strictly looks for strings of alphanumerics without spaces or dashes, allowing for recognition of spelled-out sequences and easy exit from sequence recognition.\u003c/p\u003e\n"],["\u003cp\u003eFor numeric-only values, the user could opt to make a more tailored entity like \u003ccode\u003e[0-9]{3}[0-9]*\u003c/code\u003e, or use the built-in \u003ccode\u003e@sys.number-sequence\u003c/code\u003e entity.\u003c/p\u003e\n"]]],[],null,["# Before you begin\n\nBefore trying this tutorial,\nyou should be familiar with Dialogflow basics covered in\n[Quickstarts](/dialogflow/docs/quick).\n\nCreate an agent\n---------------\n\nUse the [Dialogflow ES console](https://dialogflow.cloud.google.com) to create an agent named \"PackageTracker\".\nIf you are unsure how to do this,\nrevisit the [Quickstarts](/dialogflow/docs/quick).\n\nIf you prefer to work with an existing agent, that is okay too. Just be sure that you\n[enable auto speech adaptation](/dialogflow/es/docs/speech-adaptation#enable_or_disable_auto_speech_adaptation)\nin the agent settings. This is enabled by default for new agents.\n\nCreate a sequence recognizer entity\n===================================\n\nThe core function of this agent is understanding alphanumeric sequences over\nvoice. Specifically, you'll set up the agent to listen for a handful of characters\nat a time, eventually putting all sub-sequences together before validating the\nfinal sequence against a data store. Let's start by defining an entity to\nrecognize the partial sequences.\n\nCreate the regexp sequence entities\n-----------------------------------\n\nWe need to use a regexp entity to capture sequences so that auto speech\nadaptation will know to listen for \"ABC\" instead of \"a bee sea\".\n\nThese entities must conform to the\n[auto speech adaptation regexp enitity guidelines](/dialogflow/es/docs/speech-adaptation#regexp_entities)\nto ensure the speech recognition is tuned to recognize spelled-out sequences.\n\n### Partial sequence entity\n\nWe'll set up the entity to accept any alphanumeric sequence of at least 3\ncharacters. Later, you'll add a webhook so that you can validate the final\nsequence against a data store or API.\n\n1. Create a new entity. We'll name it \"alphanumeric\" because it will accept any alphanumeric input.\n2. Check the box for **Regexp entity**\n3. Add a single entry, `^[a-zA-Z0-9]{3}[a-zA-Z0-9]*$`\n4. Click **SAVE**.\n\nNotice that the regexp you added is very strict in that it is looking only for\na string of alphanumerics, without any spaces or dashes. This is important for\ntwo reasons:\n\n1. This regexp follows the auto speech adaptation [requirements](/dialogflow/es/docs/speech-adaptation#regexp_entities) for enabling the \"spelled-out sequence\" recognizer mode.\n2. By not looking for spaces and only looking for entire phrases (`^`...`$`), you allow end-users to easily exit the sequence recognition. For example, when you prompt \"what's your order number\" and an end-user replies \"no I want to place an order\", the regexp will reject and Dialogflow will know to look for another intent that might match that phrase.\n\nIf you are only interested in numeric values, you could create a more tailored\nentity like `[0-9]{3}[0-9]*`, or even just use the built-in `@sys.number-sequence`\nentity.\n\nThe rest of the tutorial assumes you are collecting alphanumeric sequences. Jump\nto the next section to see how to set up intents to collect these sequences."]]