Customer Stories

Automating Pharmacy Financial Analysis with Customized AI Solutions

Foundation model
End products
End products
Pharmacy Benefit Management (PBM) contracts
Near 100% accuracy

Minimal errors in data extraction

5x faster

Tabular data extraction time reduced from 10 to 2 minutes

1 AI Agent

One high-performance AI Agent



  • Manual processing of Pharmacy Benefit Management (PBM) contracts was inefficient and time-consuming; analysts spent considerable time extracting essential pricing, discount, and rebate information, leading to decreased productivity and increased operational costs.
  • Existing non-AI systems couldn't automate complex data extraction from PBM contracts effectively, leading to inaccurate and inefficient outcomes.
  • The prescription drug industry's strict regulatory requirements demand high levels of accuracy and reliability in data handling; traditional automation methods couldn’t meet these critical standards, risking compliance issues.


  • Used state-of-the-art OCR engine for superior text extraction capabilities 
  • Customized a large language model for in-depth analysis of extracted data
  • Trained the LLM on 20 PBM contracts from 2 vendors
  • Developed an API for automated PBM contract processing that outputs response in JSON format
  • Performed in-context learning using the client’s example documents and associated answer keys


  • Reduced information extraction time 5x (10 minutes → 2 minutes)
  • Developed one high-performing AI Agent
  • Accuracy approaching 100%, reducing data extraction errors


This leading digital healthcare company focuses on enhancing transparency, access, and affordability in the prescription drug sector. 

They deliver various services and platforms within the healthcare and pharmacy ecosystem for stakeholders like employers, Pharmacy Benefit Management (PBM), health plans, pharmacies, and drug manufacturers. 

Recognizing the need to streamline data extraction and boost efficiency, the company partnered with us to deploy customized Generative AI solutions. We developed AI Agents specifically designed for their unique challenges, significantly enhancing and accelerating their workflow.

As a result, the company now enjoys a more efficient, error-reduced process for handling complex PBM contracts and data.

Manual Pharmaceutical Contract Analysis Is Laborious and Prone to Errors

Digital healthcare companies dealing with pharmacy benefits solutions face major challenges in managing and analyzing PBM contracts. 

Pharmacy Benefit Manager (PBM) contracts are agreements between PBM companies and various stakeholders like pharmacies, drug manufacturers, and insurance companies. These contracts, packed with crucial details, specify pricing models, reimbursement rates, and the roles and responsibilities of each party involved.

Our client's team analyzed PBM contracts by manually sifting through them to identify and extract pharmacy financial summaries. The process was slow and susceptible to human error. 

There were two main problems with this approach:

  • Overlap in Contract Details/Structure
  • Slow and Error-Prone Manual Processes

Overlap in Contract Details/Structure: 

PBM contracts often exhibit a significant overlap in their functions, with variance occurring in very limited areas. This similarity across PBM contracts introduces a high risk of errors during information extraction due to the monotonous nature of the task. Analysts need to spend excessive time on each contract, which increases the likelihood of overlooking critical information.

Slow and Error-Prone Manual Processes: 

Manually extracting detailed information such as pricing, discounts, and rebates from various categories delays other operations. It is time-consuming for analysts to locate this information from PBM contracts and ensure it is recorded correctly in downstream applications. 

Reading, summarizing, and then digitizing this information into their existing tools required a lot of time and effort. The repetitive nature of manual data entry also increased the chances of inaccuracies in the recorded data.

These problems highlighted the client’s need for a solution capable of automating the extraction of pharmacy financials from PBM contracts. They partnered with us to develop a tailored Generative AI system that could automate their contract analysis workflow, enhance team efficiency, and reduce the likelihood of errors.

Custom Generative AI Solutions for PBM Contract Management

To address the challenges our client faced in extracting and managing data from PBM contracts, we developed a series of innovative solutions customized for their specific needs. Our approach combined the latest Generative AI technology with custom algorithms designed to tackle each problem head-on.

We designed a sophisticated API that integrates OCR and LLM technologies to automate the extraction of crucial data from pharmaceutical contracts, enhancing accuracy and efficiency.

Automating Financial Summary Extraction

API Workflow: 

  1. Text Extraction from PDFs:

We tested several OCR engines and selected the solution that produced the best results for our use case. We needed to extract text from PDFs, including those with low-resolution images and non-machine-readable formats. 

  1. LLM Call:

We conducted an LLM analysis applying in-context learning on the client’s most similar set of example pairs available (document text and example extraction outputs).

In-context learning:

  • Enables models to tackle tasks beyond their initial training scope
  • Adjusts the model's focus to the current task using examples of past successful completions

Key-value pairs: 

We preprocessed the client-provided key-value pairs to transform them from the .xlsx format to structured JSON responses. 

JSON is an open standard format that stores and transmits data using human-readable text. Using it here allowed us to effectively structure the extracted information, ensuring straightforward storage, analysis, and conversion.

This two-step case solution now streamlines the entire contract analysis process, from initial data capture to in-depth analysis and structuring. The final result was a significant boost in efficiency, accuracy, and overall operational performance.

We also made sure to adhere to data privacy regulations throughout the project lifecycle. 

Streamlined Contract Analysis Delivers Rapid Efficiency and Enhanced Accuracy

Our Custom Generative AI Solutions for PBM contract analysis have transformed the client's workflow. 

Automating the extraction of pharmacy financial summaries and pricing terms cut PBM contract processing time from an average of 10 minutes to roughly 2 minutes per document.  

This decrease in processing time has increased analyst efficiency and allowed the extraction process to run in the background. That way, we were able to save the client’s valuable time and resources even further.

Moreover, data extraction accuracy is now nearing 100%. This is a massive improvement in terms of reducing data handling errors.

This project's success extends beyond our client. It has established a new standard for PBM contract analysis in the pharmaceutical industry. It improves decision-making and negotiations, leading to more accessible medications and transparent pricing. 

Encouraged by these achievements, the client now plans to broaden the scope of our solution. They are looking to extract more detailed data from each PBM contract. We are at the initial production stage and discussing phase 2 development focused on this expansion.

Foundation Model
Product Types
Pharmacy Benefit Management (PBM) contracts

Achieve enterprise-wide workflow automation

Automate workflows?

Schedule a free,
30-minute call

Explore how our AI Agents can help you unlock enterprise-wide automation.

See how AI Agents work in real time

Learn how to apply them to your business

Discuss pricing & project roadmap

Get answers to all your questions