In this post, I’ll show you an example of services that Amazon Alexa can offer in the cars, as we start to see its integration by many automakers in their new vehicles.

Alexa is a vocal assistant released by Amazon in 2014, that lets 3rd parties create new applications based on voice interactions, so the user can do everything in hands-free mode, this sounds good for drivers to keep eyes on the road.

The aim here is not to create a final product, but only to see how easy and efficient this kind of new voice platforms are. So I’ll simplify the data and the behavior as much as possible, the creation is supposed to take less than two hours.

What is said for Alexa can be said also for other platforms, like Google Assistant, Siri, Cortana…

Prerequisites:

Amazon Developer account

Amazon Web Services account

Some programming basics

Stakeholders:

The client wants to find dealers of Automaker in a UK city.

(Replace Automaker by any real automaker)

Today he can do this by going to the Automaker‘s website https://www.automaker.co.uk/find-a-dealer.html

Data Inputs:

I’ll suppose that Automaker has dealers in only 5 big UK cities:

London

Birmingham

Leeds

Glasgow

Sheffield

I’ll suppose also that there is only one dealer per city:

New Cars (London)

Sport Vehicles (Birmingham)

Auto Showroom (Leeds)

Good auctions (Glasgow)

Electric Cars (Sheffield)

Demo:

Here is a demo of the result, I can ask for a dealer with and without city name.

This demo is based on my previous project AlexaGUI.

Skill Creation:

The skill creation is done in two parts:

Skill Information

Skill Behavior

Alexa Skill Information is done in Amazon Developer Portal, by adding new Alexa skill:

Skill name : Car Brain

: Invocation name : car brain

: Intent Schema

{ "intents" : [ { "intent" : " FindAutomotiveDealerWithCity " , "slots" : [ { "name" : " City " , "type" : " LIST_OF_CITIES " }, ] }, { "intent" : " FindAutomotiveDealer " } ] }

Intent is the user wants to say.

Slot is the data that may be in user’s intent.

I create two intents, one when the user will ask to find a dealer, and one when he will ask to find a dealer in a city.

Custom Slot Types : I insert the names of my slot LIST_OF_CITIES with the 5 above cities.

: I insert the names of my slot LIST_OF_CITIES with the 5 above cities. Sample Utterances : Here I can add any kind of sentences the use may say, like:

– FindAutomotiveDealer Find me automotive dealer

– FindAutomotiveDealerWithCity Find me automotive dealer in {City}

Here is an overview of all above data:

Endpoint : This is the link between Skill Information and Skill Behavior, in my case I will host my behavior in Amazon Web Services (AWS), more precisely as Lambda Function since it’s free and well prepared for Alexa integration.

* Name: myAutomotiveDealerFinder

* Description: Automotive Dealer Finder By Alexa

* Runtime: Node.js 4.3

* Trigger: Alexa Skills Kit

* Code entry type: Edit code inline

Other settings can be found in this tutorial: Creating an AWS Lambda Function for a Custom Skill

After creating the function, the Endpoint is displayd in top-right as:

arn:aws:lambda:us-east-1:………:function:myAutomotiveDealerFinder

Copy/past it back in Skill Information.

At this level the skill is created, I will do now the skill behavior.

The skill behavior is done in Lambda function, for the two intents.

You can find some examples here: Amazon Skills Examples.

Chemistry Flash Cards example is good for my skill, I had just to modify the invocations and Alexa responses.

I’m posting the complete code in Github:

https://github.com/YOUN3SS/AutomakerDealers/

Conclusion: