Amazon Pharmacy is using generative artificial intelligence (generative AI) to fill prescriptions more quickly and accurately, make customer service faster and more helpful, and ensure the right quantities of medications are stocked for customers. Amazon Pharmacy is also working on AI applications that provide more transparent pricing on prescription medications, enabling customers to shop for the best price.
“Today, Amazon is using generative AI to make the pharmacy experience even better for our clinical teams and customers,” said Alexandre Alves, senior principal engineer at Amazon Pharmacy. “We saw an opportunity to rethink information flows that was both exciting and transformational.”
Amazon Pharmacy is a full-service pharmacy in the Amazon.com store. Customers can use Amazon Pharmacy to purchase medications prescribed by their doctor and have them conveniently delivered to their door. Prime members enjoy free, two-day delivery and many ways to save, including the Prime prescription savings benefit and RxPass, which offers access to unlimited eligible prescription medications for only $5 per month. All Amazon Pharmacy customers have 24/7 access to a pharmacist to discuss questions about their medications.
In the past year, Amazon Pharmacy has doubled the number of customers it serves, and AI is helping the team to efficiently scale. To power their generative AI capabilities, Alves and his team used multiple, pre-trained models from Amazon Bedrock and Amazon SageMaker. “By building our solutions on Amazon Web Services, our teams were able to move faster and focus on creating the best experience for customers,” said Alves.

Improving processing speeds to get medications to customers faster

Amazon pharmacy prescription bottle.
Alves has spent his entire career working as a computer scientist, using data and deep learning models to help streamline supply chains and predict customer demand. Now applying his expertise to health care, he said there is some truth to the cliche that doctors have bad handwriting—although today, in most cases, prescriptions are typewritten and arrive via an electronic scribe service used by clinical teams.
However, digital prescriptions can still contain confusing or inconsistent language. “The data does not have a standard structure. For example, within a field labeled “directions,” we might find phrases such as “take by mouth,” or “take orally,” he said. “By making these directions more structured, we can scale our operations, fill prescriptions more quickly and efficiently, and importantly, reduce human error.”
Amazon solved this challenge by running the original “unstructured” data through a generative AI model. That model uses a process called “named entity recognition” to create a structure for the text, using categories such as “dose” and “frequency.” From there, it helps Amazon Pharmacy clinical staff fill prescriptions and provide clear instructions for patients.
Every prescription is still reviewed by a pharmacist because provider guidance can be incorrect for reasons that AI cannot detect. Sometimes the prescriber will put “volume” in the field meant for “strength,” for example. But by combining a generative AI approach with the expertise of a pharmacist, Amazon is able to increase order processing speed by 90%, and, most importantly, reduce the rate of human error.

Stocking the right medications

An image of Andrew Vo, an Amazon pharmacist.
Drawing on his supply chain work, Alves and his team also use AI and machine learning (ML) to forecast demand. That helps Amazon stock the right medications in each location, ready to be dispensed when a prescription comes in.
“Generative AI helps us synthesize data to experiment with different stocking scenarios. This can help us improve our ability to predict the medications we need to have available in each location,” Alves said. “Similarly, we have various canisters that we use to dispense medications, and AI can help us better determine which one is best for each medication.”

Helping customers find the best price

Amazon pharmacy showing on a phone screen.
Amazon Pharmacy is using ML and generative AI with Large Language Models (LLMs) to offer real-time insurance estimates on prescription medications, without the customer needing to enter their insurance details. Customers can shop for the best price on medications by viewing a list of pricing options on Amazon Pharmacy’s site, this includes estimated insurance pricing as well as ways to save with the Prime prescription savings benefit, RxPass or automatic coupons.
“Seeing the price of medications directly on a pharmacy’s website or mobile app is surprisingly novel,” Alves said. “LLMs can create immediate value for customers by surfacing up-to-date pricing, which enables better decision-making.”

Offering customers better support

An image of a person holding a phone and an Amazon Pharmacy prescription bottle.
Generative AI can help the Amazon Pharmacy clinical and customer care team answer questions faster. It can review internal documentation pages and knowledge bases and then summarize them in a useful and clinically appropriate way. Amazon also augmented the process with guardrails that apply context to each question.
“Of course, in pharmacy, accuracy and safety are extremely important. We use an additional model to validate the answer,” Alves said. “This model is independent from the others and is trained by feedback from our staff. Our clinical and customer service representatives review everything before they speak with the customer.”

Delivering medications more efficiently

Amazon pharmacy prescription bottle in a fulfillment center.
Alves said that there’s always a balance between doing a task immediately and waiting until the work can be done in a batch. “By improving our ability to ingest data and interpret context, generative AI can help us improve these predictions and batching decisions, and help customers get their prescriptions more quickly,” he said. “If you don’t need a refill for a month, that request can probably wait until we can batch it. If you need a medication urgently, we’re going to bump it to the front of the line.”
Alves added, “We are constantly discovering new uses for generative AI. We’re excited about the potential to not only further improve the customer experience with Amazon Pharmacy, but also to significantly enhance the roles of our pharmacy staff, helping to create better health care outcomes.”
Find out more about Amazon Pharmacy.