Generative AI

Generative AI in Healthcare to Improve Workflows

Icon of a triangle with an exclimation mark in the middle


Inefficiency caused by manually searching through complex documentation

Icon of a location marker with five dashes coming out from the top


Developed, launched, and iterated on a generative AI tool to streamline work

Confidential Healthcare Company

Dedicated to AI and ideas that transform healthcare experiences

The thoughtbot team worked with a client that has stayed relevant and successful through the use of cutting-edge innovations.

By leveraging the latest technological advancements in artificial intelligence and machine learning, this client optimized their internal workflows to provide unique insights and deliverables at lightning speed. As a marketing agency in the healthcare space, they pride themselves on helping their clients create relatable brand experiences powered by generative AI.


Make internal knowledge and documentation more accessible to employees

As a large enterprise, the agency has hundreds of employees who need to create meaningful, accurate marketing content from complex research studies and other scattered, technical documentation. They edit and repurpose the content in various formats and collaborate on it with others across the organization.

A vision for leveraging Generative AI

The CTO of the agency came to thoughtbot with an idea for an internal enterprise ChatGPT tool that would allow their organization to keep their data proprietary while enhancing the workflow for employees to make them more productive. Because our client has a unique workflow and their data requires confidentiality, ChatGPT didn’t meet their needs on its own.

While our client’s internal development team focused on maintaining their core products, thoughtbot was enlisted to image and develop this ambitious undertaking. This required senior architect support to design a data model and system, expertise in prototyping and incorporating feedback and research from users into the roadmap, and a full-stack engineer who could build an integrated app using both Rails and Python.

The thoughtbot team has been great to work with. The workflow from back-end to front-end is productive and overall dev velocity is impressive. They have shipped a ton of features in record time.

CTO, Healthcare Marketing Agency


Understanding the users and use cases 

The goal of this AI solution was to allow various teams to quickly generate text responses to improve the workflow and productivity of their role.

In order to create an effective internal tool, we first needed to understand the users for the solution. There were two distinct groups:

Group 1: The data team was a group of tech-savvy users already using ChatGPT who were comfortable with the way it works. This group even had some "manual prompts" that they were already sharing using Google Docs. Internal teams were using existing proprietary tools to automate data processing and other relevant tasks for marketing campaigns.

Group 2: The client-facing teams primarily work on creating marketing campaigns for pharmaceutical companies. This group was less tech-savvy. They usually have to research, review, write, and edit materials for an array of marketing channels. These folks seemed to be the ones who were a bit resistant to using a new AI app. They expressed early on not understanding what a prompt was and not wanting to "do something wrong" when using it. They also had a hard time understanding the template format on the prompt creation.

In addition to understanding the users and their use cases, the thoughtbot team started running unit tests to fully immerse in the project. Running unit tests and understanding the bounds of OpenAI’s ChatGPT’s capabilities created a foundation from which to build.

Creating a superior, more relevant experience to ChatGPT and manual data analysis

The initial MVP was a wrapper around ChatGPT that focused on common tasks for the marketing team. For example, the common task of creating personas based on large data sets. The marketer will have a CSV of raw demographic data (focused on the pharmaceuticals space) and they need to split it into market segments and then turn those market segments into personas. With the new internal AI solution, the marketer now has access to canned prompts that guide them through uploading the CSV and then prompting OpenAI for next steps such as "split into 5 market segments" then "turn segment 1 into a persona" and so on.

The LLM (Language Learning Model) isn’t hidden from the user but it makes common tasks easier. They have a list of prompts that they can maintain for themselves and that they can share with others on their team. Similarly, they can share these AI conversations with others on the team.

Designing a custom, simple OpenAI user experience

There were three design priorities:

  1. Make the text input experience as simple as possible. This included how the user interacts with the selection of prompts, inputs the starter text, and the selection of the generative text engine, ChatGPT. 
  2. Designing a WYSIWYG prompt experience. The initial prompt experience was a plain text editor which could be cumbersome. The prompts needed to include clarifications like "Explain [blank] to me like I'm [blank] years old".  thoughtbot added the ability to add "test cases" directly to the prompts within the creation page itself. This functionality greatly streamlines making immediate changes and conducting on-the-spot testing.
  3. Visual consistency. The last priority in the first batch of design work was creating overall consistency in the application across shared visual components, a final coat of paint to  make everything cohesive and attractive.

Tooling for both Web developers and data scientists

thoughtbot had to balance technical work between two teams: Rails Web developers and Python data scientists. The main LLM work made use of the LangChain Python library, but the user experienced a Rails app using the latest Hotwire library.

To make this work we build a simple Python Web API that proxies LangChain functionality. Since this was predominantly network-bound, we made use of the async Python tooling and the Quart Web library. We exposed basic LangChain functions as we needed them, including chains, and then used this API from the Rails app.


Streamlined workflows improve team productivity, new opportunities emerge for competitive differentiation

By teaming up with thoughtbot, the Healthcare Marketing Agency was able to create and launch their internal tool vision.

We successfully created a custom solution that takes advantage of OpenAI’s benefits while limiting the downsides of a public tool. Our solution prevented the lack of data protection, created a tailored user experience, and improved workflows to create a transformational outcome for our client.

Because this is an internal tool, our team had direct access to all users and fast, informative feedback cycles. This enabled us to iterate on features week over week to speed up the product roadmap.

Some of the highlights from the first phase of this ongoing project include:

  • Improved testing, test coverage, and test abstractions
  • Cloning conversations, cloning prompts
  • Re-generating ChatGPT output to avoid hallucinations
  • Sanitizing the output to avoid popular AI vulnerabilities
  • Onboarding and setup improvements
  • UX improvements for starting new conversations
  • Easier to understand what effects new prompts will have
  • Project prioritization and project management flow
  • Documentation to help users struggling with the app technicalities (ie liquid templates, and prompt engineering)

Our work on the generative AI project continues with the marketing agency. As the product has matured and users found value, word spread quickly from team to team about its effectiveness and additional teams continue to adopt it. The power of the solution has also inspired exploration into how it can evolve to become a client-facing product.

What does success look like for your project?