@bretmcg
Building apps for Google Home
and the Google Assistant
And other chatbots too!
Bret McGowen
Developer Advocate, Google
@bretmcg
Workshop: bit.ly/home-workshop
@bretmcg
The Google Assistant
A conversation between you and Google
that helps you get things done in your world
@bretmcg
100 million devices
@bretmcg
@bretmcg
Connect with new users wherever the
Google Assistant is available
Actions on Google
How you can extend
the Google Assistant
Help users get things done
with your service
Innovate with
Conversational Interface
@bretmcg
The next session about Kubernetes is “CI/CD for Node.js
and Kubernetes in room Fisher West on Thursday at
3:20. Is there another topic you’re interested in?
Sure! Here’s Node Summit
Ok Google, let’s talk to Node Summit
Enter Earcon
Exit Earcon
Hi, I’ll be your guide to Node Summit. I can help you
explore topics or pick a session to attend. What would
you like to know?
When is the next Kubernetes talk?
@bretmcg
Flow of an Action
@bretmcg
Architecture
...
@bretmcg
Create a project on the Actions Console
https://console.actions.google.com/
- Configuration and Assistant Directory setup
- Testing & Deployment
- Analytics
@bretmcg
Architecture
Your app
@bretmcg
Architecture
@bretmcg
- Define Intents and Entities
- Writing responses
- Use Training to improve
Actions Use API.AI (or other tools) to handle natural language
ListSessions (session_tags.KUBERNETES);
“What Kubernetes sessions are there?”
@bretmcg
API.AI demo
@bretmcg
Architecture
Google Cloud
@bretmcg
Cloud Functions
A serverless environment to build and
connect cloud services with code
● No managing servers
● Auto-scaling
● Pay only when invoked
● Node 6.11.1
● Local ephemeral disk at /tmp
● Auto-authed to other Google Cloud services
● Auto-compilation of native addon modules
@bretmcg
Architecture
Google Cloud Functions
const App =
require('actions-on-google').ApiAiApp;
function listTopicsIntent(app) {
ConferenceAPI.getCategories().then(
categories =>
app.ask("The topics covered are: ${topics}." +
"What do you want to learn?")
)
}
exports.myApp = function(request, response) {
var app = new App({ request, response });
app.handleRequest(listTopicsIntent);
};
Node.js app connected to API.AI
npm install actions-on-google
@bretmcg
Google Home app architecture
Google Cloud Functions
Your app's logicExtract entities and
intents from text
phrases
Assistant answers
user or routes to a
custom Action
{ JSON }
require('actions-on-google');
@bretmcg
Cloud Functions demo
@bretmcg
Response types
@bretmcg
Simple response
Supported surfaces:
● AUDIO_OUTPUT
● SCREEN_OUTPUT
640 character limit (300 recommended)
Speech Synthesis Markup Language (SSML)
@bretmcg
Card response
Supported surface: SCREEN_OUTPUT
Title and body
Header image
Link button
@bretmcg
Supported surface: SCREEN_OUTPUT
Used to pivot conversation
Maximum 8
Narrow many choices to most popular
Suggestion chips
@bretmcg
Selector responses
List selector
SCREEN_OUTPUT
Pagination
Carousel selector
SCREEN_OUTPUT
Rich cards
@bretmcg
Transactions
@bretmcg
Seamless signup
Top cause of abandoned carts:
● Forgotten Password
● Account Creation Pain
Assistant enables seamless sign-in
and account creation.
@bretmcg
Link to account
Link FoodBot to your
Google Account
Jane Doe
jane.doe@gmail.com
Use another account
Proposed order
1
1
Classic burger
Add cheese
Large fries
$8.00
$0.50
$1.50
Pay with Google
Visa ••••1234
Subtotal
Tax
Total
$10.00
$0.75
$10.75
Confirmed
2 items • $10.75
Delivery
123 Castro St, Mountain View
Confirm orderBuild basket Ask for address
Jane Smith
1600 Amphitheater Rd
Mountain View, CA 94043
Delivery address
Jane Smith
12345 Castro St
Mountain View, CA 94043
1 2 3
Payments Identity Receipts
@bretmcg
Development workflow
@bretmcg
Create a project on the
Actions Console
2
Test In our web simulator
or on device
Enhance your app for
mobile phones
Integrate your app with
our Transactions API
Use API.AI (or other tools) to
handle natural language
Connect a webhook
(we like Node.js)
1
3
4
5
6
Building our app
@bretmcg
Fast feedback loop: Ngrok + Functions emulator
Google Cloud Functions emulator Ngrok secure internet tunnels to localhost
LIVE
RELOADING
DEBUG IN
CHROME
@bretmcg
Architecture in development
ngrok
@bretmcg
Discovering your app
@bretmcg
How Users Discover your App
In Dialogue
2 Assistant Directory
Links that you share
1
3
In Dialogue Discovery:
Explicit Triggering
Ok Google, ask YodaBot to translate I'm from Texas
Trigger Phrase App Name
Developer Specified
Action
Preposition
Action Phrase
Developer Specified
Partner Examples: Let’s speak to Domino’s
At Akinator
Ask Dr. Doggy if dogs can eat chocolate
Ok Google, let’s talk to YodaBot
Trigger Phrase App Name
Developer Specified
@bretmcg
Hey Google, I want to play a game.Hey Google, tell me a joke.
In Dialogue Discovery:
Implicit Triggering
Hey Google, I want to work out. Hey Google, what’s the surf report
@bretmcg
Discovery in the
Google Assistant
Directory
@bretmcg
Link to your
Assistant App
From anywhere
Share through social media.
Promote through your own site or apps.
Encourage press to drive traffic
to your Assistant app.
@bretmcg
Thank you! Resources
Actions on Google
● developers.google.com/actions
Designing your Actions
● g.co/dev/ActionsDesign
Google Cloud Functions
● cloud.google.com/functions
Bret McGowen
Developer Advocate, Google
@bretmcg
Workshop: bit.ly/home-workshop

Google Home and Google Assistant Workshop: Build your own serverless Action on Google app