Legal Ops Reinvented by AI in Pharma
Transforming legal contract management through AI-powered search, automated document processing, and intelligent insights for Pharma Company's legal team.

The vision
Pharma Company, an innovative pharmaceutical company, is spearheading an AI transformation within the organization. Streamlining the legal document search process presented as the perfect opportunity to begin with, laying the groundwork for a future Contract Lifecycle Management (CLM) platform.
The Transformation
We set out to build this project under a Proof-of-Value (PoV) approach, aiming to transform how the Legal team searches and processes requests about contracts.
Our UX team designed an intuitive UI platform, while our ML engineers built AI agents to deliver custom services within the intended user flows. Through close collaboration with Pharma Company's team, we identified and prioritized pain points, enabling AI agents to automate or streamline time-consuming and repetitive tasks.
As a result, Pharma Company's legal team can access contracts by posing questions requests to an AI Agent that automatically queries a custom database with PDF documents and metadata extracted by an LLM. The platform also facilitates navigation through the contracts using quick filters based on custom fields extracted with AI and enables contract comparison against the original templates, helping to proactively identify potential issues. Custom-made AI chatbot, "Madra", can provide deeper insights into specific contract details not found in metadata.
AI
LLM
Learn More About
Team
ML engineer
Data Scientist
Back-End Engineer
QA Engineer
Product Owner
Project Manager
UX/UI Designer
Delivery
UX/UI design
Functional Web application
GitHub repository
Product Documentation
Exploring daily legal tasks and uncovering gaps in key processes
Before any AI or software development even started, the UX and Product team set out to explore and understand the current state of the contract search process within Pharma Company’s legal team.
By collaborating closely with the legal manager and examining her end-to-end process, which involved locating contracts and extracting pertinent information, we swiftly identified gaps and repetitive tasks. These inefficiencies, inherent to the available tools, were hindering the legal team's overall capacity.
Pain Points
The primary pain points we discovered where: Legal document database was too broad and time-consuming to browse in SharePoint; specific content had to be found by manually sorting through documents using metadata, which in turn was also extracted manually; legal team’s capacity was insufficient to handle the workload as external attorneys were required to assist; comparing against contract template was done mainly by putting both documents together side by side and manually going through both.
Proposed Solution
Based on these pain points, we identified 4 key use cases where AI could provide substantial support through a new and streamlined UI platform. This platform would be designed to resemble SharePoint to minimize disruption to the current workflow and reduce the learning curve. The overarching objective was to deliver an enhanced user experience that is both faster and easier, thereby freeing up valuable time for the legal team to focus on more strategic and high-value tasks.
The identified use cases were:
The PoV scope with these 4 use cases would potentially become the foundation for a Contract Lifecycle Management (CLM) platform in the future.
Objective & Scope
Pharma Company’s PoV objective was set out to automate and build the foundation for a more efficient content search process for the legal team. As explained above, after key pain points were identified and discovered through user research and interviews it was then possible to narrow down the actual scope of the project by delineating 4 use cases to tackle.
Let’s review how we did that, one by one.
Contract search was resolved by creating an AI agent equipped with keyword and metadata searches in the background of a similar UI that Pharma Company’s team used, hence minimally disrupting legal’s current process.
Metadata extraction was automated through another special AI agent that parsed all docs and stored metadata based on business rules aligned with Pharma Company’s legal team.
Contract content discovery was intended to be solved by creating a chatbot where the user could potentially ask questions about a specific contract, allowing a conversation to happen, instead of going through manually.
Finally, by devising an AI powered summary of differences between contract template and selected contract it granted the legal team to focus on what was really important to review, saving time and energy spent otherwise.
AI Approach & Performance
As discussed, AI features based on LLMs and Agents were chosen as the core tools for this solution. We pursued this path due to its suitability for a PoV, allowing for continuous exploration and testing of AI capabilities within the UI platform. By leveraging simple flows driven by AI agents, chatbots and prompt engineered solutions based on multimodal LLMs, we could quickly demonstrate value to the user across the four primary interactions.
Metadata Extraction
Previously, users had to extract relevant fields such as contract expiration date, execution date, contract signatures, among others manually from every single PDFs, and input them into SharePoint for sorting and filtering afterwards. To automate this, a multimodal LLM based solution was developed to extract metadata and store it in a database, facilitating SQL-based search queries. The AI-powered metadata extractor generally performed well, with exceptions for variables lacking clear business rules (e.g., expiration dates requiring legal expertise), informing potential changes and improvements of the tool.
Contract Discovery
The initial focus was on enhancing the contract discovery process. Maintaining the search bar as the primary user interface element was logical, aligning with standard search practices. However, behind the scenes, the AI team implemented two distinct approaches to process user input. This allowed both metadata and keywords to drive the search, enabling users to pose natural language questions as they would during a manual search. We implemented an AI agent with two accessible tools: one for metadata base search, and one for free keyword-based search. By leveraging its reasoning capabilities, our AI agent was able to smartly decide which tool to pick based on users’ requests, locating the necessary documents. This allowed both metadata and keywords to drive the search, enabling users to pose natural language questions as they would during a manual search.
Metadata-based search
We implemented our metadata based search tool by instructing an LLM to complete a SQL query with relevant information. This tool could generate custom SQL queries based on user requests and metadata. This approach achieved 71% accuracy for metadata-based search.
Keyword-based search
Using Azure AI Search, we quickly implemented keyword search for our AI agent, achieving 95-100% accuracy. This extra functionality allows users to search contracts by metadata, keywords, or both.
Contract Chatbot
A chatbot powered by an AI agent was created to understand contract content. Since contracts are relatively short, we avoided using a Retrieval Augmented Generation (RAG) approach and instead fed the entire contract PDF to a powerful LLM model. The chatbot answered questions and quoted supporting text, achieving around 84% accuracy on a test set of challenging questions.
Template Comparison
The template comparison AI tool utilized prompt engineering for structural analysis, highlighting deviations between a contract and its template. An AI-powered summary, guided by the contract template's structure, was designed to pinpoint differences for efficient legal review.
As user adoption was a key priority for Pharma Company, we decided to design and build a platform with similar functionalities and UI as the current software they were already used to work with, nevertheless, with key differences that enhanced contract search letting users add filters and conditions through natural language and further increased time saved by automating some steps along the way.
A new user journey was devised to diminish steps to get to a desired document, thus enabling Pharma Company’s legal team to quickly find and discover valuable information in a different way without completely disrupting the process.

Furthermore, by using Scrum Agile as the main development methodology, we could research AI agents capabilities that could procure a solution to each 4 use cases through spikes and then test it accordingly. This allowed the team to experiment and use the PoV to propose new changes that were not considered before as part of the solution at first.
For example, for the template comparison a side by side view of both documents was considered, however, after some AI exploration and UX debates, it was defined that a simple AI powered difference summary could pin point faster to the user to check what was really important, moreover saving time and costs.

“Commercial CMS failed at some of the things our POC does, and lack some features we love about it ”
-
AI Director of Pharma Company
Transformation
takeaways
At Arionkoder, we enjoy turning complex challenges into opportunities for innovation. In this project with Pharma Company, we delivered a transformative Proof of Value (PoV) in just three months. This achievement underscores our ability to rapidly align with client tech stack, leverage existing assets, and deliver scalable solutions—all within ambitious timelines. PoV’s end-to-end execution considered scope previously mentioned, including:
Future outlook of PoV: We also built a roadmap for growth as part of our final delivery, providing Pharma Company with a comprehensive plan to turn PoV into a production-ready Contract Lifecycle Management (CLM) system, including:
Cost-Benefit Analysis: Detailed migration plans and cost estimates for Azure adoption.
Feature Expansion: AI-driven recommendations for clause automation, risk scoring, and compliance tracking.
User-Centric Refinement: Prioritized enhancements based on stakeholder feedback to address edge cases in metadata extraction.
This project exemplifies our ability to deliver rapid, impactful results while strategically aligning with client technology ecosystems. By combining our AI expertise with a future-proof vision, we empower partners like Pharma Company to turn ambitious concepts into scalable, market-ready solutions.
Ready to transform your vision into reality? Let’s discuss how Arionkoder can accelerate your next AI-driven initiative.