Designing Personas for Google Action

Because it’s More Fun When the Machines Talk Back

Daniel Gwerzman
7 min readOct 10, 2017

In my last post, Building Google Action with JavaScript, I demonstrated the technical steps you need to do in order to make your own Google Action. In this post, I take it to the next level and add personality to my action. The goal of this is to make the action will be less boring, and make it better meet its mandate: “Math Trainer is a Google Action that encourages children to practice math.”

To do so, I asked my dear friend Ofer Golan to help me make the Math Trainer a little more personable. Ofer is a master of branding and has helped many companies around the world design unique voices for their brands. He has 20 years of experience working as creative director and a copywriter, and so I thought he would be a good person to turn to!

Ofer’s first response to my question about creating a personality for the Math Trainer, though, was a little hard to swallow: “You can not create a personality if you don’t have one.”

Joking aside, I persisted and asked him to share some of his wisdom and any guidelines he thought would be helpful. He then sent me his “5 authenticity rules for personality manufacturing”:

Authenticity Rule №1 — Start With What You’ve Got

The way I see it, authenticity is a crucial element in creating a trustworthy personality. Why trustworthy? If you need an explanation, you are not a human being. So the way I do it is to make a list of my own personality traits for which I am either liked or disliked (I am only human after all). For example: most people I know find me passionate, quirky and irreverent. So, when I write micro copy for an app or a conversation module for an agent, I use my own personality as a stepping stone. Thus, my vocabulary, my syntax, my tone and style hold a reliable and distinct feel to it.

Authenticity Rule №2 — Think Carefully About Your Words

Words shape how we feel (rather than simply what we think or know). If you wish for the personality you create to be as differentiated as you are, then embracing a distinct language — including tone and style — helps people engage with your brand and forge an emotional connection with the it via the text.

This emotional bond can only be strong as the personality is distinctive and differentiated. I believe everyone has a unique personality, but not all of us know how articulate it. So, first make a list of your own personality traits, what do then mean and how you express them by words, and only then start working on your project. Trust me when I say that you can not create a sustainable personality for any app, brand or agent, which is not anchored in your own personality.

Authenticity Rule №3 — Don’t Fake it

Never ever try too hard to be authentic. I don’t think I need to elaborate here.

Authenticity Rule №4 — Copy For Others? Get to Know Them

When I am asked to create a personality for a client or project other than my own, I always ask whomever I’m writing for about their values and tastes, and then go from there to create a suitable personality for the brand. The challenge here is to create an operating manual for that “client personality” which could be expressed by anyone, regardless of how different their own personality may be.

Authenticity Rule №5 — Strive for Predictability, But Not Too Much

The most interesting people I know are the people who’s reactions I can predict 82% of the time — but, importantly, not all the time. When creating an interesting and captivating personality for a brand, be sure to be relevant, understandable and yet just unpredictable enough to keep things interesting.

Creating a Math Tutor Personality

After reading Ofer’s rules, it was time to start working. First, Ofer asked me to show him the flow of the action, so I created this flowchart:

In order to create “understandable and yet unpredictable” action, we needed to add a lot more sentences for each action part in the conversation, as well as add more scenarios to it overall.

Starting with the scenarios, I expanded the flowchart to this:

So now the action can react differently if user give the wrong answer for the first time or for the fifth time. Same for the right answer. We also added another exit point if user answers correctly 10 times in a row.

In the next step, we created a spreadsheet for all the sentences in each scenario, named each scenario, and added a short description to it. I added the values that we can use in the sentence, and Ofer start adding the sentences.

Just from looking at the first two rows of the table, I’m sure you can guess what personality Ofer chose for the Math trainer:

While Ofer continued to insert sentences into the table, I went back to the code to adapt it to the new needs.

First I need to add the ability to respond with a random sentence for each scenario. So I add this function:

function getRandomLine (assistant, linesArray) {
let lines = [];
if (Array.isArray(linesArray) && linesArray.length > 0){
lines = linesArray;
} else {
lines = IN_ERROR_MESSAGE;
}
return lines[Math.floor(Math.random() * lines.length)];
}

Then I converted the String consts to arrays:

const WELCOME_MESSAGE = ['Welcome my young apprentice to the jedi math trainer. How much is %s?',
'Welcome oh curious one. I am your math trainer. How much is %s?',
'Greetings earthling, and welcome to planet math. I will be your math trainer. How much is %s?'];

Now I needed to replace the code that sends the text from:

assistant.ask(printf(WELCOME_MESSAGE + ' ' + ASK_QUESTION, newQuestion.question));

to:

assistant.ask(printf(getRandomLine(assistant, WELCOME_MESSAGE), assistant.data.question));

Finally, I needed to implement the new scenarios.

I update the “generateQuestion” function to set counters for right and wrong answers:

function generateQuestion (assistant) {
console.log('generateQuestion');
let newQuestion = getNextQuestion();
assistant.data.countCorrectAnswer = 0;
assistant.data.countWrongAnswer = 0;
assistant.data.answer = newQuestion.answer;
assistant.data.question = newQuestion.question;
assistant.setContext(QUIZ_CONTEXT);
assistant.ask(printf(getRandomLine(assistant, WELCOME_MESSAGE) + ' ' + getRandomLine (assistant, ASK_QUESTION), newQuestion.question));
}

And added the counting and scenarios logic into “checkAnswer” function:

function checkAnswer (assistant) {
console.log('checkAnswer');
console.log(assistant.getRawInput());
let answer = assistant.data.answer;
let question = assistant.data.question;
let userAnswer = assistant.getArgument("number") ? parseInt(assistant.getArgument("number")) : '';
assistant.data.countFallback = 0;
if (answer != userAnswer) {
assistant.data.countCorrectAnswer = 0;
assistant.data.countWrongAnswer++;
switch (assistant.data.countWrongAnswer){
case 2:
case 3:
case 4:
assistant.ask( printf(getRandomLine(assistant, WRONG_ANSWER_AGAIN), userAnswer, question));
break;
case 5:
assistant.data.countWrongAnswer = 0;
let newQuestion = getNextQuestion();
assistant.data.answer = newQuestion.answer;
assistant.data.question = newQuestion.question;
assistant.ask(printf(getRandomLine(assistant, WRONG_ANSWER_NEW_QUESTION), newQuestion.question));
break;
default :
assistant.ask( printf(getRandomLine(assistant, WRONG_ANSWER), userAnswer));
}
} else {
assistant.data.countCorrectAnswer++;
assistant.data.countWrongAnswer = 0;
let newQuestion = getNextQuestion();
assistant.data.answer = newQuestion.answer;
assistant.data.question = newQuestion.question;
switch (assistant.data.countCorrectAnswer){
case 4:
case 7:
case 9:
assistant.ask(printf(getRandomLine(assistant, CORRECT_ANSWER_AGAIN), newQuestion.question));
break;
case 10:
assistant.tell(printf(getRandomLine(assistant, CORRECT_ANSWER_OUT)));
break;
default :
assistant.ask(printf(getRandomLine(assistant, CORRECT_ANSWER), newQuestion.question));
}
}
}

Testing Our New Trainer

By this time, Ofer had already filled in most of the table, so we could start testing the new Math Trainer personality. At the beginning, we use the API.AI testing tools, but quickly we moved to the Google Action Simulator, which is more convenient and gives a better user experience.

We found out that some sentences sound badly when the action says them out loud, and some of them just don’t fit the persona, or sound like they were a part of a conversation. But this is why we do testing!

After our initial round of tests, we took our new Trainer + Personality to the best alpha testers in the world: our kids. Naturally, they had a lot of feedback for us, and we were impressed with how many important things they’d pointed out!

Apparently we had more work to do. Their feedback (translated into adult/programmer language) included things like:

  • Making sure the getRandomLine won’t return the last line the action sent to the user.
  • Adding a level system so the question can be harder as user keeps practicing.
  • Once the above has been implemented, allowing the user to change the difficulty level at any time.
  • And adding more sentences to the fallback cases, as well as some scenarios to help the user get back on track.

It seems that with development, there is always more to do (but that’s half the fun, if I’m being honest).

You are more than welcome to be a beta tester, too, by the way: All you need to do is ask Google Assistant, “Talk to Math Trainer.”

Let me know how it goes in the comments!

--

--

Daniel Gwerzman

Bridging between technology and human. Google Developer Expert, Google for Startups Accelerator mentor, a tech-strategic consultant, entrepreneur, and a Maker.