ClinQueryAgent: A Conversational Agent for Population Health Management

Joseph S. Boyle 1,2,3 , Anthony Dranfield 3 , Mike O’Neil 3 , Maria Liakata 2,4 , Alison Q. Smithard 1,3,4 1 Canon Medical Research Europe 2 Queen Mary University of London 3 Nottingham and Nottinghamshire ICB, NHS England 4 University of Edinburgh 5 The Alan Turing Institute · 2026

Read ClinQueryAgent: A Conversational Agent for Population Health Management by Joseph S. Boyle 1,2,3 , Anthony Dranfield 3 , Mike O’Neil 3 , Maria Liakata 2,4 , Alison Q. Smithard 1,3,4 1 Canon Medical Research Europe 2 Queen Mary University of London 3 Nottingham and Nottinghamshire ICB, NHS England 4 University of Edinburgh 5 The Alan Turing Institute (2026) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2605-18768.txt.

Introduction

Joseph Boyle and four co-authors introduce ClinQueryAgent, a 2026 agent turning population health questions into executable database queries. Cloud-based language models power the system while no patient data leaves the secure environment. Retrieval is delegated to a sub-agent to fight context rot over long dialogues. Deployed in a chat window inside a health platform, it served 128 staff from 15 practices covering 148,319 UK patients. Analysts and clinicians alike generate actionable information from health records through natural language requests, needing no programming expertise.

Catalog record

CREATORJoseph S. Boyle 1,2,3 , Anthony Dranfield 3 , Mike O’Neil 3 , Maria Liakata 2,4 , Alison Q. Smithard 1,3,4 1 Canon Medical Research Europe 2 Queen Mary University of London 3 Nottingham and Nottinghamshire ICB, NHS England 4 University of Edinburgh 5 The Alan Turing Institute
YEAR2026
COLLECTIONPAPERS
FORMATTXT
FILE SIZE31926
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2605.18768

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

ClinQueryAgent: A Conversational Agent for Population Health Management Joseph S. Boyle 1,2,3 , Anthony Dranfield 3 , Mike O’Neil 3 , Maria Liakata 2,4 , Alison Q. Smithard 1,3,4 1 Canon Medical Research Europe 2 Queen Mary University of London 3 Nottingham and Nottinghamshire ICB, NHS England 4 University of Edinburgh 5 The Alan Turing Institute Abstract In this paper we introduce ClinQueryAgent , a system for translating natural language population health questions into executable database queries using agents with access to both local and external knowledge bases. Our novel architecture enables the use of powerful cloud-based language models whilst ensuring that no patient data leaves the secure environment. To combat inaccuracies over the course of longer dialogues due to context rot, information retrieval is delegated to a sub-agent. We deploy the system via a chat window embedded within an existing population health management platform where it has been used by 128 staff from 15 healthcare practices covering a total of 148,319 patients in the UK’s National Health Service (NHS). We evaluate the system’s capacity to autonomously handle a range of health informatics tasks on a constructed dataset and via a beta-testing phase. Our results show that both analysts and clinicians are able to easily generate actionable information from patient health records using natural language requests requiring no programming expertise to verify. We make a public demo of the system available 1 1 1 Demo: https://demo-899965260288.europe-west1.run.app/ Figure 1: ClinQueryAgent parses natural language questions into database queries in an agentic loop. The Query Agent delegates the task of finding concepts to a Retrieval Agent so that it can focus on creating the database query. The Retrieval Agent has access to a local database of medical concepts , and the open-access ontology UMLS , which is used to help the retrieval agent parse unusual acronyms and synonyms. Diagram shows ClinQueryAgent’s response to a user request about patients with type II diabetes mellitus (“dm2”). 1 Introduction Healthcare organisations collect large quantities of data, which clinicians can use to proactively manage the needs of their patients. However, the task of interrogating recorded healthcare data is complex; to perform sophisticated queries, clinicians typically rely on specialist data analysts. Workflow description Real-world Example User Request List each patient in a cohort [General Practitioner] “List the new hypertension diagnoses in (returns a list) the last 12 months” Intention: Clinical audit Summarise age and sex statistics across a patient cohort [Pharmacist] “number of patients on semaglutide” (returns the count, mean age, and sex) Intention: Check financial spend [Follow-up: Check if budget is targeting desired patient population e.g. high deprivation patients who cannot afford medication] Show distribution of a variable for a cohort [Mental Health Commissioning Manager] “Can you find out the (returns a histogram) weights of the SMI QOF register patients excluding remissions?” Intention: Profile population of patients with mental illness to understand determinants of health e.g. obesity Show the prevalence of a concept across practices / areas / districts [Analyst] “smoking statistics by district” Optionally, compute the prevalence within a subpopulation, e.g. those with lung disease Intention: Assess regional variation, plan smoking cessation services (returns a percentage) Show a To-Do list of patients for whom an [General Practice Manager] “aged 75 or older with 15+ intervention is required medications without a structured medication review” (returns a list) Intention: Schedule medication reviews Table 1: The five categories (workflows) of data analysis that may be handled and displayed by eHealthScope, with corresponding real-world user request examples. The agent implicitly classifies the user request into a workflow description, which it typically describes at the beginning of its answer process: ‘To answer this question I will first search for hypertension and then create a cohort from those patients, and then link you to a register of those patients’. ‘SMI QOF register’ refers to a specific concept for patients with one or more Serious Mental Illness. To answer population-level questions, it is necessary to identify the patient cohort(s) of interest, in a similar manner to identifying a target cohort in a research study 4 . In Figure 1 , the required cohort comprises all patients with diabetes mellitus type II who are prescribed Ozempic. Patient cohorts can be identified by defining one or more “concepts” (sets of medical codes) and writing rules to describe eligible assignment patterns in the patient records (usually boolean logic, sometimes in combination with time constraints), then selecting all patients in which this assignment pattern is present. Many open source concept/cohort definition libraries exist such as 21 . In this case, NHS Nottingham and Nottinghamshire ICB has defined 16,452 local concepts tailored to their local data format and analytical requirements; the above cohort could be identified by finding patients with the local concepts Diabetes II and Semaglutide concepts (see Appendix A ). In this work, we introduce ClinQueryAgent – an agent-based system for querying clinical databases through a task-oriented dialogue with a clinical user using generative language models 1 ; 20 ; 16 . Our system automates the creation of the population health queries, based on the observation that queries are easy to verify but labour intensive to produce. Given a natural language request, the system must express the user’s goal as a logical query in terms of clinical concepts. Unlike SQL, a logical representation is easily understood by clinicians, empowering them to audit and co-author the query with the agent. This is subsequently compiled into an executable SQL query and run on patient data by the agent’s host system. Figure 2: ClinQueryAgent (CQA) is situated within the eHealthScope application which serves a variety of users via the secure NHS intranet. Patient data is aggregated from healthcare centres into a central data warehouse (EHR) which is inaccessible to CQA by design, represented by the firewall between them. We make the following contributions: 1. We demonstrate that conversational agents can provide fast and accurate natural language interfaces to clinical databases by evaluating ClinQueryAgent in a real world system used for population health management (here NHS Nottingham and Nottinghamshire ICB’s population health analysis platform eHealthScope). 2. Our system design is privacy-preserving since the agent is isolated from the patient data, showing how to securely deploy systems in environments where the underlying data is sensitive whilst taking advantage of frontier generative models deployed in the cloud. 3. We observe accuracy degrades and cost increases during multi-turn conversations due to ‘context rot’ from large numbers of database results, and propose to reduce the main agent’s context via delegation of database search to a subordinate agent. 4. We show that providing access to a knowledge base improves accuracy for queries involving specialist medical terminology. 2 Related Work Our proposed system sits at the intersection of two prevailing research topics: task-oriented dialogue and text-to-query systems. Task-Oriented Dialogue In task-oriented dialogues (TODs), an agent and user collaborate to enact a user’s goal 24 . LLM agents are augmented with tools which enable them to take actions within an environment e.g. retrieving information from Wikipedia in order to obtain an answer. An early example was SimpleTOD, a GPT-2 based agent which performs all aspects of task completion including database calls 5 . Subsequent systems have continued to function via autoregressive language modelling, interleaving reasoning traces with

Read the complete text