<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sanjeev Surati on Medium]]></title>
        <description><![CDATA[Stories by Sanjeev Surati on Medium]]></description>
        <link>https://medium.com/@sanjeevsurati?source=rss-990e5bbf2c7e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*b3xaQX7becm1t87sqmI4Og.jpeg</url>
            <title>Stories by Sanjeev Surati on Medium</title>
            <link>https://medium.com/@sanjeevsurati?source=rss-990e5bbf2c7e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 12:31:40 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sanjeevsurati/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Build An Alexa Voice App With A Few Clicks]]></title>
            <link>https://medium.com/@sanjeevsurati/build-an-alexa-voice-app-with-a-few-clicks-d643ea95f8d2?source=rss-990e5bbf2c7e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d643ea95f8d2</guid>
            <category><![CDATA[alexa]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <dc:creator><![CDATA[Sanjeev Surati]]></dc:creator>
            <pubDate>Fri, 15 Jun 2018 14:43:12 GMT</pubDate>
            <atom:updated>2018-06-27T12:46:20.485Z</atom:updated>
            <content:encoded><![CDATA[<p>With the rising consumer adoption of smart speakers like Amazon’s Alexa and Google Home, and the convenience of digital assistants such as Siri, we are starting to see a world where users increasingly expect to get to their data and services using their voices. This article is provides an overview of the underlying principles of creating conversational interfaces for Alexa and Google Home and then provides some insight into how those interfaces can be mapped into primitives that lend themselves to creating a visual workflow that can be used to easily update and modify the interface.</p><h4>It’s All About Intent</h4><p>When a user provides a voice command such as “Go left” to a speech client, behind the scenes, the recorded audio the user spoke is sent through Natural Language Processing (NLP) to translate the command into an intent. In this case, the intent might be something called <em>LeftIntent</em> which an application interprets based on the current context; however, users aren’t always going to phrase the statement the same way. Rather than “Go left”, someone could also say “Walk left” or “Run left” or simply “Left” with each of these phrases translating into the same <em>LeftIntent</em>. The different types of phrasing for <em>LeftIntent</em> are utterances.</p><p>A voice application consists of handling for a number of intents, each of which may or may not consist of multiple utterances.</p><p>Speech clients generally come with a number of standard intents: “Launch”, “Stop”, “Yes”, “No” or “Help.” They also allow applications to define their own, although the number of custom intents can be limited (for example, Amazon’s Alexa limits the number of intents an application can define to 256).</p><p>A speech client like Alexa feeds an intent to a REST API endpoint that processes the intent and depending on context, provides an appropriate response for playback by the client.</p><p>This intent/utterance paradigm will likely shift when AI natural language processing becomes more accurate and efficient, but until then, we’ll be living with intents and utterances.</p><h4>Anatomy of a Voice Application</h4><p>Fundamentally, a voice application consists of several nodes which present audio narrative to a user through text-to-speech, pre-recorded mp3 files, or a combination of both and then use feedback from the user to determine intent and navigate the user to the next node.</p><p>For example, an application presents a scene to a user, at the end, the user decides to either go left or right. The user may pause to consider the decision. If the smart speaker doesn’t hear a response, it will time out and end the session. Rather than timing out, you can specify a reprompt from the speaker to let the user know that you’re waiting for a response and remind them of their choices.</p><p>Taking these pieces of information into account, we end up with the following as an example of a story node intended to start the user on an audio adventure:</p><p><strong><em>StoryNode</em></strong></p><pre>Name: Opening</pre><pre>Text: You stand on a mountain side overlooking a slope that descends into a valley that disappears into forest. Miles away, it ends in a beach where land yields to sea in a crumble of sand. You are at a fork in the road. Would you like to go left or right?</pre><pre>Reprompt: Left or right?</pre><pre>Intent: LeftIntent -&gt; Troll In Path</pre><pre>Intent: RightIntent -&gt; Animal Across Path</pre><p><strong><em>Intent</em></strong></p><pre>Name: LeftIntent</pre><pre>Utterances: Left, Go left, Walk left, Run left</pre><p><strong><em>Intent</em></strong></p><pre>Name: RightIntent</pre><pre>Utterances: Right, Go right, Walk right, Run right</pre><p>Each of these primitives can easily be mapped to database tables, a no-sql store or text file (i.e. JSON, XML or YAML) that could be interpreted at runtime by a backend service used by the smart speaker.</p><h4>But Hand Editing Text is So Boring</h4><p>As we started building an engine for backing voice applications, it became rapidly clear to us that while hand-editing text data was okay for delivering a proof-of-concept, it is very tedious. We need a user interface if we want to be more productive and if we want to allow other users to author applications on our platform.</p><p>Since the applications consist of story nodes related by intents, this calls for some sort of flowcharting or diagramming interface. After doing some research, we found that <a href="https://gojs.net/latest/index.html">GoJS</a> provides a clean programmatic interface for representing the nodes and relationships.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*RwVLwnLpL1h3e3IV5ECbkg.png" /></figure><p>A simple properties side bar allows for easy editing of the nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/306/1*TzTmLO2j9jcXSpt3sPSmZQ.png" /></figure><p>Saving updates now becomes a matter of calling an endpoint to update the data store.</p><p>As we continued building things out, we found that applying a different color to nodes without intent handling was useful in determining end nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*O8VcF_E9-AKWQVkYYNt1Yg.png" /></figure><p>Assuming that your endpoint for reading and updating applications is working with the same store that the endpoint backing your application is, you’re now well on your way to easily creating and updating voice applications.</p><h4>That Was Just the Basics</h4><p>The example above uses simple text responses and intents.</p><p>Responses can consist of a combination of text, MP3 files and Speech Synthesis Markup Language (SSML) tags to control audio, as well as formatted visual “card” responses that can be displayed in mobile apps or on devices such as the Echo Show.</p><p>Alexa currently has a practical limitation of 250 intents per Alexa Skill. While most developers won’t run up against this, some skills may. A choose-your-own adventure skill with many nodes and decisions is likely to bump up against this. Avoid this with some judicious planning and slots.</p><p>In addition to multiple utterances, intents also provide the ability to supply placeholders called “slots” that reduce the number of intents needed to support an application. Slots can be a predefined data type, like a DateTime, or a user defined type. For example, one could consolidate the commands: “Pull the lever” and “Push the button” into a “{verb} the {item}” utterance for a VerbTheItemIntent, where “pull” and “push” are verbs and “lever” and “button” are items.</p><p>Bear in mind that updating your interaction model’s intents, slots and/or utterances, will usually require republishing your application.</p><p>An application should also keep track of context and have graceful handling when it’s given a command that doesn’t make sense in context. For example, if the application is expecting the user to say “Go left” or “Go right”, but the user says “Push the button” that should be handled cleanly. It should also, additionally be able to track decisions the user made in the past and be able to change future behaviors based on those decisions.</p><p>Here’s a visual representation of a skill we published for Amazon’s Alexa called “Animal Farm P.I.” that supports the more advanced concepts outlined above.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*tzoHv7WZmq9Mjj7z-lJz5w.png" /></figure><h4>Summary</h4><p>We started with a non-visual voice application and ended up with a visual design surface. Stepping back to look at the bigger picture, this makes sense. An audio application is fundamentally a Q&amp;A interface. The user asks, the device responds and prompts and, in turn, the user replies. Each response leads to the next set of choices, making a flow chart a natural representation of the experience.</p><p>Feel free to ask questions or leave comments and I can be reached directly at sanj@whetstonetechnologies.io.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d643ea95f8d2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>