Users could find any record on a pharma data platform. They couldn’t get an answer out of it.
How we replaced a failing SQL agent and gave market access teams answers across 90+ jurisdictions in under a minute.
- Client
- Pharma data platform
- Industry
- Life Sciences
- Asked by
- Engineering leadership
- To a build decision
- 14 weeks: diagnosis, data, validation
- Built with
- LangGraph · domain SQL views · an API
- Published
- 20 April 2026
Results at a glance
What changed for the platform and its users.
55%
regular use among platform users, grown from 10% after launch. Nothing was mandated.
Platform usage300+
columns across seven domain views, up from 10 columns on one.
Data coverage<1
minute for questions that took days. The agent reliably writes 100+ line SQL.
Production use1
week to open the agent to other teams and agents through an API.
After launch01 · The question
“Our users can find any record. Why can’t they get an answer?”
The platform gives market access teams at global pharmaceutical companies regulatory, HTA and reimbursement data across 90+ jurisdictions. A team preparing a launch needs precedent from it: what each HTA body decided for comparable drugs, on which evidence, with which restrictions, and why.
Users could find any record. A landscape question still broke down into filters, exports and spreadsheets, or a wait of days for an expert’s report.
The company had already tried an AI agent. An external vendor spent months and a significant budget on it. It arrived as a narrow first version, a single view with 10 columns, and failed in real use. Engineering leadership decided to replace it, and this time to test the architecture before funding the build.
90+
Jurisdictions behind one question. Three of them hold the answer.
Platform record02 · What we found
The data had never been described for a machine reader. No agent could have worked on it, whoever built it.
10
columns the first agent could see, on a single view. Basic SQL only, no structured outputs, no guardrails.
Codebase review, at diagnosis>24
hours per landscape question: filter, export, cross-tabulate, or ask an expert, who asked a data engineer.
Client workflow, at diagnosis0
of the jurisdiction-specific constraints were written where an agent could read them. They lived with the domain experts.
Data review, at diagnosis03 · What we delivered
Four capabilities the company owns.
An intelligence layer that handles the full complexity of market access data, in every jurisdiction in the dataset.
04 · How it ran
It started with a diagnosis, not a strategy.
They had an agent in production that was not working. The first question was whether it could be saved.
- 01RescueDiagnosing the agent they already hadTwo weeks of workshops with engineering leadership and the team supporting the agent, and a review of the codebase. Its structure could not carry the questions users needed answered, so it had to be replaced. Leadership accepted that verdict, and its cost, on the evidence.
- 02Find · data onlyFixing the data before touching the agentStrategy was skipped by agreement: demand had already proven the use case. The data could not be skipped. Two weeks with the domain experts produced the first metadata layer.
- 03ProveTesting the architecture and the economics before funding the buildA ten-week validation, on the understanding that the first architecture might not pass. It did not: one documented no-go. Domain views then worked against the real data, and a cost-per-query analysis showed the agent could carry its own cost on the platform.
- 04BuildBuilding it to production standardProduction engineering with standards set from the start, and domain logic stored as data rather than code. Removing the old agent’s integrations added weeks of work.
- 05RunBack where they started, with a system that compoundsAfter launch we added multi-turn conversation, document summarization and an API. The API took a single week, because the architecture was composable.
Go or no-go · after ten weeks
Paid before any buildThe readout, against what was agreed before the build.
Why the no-go was cheap: ten weeks of validation produced one documented no-go, one working architecture and a cost per query the business could carry. The first attempt produced the negative answer alone, after months of work and a full budget spent, in production.
05 · Results
Market access teams get answers across 90+ jurisdictions in under a minute.
In-house experts stopped coordinating multi-day data engineering cycles and moved to client-facing work.
Data engineers reclaimed sprint capacity for the platform instead of ad-hoc query requests.
Follow-ups go from a decision into its trials, its regulatory approval, its reimbursement conditions and its rationale, in one place.
06 · What they learned
Enterprise text-to-SQL is a domain engineering problem, not a prompt engineering problem.
The pivot that worked was not a better model or a better prompt. It was reorganizing the data so the agent no longer had to solve problems that people also struggle with.
If this sounds like your company