Creating Lumos: an AI-driven habits coach
Lasoo is a workplace goal achievement system, where users identify work objectives and then build a system of habits and routines to help reach those goals.
The recent emergence of large language models (LLMs) has presented an opportunity to help our users with these steps using an embedded product experience.
This article is about we created Lumos, an AI-driven coach, or intelligent agent (IA) within the Lasoo system. We cover some of the product and technical issues we worked through in order to deploy the feature.
Presenting AI-driven functionality to users
When we began the project, we were aware that there were a number of ways we could embed IA functionality within our app from a user experience point of view.
Some common options are:
Persistent IA: A persistent messaging window where the user could have an ongoing conversation with the intelligent agent. This model is popular with AI-driven customer service experiences.
Context-specific IA: Specific touchpoints within the app where the intelligent agent appears to help the user.
Invisible IA: Specific touchpoints within the app functionality that are driven by AI but not presented to the user explicitly as an embodied intelligent agent. Spotify's music recommendations are an example of this.
On weighing the options, we ended up picking option #2. We were interested in targeting critical use cases and felt an embodied IA coach would add added sense of fun to Lasoo.
Creating a name and personality
We now needed to create a name and personality for our IA, so why not get an AI to help?
We decided to try GPT, and after many attempts and steps refining our prompt, the response we liked the most was…
We thought the name Lumos worked well. It was short and memorable, and suggested that the IA will shed light on the subject. We also liked the playful Harry Potter reference.
Designing an avatar
You guessed it, we used AI to create an avatar as well.
Picking up on the Harry Potter theme, we thought an owl would make most sense as an embodiment of Lumos.
We used then Midjourney to generate avatars based on Lasoo brand colours.
This version seemed to strike the right balance of looking wise and playful at the same time.
Touchpoints UX
It would be important to be consistent around the touchpoints where Lumos appears in the app. For this reason, we build a standard touch-point card, with a unique yellow background that distinguishes Lumos functionality from the rest of the application.
When a user taps these touch-points, Lumos pops up and asks the user questions before responding to the query. We use a typewriter-style animation that is familiar from ChatGPT to help users understand what they are interacting with.
Textual responses from Lumos are presented using a typewriter animation on the same yellow background.
In some cases we display the output from Lumos, not as text, but as data elements from our application. For example, when a user asks Lumos to recommend habits for an objective, the response is a list of habit cards.
Querying OpenAPI using structured data requests and responses
Using OpenAI API, one challenge we come was to provide structured data to the LLM and receive structured data responses.
In one case, we want to tell OpenAI about our library of habits and routines and get it to return data in a structured way so our application could process it.
One recommended way to provide structured inputs and outputs to LLMs is via comma-separated tables of text.
The LLM prompt for habit suggestions therefore looks like:
You are Lumos, an intelligent agent coach for a workplace habit tracker. You are designed to inspire and motivation users on their journey to set and achieve their goals via effective habits. The personality of Lumos embodies traits such as empathy, patience and adaptability [... rest of personality description...]
The following is a comma-separated table of habits, the first column is the habit id, the second is the habit name, and the third is the category.
active-listening,Active Listening,Communication
avoid-interrupting,Avoid Interrupting,Communication
[…rest of habits database..]
For a person who has an objective called “Improve my communication skills” recommend up to five habits from this table that might help them. Answer with a comma separated list of habit ids.
The LLM responds to these queries with a string such as “active-listening,avoid-interrupting”, which Lasoo converts in a list of habit cards.
Security Questions
You’ll notice that the query in the previous section is generated dynamically from user-generated content, in particular the name of their objective.
This opens up the question of whether it would be possible for a user to invoke an injection-style attack on the application to compromise the security of the system in a similar way to SQL injection.
Although we don’t believe the use cases Lasoo presents are vulnerable to injection attacks, this is definitely worth thinking through if you are integrating with an LLM. With LLMs there is no way to effectively quote or limit the scope of parts of the query like there typically is with SQL queries.
Privacy Questions
Another question that came up was user privacy issues with sending data to OpenAI.
We’ve been very careful to engineer queries in a way that does not identify specific users, but we are aware that some of our customers may prefer to turn this feature off, especially those that have security guidelines preventing data storage in the United States.
Conclusion
Creating Lumos has been an interesting exercising building functionality on a large-language model API.
We believe that LLMs have opened up possibilities to solve user problems that previously we not solvable. For a relatively small investment, we have been able to add some features into our system that were previously not feasible to build.
LLMs are still very new though, and they raise many interesting questions…
How should functionality be best presented to users?
What is the best way to build LLM queries from within an app?
How best to mitigate potential security problems that might arise from dynamically generated queries?
How best to mitigate privacy concerns from sending data to a 3rd-party LLM.
Overall we are really excited about the potential of Lumos without our experience. We can see many it support many other future use cases.
If you are a Lasoo user, please try Lumos out and let us know your feedback!