How we developed a chatbot that solves our obsession with workplace acronyms at Volvo Cars

By team OASTRA, Volvo Cars 2022 Week 48 Hackathon

Admire Khulumo
Volvo Cars Engineering
7 min readFeb 23, 2023

--

At Volvo Cars, much like any large organisation, we have a habit of using acronyms or abbreviations in everyday communication. However, our love of acronyms can sometimes be a barrier to communication. At best it saves a few keystrokes, but at worst it makes people, especially newcomers, feel a little lost. Finding the meaning of an acronym or abbreviation is a fragmented experience, where we have multiple sources of truth, and non-intuitive ways of figuring out what things mean.

This is largely a cultural problem and getting people to stop using acronyms entirely isn’t so easy. So, being developers, of course we came up with a technical solution and implemented it during the 2022 week 48 Volvo Cars Hackathon. Our solution, dubbed Noah Cronyms, won the hackathon’s Don Norman Award and is what we discuss in this post.

TL; DR: Noah Cronyms is a bot on Slack and Microsoft Teams that helps you find any acronym across the company, all interfacing with a GraphQL API with data on a Notion database and Sharepoint site.

Noah Cronyms

We decided to implement our solution where the people communicate, and in our case, that was Microsoft Teams and Slack. The solution starts with an API connected to a database of acronyms and their meanings. This API is consumed by a Slack bot, Teams chat bot, and a Teams power automation. The setup is shown in the image below.

Noah Cronyms Architecture

1. GraphQL API

Because the number of acronyms used in the company is huge, disconcertingly so, we had to aggregate them from numerous sources to store in one central location. Notion was selected because of its ease-of-use, and the fact that it has an API to interact with. It’s not our final solution, but it will do as a start.

On top of the database we created a GraphQL abstraction, that shapes the data in a consumer-friendly way, abstracting away the storage model of the data, and instead just showing it as it would be consumed.

We implemented the GraphQL API using open-source technologies, GraphQL Yoga 3, and GraphQL Hive, and then hosted it in Azure using Azure Functions. To help with the responsiveness of the API, Azure Cache for Redis was used to speed things up.

The API exposes a few useful queries, as well as mutations for adding acronyms.

2. Slack Bot

From analysing the slack API documentation on interactivity, we came up with these two best options:

  1. Using slash commands — when the user encounters an acronym, they can type /command followed by some text then Slack can communicate with our servers to determine the appropriate response, either in real time or delayed.
  2. Slack could read all messages in which the app is a member, then forward them to our server which would look for acronyms and respond with their meaning

For us, the first option was better because of the following reasons:

  1. Slash commands were an easier option to integrate with from a technical perspective
  2. Reading all messages would raise privacy concerns
  3. Slack servers forwarding us every single message sent in the channel would be inefficient and place a strain on the server, leading to increase in costs

A deeper dive into the architecture of the slack commands integration can be found in the API docs here. When a user encounters an acronym they can privately or publicly enter our command in the message box, /noah or /acronym, followed by some or no text. Slack then forwards this information to our application server on a URL we configure on the slack dashboard. Our application server will then respond synchronously or asynchronously to the request with the response to the user. This response is based on the REST protocol and uses the slack API token obtained from the dashboard for authentication. To keep the application decoupled we settled on having a separate microservice to handle the communication with slack then communicate via GraphQL to our API server which is the source of truth for all acronyms. To reduce the overhead required to configure and maintain a virtual server, we settled on Azure Cloud Functions which is essentially a server-less product by Microsoft.

For the coding, our team members were proficient in different tech stacks. We wanted to select a stack that was easy to get setup with (smooth learning curve), had good documentation, and could get lots of support online forums e.g. Stack Overflow. We settled on Typescript because it is quite easy to learn, while still providing some rule enforcement, smooth integration with REST/JSON, and it is one of the natively supported languages in Azure Functions.

3. Teams Chat Bot

A Microsoft Teams chat bot was developed using Power Virtual Agents (PVA). This Software as a Service (SaaS) solution can be used to create complex conversations, but in our case, the bot fetches a description from the Notion database when asked about an acronym. The prototype was built in Microsoft Teams, but it is also possible to design it in a web app allowing more features and distribution options.

In Microsoft Teams PVA, a chatbot is created using no-code or low-code GUI, with blocks of support scenarios called topics. For example, a “Greeting” topic handles the initial interaction. Then, we add a list of trigger phrases that the chatbot listens to, like “Hello,” “Hi,” or “Hej hej.” Afterward, we added a message node to serve as a bot’s response, e.g., “Hi! I can fetch an acronym for you.” If the chatbot gets the correct trigger phase, it prints the message.

Teams Chat Bot trigger phrases

We then added the “Acronym” topic, which has four trigger phrases: “noah,” “NOAH,” “acronym,” and “Acronym.” When written, a question node is triggered to ask for an acronym. It then passes the response, as a variable, to the action node.

Teams Chat Bot topics

The action node contains PVA Flow Template that searches the Notion database for a given acronym and sends the result back to the message node. The Flow Template is the most complex part of the chatbot structure because here you define the HTTP request details. In our case, it is a POST request to the database using GraphQL query and then handling the response. It may contain no description when the acronym is not in the database or one or even several descriptions that must be appropriately formatted and shown in the chat. PVA Flow Template is the low-code part, where the whole topics flow is (almost) no-code.

Teams Chat Bot flow template

The Power Virtual Agent must be added as a separate app in Microsoft Teams. The user will need to enter Apps in the left-side menu, search for acronym-bot and click Add”. Currently, the prototype bot is unavailable in the Apps store.

4. Teams Power Automate

In addition to the chatbot on Teams, a Power Automate flow is only a right click away. Everything is presented in user friendly, and attractive Adaptive Cards, consistent over all platforms.

The design thoughts were to allow users to easily access and learn about abbreviations when collaborating in MS Teams. The workflow starts by right clicking a message in Microsoft Teams, and then selecting the flow under ‘more options’, that pops up a question card asking the user which abbreviation they want to learn about and how they want their answer.

It utilises the following:

  • GraphQL API — same backend as the Slack Bot
  • Adaptive cards — gathers and displays information in a consistent way across different devices and systems
  • Choice of public or private answer

The flow then collects transforms it into an object array, and formats it into adaptive card schema. It also uses the API to retrieve information and has a backup feature that searches the SharePoint site if the answer is not found through the API.

Future Work

Of course, we aren’t done! Since this was a short hackathon, there are some things we’d like to continue working on and polishing up. Notion is quite slow and we’d like to swap that out for a faster database. Some refactoring would be needed as well.

PS: Noah Cronyms isn’t a random name, it’s a play on words of “No Acronyms” 😉

Meet The Team (some of us):

Stephan Lanntorp, Admire Khulumo, Stefan Lunneborg, Kajsa Gauza, Kristoffer Jägestedt, Jerry Shikanga, Mahabir Gupta, and Yassin Ahmed.

--

--

Admire Khulumo
Volvo Cars Engineering

Lifelong Learner | .NET Backend Software Engineer | Aspiring AI Engineer