ClinAgent: A ReAct-Based Agent for Conversational Access to Clinical Trial Information
Summary
ClinAgent is a ReAct-based agent system using agentic RAG to enable natural language querying of clinical trial information, with evaluation across multiple LLM backends showing complementary strengths.
View Cached Full Text
Cached at: 09/15/26, 09:03 AM
# ClinAgent: A ReAct-Based Agent for Conversational Access to Clinical Trial Information
Source: [https://arxiv.org/html/2609.13860](https://arxiv.org/html/2609.13860)
Riccardo Cantini∗,2Domenico Talia2Paolo Trunfio2Marianna Talia4Rosamaria Lappano4,5and Marcello Maggiolini4Address: 1Department of Computer Science, University of Pisa, Pisa, Italy 2Department of Computer Engineering, Modeling, Electronics and Systems, University of Calabria, Rende, Italy\. 3Institute of Information Science and Technologies “Alessandro Faedo”, National Research Council, Pisa, Italy\. 4Department of Pharmacy, Health and Nutritional Sciences, University of Calabria, Rende, Italy\. 5Department of Experimental and Clinical Medicine, University “Magna Græcia” of Catanzaro, Catanzaro, Italy\. ORCID codes: AV 0009\-0004\-0428\-540X; RC 0000\-0003\-3053\-6132; DT 0000\-0003\-1910\-9236; PT 0000\-0002\-5076\-6544; MT 0000\-0002\-3440\-5618; RL 0000\-0002\-9374\-9701; MM 0000\-0002\-7485\-854X\. ∗corresponding author: rcantini@dimes\.unical\.it
###### Abstract
Agentic AI, Retrieval\-Augmented Generation, Clinical Trials, ReAct, Medical Informatics\. Abstract\.Querying clinical trial registries remains a manual and error\-prone process, requiring researchers to navigate large volumes of semi\-structured data without support for natural\-language interaction or cross\-source synthesis\. To address this, we introduceClinAgent, a conversational system based on agentic Retrieval\-Augmented Generation \(RAG\) that enables clinicians and researchers to query clinical trial information in plain language and receive grounded, up\-to\-date responses across multi\-turn interactions\. The system centers on a Large Language Model \(LLM\) agent following the ReAct paradigm, which iteratively reasons over queries, selects among a set of integrated tools, and refines its actions based on intermediate outputs\. These tools include a ClinicalTrials\.gov search interface, a PubMed module, and a Python\-based analyzer operating on a locally cached structured dataset of clinical trials\. We evaluate the system using a three\-phase framework assessing operational effectiveness, planning quality, tool\-use efficiency, and expert qualitative judgments, comparing three LLM backends: Gemini 3\.0 Flash and two variants of DeepSeek V3\.2 \(thinking and non\-thinking\)\. Results reveal complementary strengths, with DeepSeek \(thinking mode\) excelling in planning quality, while Gemini achieves the highest overall performance and strongest expert ratings\. Overall, our findings highlight the potential of agentic AI systems to improve the accessibility and synthesis of clinical trial information, supporting more efficient and user\-centered biomedical research workflows\.
††footnotetext:Article version: 11th September 2026 h\\currenttimeCET## 1Introduction
Clinical trial registries, such as ClinicalTrials\.gov, index over a million registered studies spanning several therapeutic areas and study phases\. Despite the scale of this resource, querying it remains a largely manual activity, with users relying on keyword\-based search through web interfaces or bulk CSV exports inspection with general\-purpose tools\[[1](https://arxiv.org/html/2609.13860#bib.bib1),[2](https://arxiv.org/html/2609.13860#bib.bib2)\]\. Neither approach supports natural language interaction nor offers any mechanism for synthesising information across multiple records or contextualising registry data against the broader scientific literature\.
Large Language Models \(LLMs\) have changed what is technically feasible here, yet their tendency to hallucinate — generating plausible but factually incorrect content — is not acceptable in a clinical context\. Retrieval\-Augmented Generation \(RAG\) addresses this by grounding model responses in documents retrieved at query time from verified external sources, substantially reducing hallucination without requiring model retraining\. Standard RAG pipelines, however, operate in a singleretrieval\-then\-generatepass, which limits their ability to handle queries that require gathering information from multiple sources or that benefit from iterative refinement\. Agentic approaches address this through an explicit reasoning loop: under the ReAct paradigm\[[3](https://arxiv.org/html/2609.13860#bib.bib3)\], an agent alternates between formulating a reasoning step, invoking a tool, and observing the result, repeating the cycle until sufficient evidence has been accumulated\.
Building upon these considerations, this paper makes two contributions\. First, we introduceClinAgent, a conversational AI system built on agentic RAG that enables clinicians and researchers to query clinical trial information in plain language, integrating three specialised tools under a single LLM agent\. These tools comprise aClinicalTrials\.gov searchmodule for retrieving trial records, aPubMed interfacefor accessing and summarising relevant biomedical literature, and aPython\-based analysiscomponent that operates over a locally cached, structured dataset of clinical trials accumulated during user interactions\. Second, we propose a three\-phase evaluation framework covering\(i\)\(i\)operational effectiveness,\(ii\)\(ii\)plan quality and tool\-use efficiency, and\(iii\)\(iii\)expert qualitative assessment, and apply it comparatively across three recent LLM backends—Gemini 3\.0 Flash and two versions of DeepSeek V3\.2, i\.e\., the standard model and a reasoning\-enabled variant \(thinking mode\)\. Results reveal non\-trivial trade\-offs across backends: DeepSeek leads on plan quality in thinking mode, consistent with its explicit reasoning capabilities, while Gemini 3\.0 Flash achieves the highest overall score and strongest expert ratings\. These findings suggest that agentic RAG is a practically viable approach to clinical trial information retrieval, and that the trade\-off between reasoning depth and factual reliability is a critical consideration for backend selection in clinical deployment\.
## 2Background and Related Work
Generative language models, despite their fluency, are prone to factual errors and cannot incorporate knowledge postdating their training\. Retrieval\-Augmented Generation \(RAG\) addresses both issues by grounding outputs in dynamically retrieved external documents, thereby improving factual accuracy and enabling access to up\-to\-date information without retraining\. Yang et al\.\[[4](https://arxiv.org/html/2609.13860#bib.bib4)\]systematically analyze RAG in medical AI, showing that grounding responses in curated knowledge reduces hallucinations and mitigates pre\-training biases, making RAG well\-suited to high\-stakes domains\. Miao et al\.\[[5](https://arxiv.org/html/2609.13860#bib.bib5)\]apply these principles in nephrology, demonstrating that standard LLMs without retrieval exhibit hallucination rates too high for clinical use, thereby establishing domain\-specific grounding as an operational requirement rather than a theoretical refinement\. OpenEvidence\[[6](https://arxiv.org/html/2609.13860#bib.bib7)\]is a clinical question\-answering system that provides grounded answers to medical queries by retrieving evidence from PubMed and curated clinical guidelines\. While it demonstrates the viability of AI\-assisted medical QA in high\-stakes settings, it operates over general clinical knowledge rather than trial registries, and does not support structured registry querying, programmatic analysis of trial records, or agentic multi\-step reasoning across heterogeneous tools and knowledge sources\.
The system most closely related toClinAgentis TrialGPT\[[7](https://arxiv.org/html/2609.13860#bib.bib6)\], which uses LLMs to match individual patients to eligible clinical trials by evaluating eligibility criteria and aggregating judgments into a trial\-level score, achieving expert\-level accuracy and significantly reducing manual matching time\. While TrialGPT andClinAgentoperate in the same domain, they address different problems: TrialGPT focuses on patient recruitment, whereasClinAgentsupports open\-ended natural\-language queries by synthesizing grounded responses from heterogeneous sources\. To the best of our knowledge, no existing system combines agentic RAG with multi\-source retrieval across both a trial registry and biomedical literature for conversational clinical information access, a capability with direct practical relevance for clinicians and researchers who require timely, grounded access to trial evidence without the overhead of manual registry navigation and inspection\.
## 3Proposed System
ClinAgentis an agentic AI conversational system for clinical trial information retrieval built on the ReAct paradigm\[[3](https://arxiv.org/html/2609.13860#bib.bib3)\]\. Upon receiving a natural language query, the LLM agent does not attempt to answer immediately; instead, it engages in an iterativereasoning–acting–observationloop\. In thereasoningstep, the agent interprets the query, decomposes it into sub\-goals, and formulates a retrieval plan\. In theactingstep, it invokes one of the available tools, delegating retrieval or computation to the appropriate external component\. In theobservationstep, it examines the tool’s output and decides whether the accumulated evidence is sufficient to produce a response or whether further actions are needed\. The overall architecture is shown in Figure[1](https://arxiv.org/html/2609.13860#S3.F1)\.
Figure 1:High\-level architecture ofClinAgent\. The LLM agent operates a closed reasoning–action–observation loop, selecting among three specialised tools within a multi\-turn user interaction\.The system integrates three specialised tools\. TheClinicalTrial searchtool wraps a module that translates free\-text queries into well\-formed requests to the ClinicalTrials\.gov REST API\. An LLM first extracts structured parameters from the query \(e\.g\., medical condition, intervention, NCT identifier, and result\-availability filter\), which are validated against a Pydantic schema before being serialised into a targeted HTTP request\. Retrieved records are cached locally in a CSV dataset, ensuring that data fetched during a session remains available for subsequent queries without redundant API calls\. ThePython Read\-Eval\-Print Loop \(REPL\)tool allows the agent to perform programmatic analyses on this locally cached dataset using Pandas\-based code, enabling filtering, aggregation, and statistical operations directly over retrieved trial records\. ThePubMed searchtool accesses the NCBI Entrez API via LangChain, enabling the agent to retrieve relevant biomedical literature and ground its answers in peer\-reviewed evidence as well as trial data\.
The agent dynamically selects tools based on the query and observed results, allowing high autonomy and resilience\. If a primary tool fails or returns insufficient information, the agent replans and attempts an alternative strategy without external intervention, ensuring seamless user interaction\. This iterative, self\-correcting approach enhances reliability and enables adaptation to complex, evolving queries, making the agent well\-suited for high\-stakes biomedical applications where precision and evidence\-based reasoning are essential\.
The workflow is implemented usingLangChainandLangGraphframeworks, the latter providing native support for the cyclic execution graphs required by agentic architectures\. Conversation state is persisted across successive requests via aMemorySavercomponent, enabling the agent to resolve follow\-up queries by reference to earlier exchanges, thus allowing effective multi\-turn interaction with the user\.
## 4Experimental Evaluation
We evaluateClinAgentusing a three\-phase framework designed to assess distinct aspects of system performance:operational effectiveness\(Phase 1\),plan qualityandtool\-use efficiency\(Phase 2\), andqualitative assessmentby clinical domain experts \(Phase 3\)\. Three LLM backends were included: Gemini 3\.0 Flash and two variants of DeepSeek V3\.2 \(thinking and non\-thinking mode\)\. Each model was evaluated on a standardised query set comprising factual retrieval of trial attributes, comparative analysis across studies, literature\-based questions, and mixed queries combining trial data with published evidence from PubMed\. The full results across all phases are reported in Table[1](https://arxiv.org/html/2609.13860#S4.T1)and discussed in the following sections\.
Table 1:Summary of results across all three evaluation phases\. For each metric, the best result across backends is highlighted in bold\. DeepSeek’s variant annotated withtmwas used in thinking mode\.### 4\.1Phase 1 — Operational Effectiveness
Phase 1 establishes whether each candidate LLM reliably completes a given set of queriesQQ\. For each queryq∈Qq\\in Q, a binarysuccessfunction is defined as follows:
success\(q\)=\{1if the agent produces a response relevant to the query0otherwise\\text\{success\}\(q\)=\\begin\{cases\}1&\\text\{if the agent produces a response relevant to the query\}\\\\ 0&\\text\{otherwise\}\\end\{cases\}\(1\)TheGoal Achievement Rate\(GAR\) is then computed as the fraction of successful queries:
GAR=1\|Q\|∑q∈Qsuccess\(q\)\\text\{GAR\}=\\frac\{1\}\{\|Q\|\}\\sum\_\{q\\in Q\}\\text\{success\}\(q\)\(2\)Gemini 3\.0 Flash achieved a GAR of1\.001\.00, successfully handling all queries in the evaluation set\. DeepSeek V3\.2 also demonstrated strong operational reliability, with performance varying across modes: the reasoning\-enabled \(thinking\) mode attains a higher GAR \(0\.940\.94\) than the non\-thinking mode \(0\.880\.88\)\. The observed failures are primarily attributable to incomplete tool invocations or premature termination of the reasoning loop before sufficient evidence is gathered\.
### 4\.2Phase 2 — Plan Quality and Tool\-Use Efficiency
Phase 2 analyzes not only whether the system reaches an answer, but also how it does so\. We first define thesuccessfunction for a single actionaarecursively to account for self\-correction:
success\(a\)=\{1if\[⊤\(a\)∧¬redundant\(a\)\]∨\[⊥\(a\)∧success\(replan\(a\)\)\]0otherwise\\text\{success\}\(a\)=\\begin\{cases\}1&\\text\{if \}\\bigl\[\\top\(a\)\\wedge\\neg\\,\\text\{redundant\}\(a\)\\bigr\]\\,\\vee\\,\\bigl\[\\bot\(a\)\\wedge\\text\{success\}\(\\text\{replan\}\(a\)\)\\bigr\]\\\\ 0&\\text\{otherwise\}\\end\{cases\}\(3\)where⊤\(a\)\\top\(a\)denotes that the invocation of actionaasucceeds,⊥\(a\)\\bot\(a\)that it fails,redundant\(a\)\\text\{redundant\}\(a\)thataaretrieves information already present in the current context, andreplan\(a\)\\text\{replan\}\(a\)the corrective action generated by the agent following the failure ofaa\. In this definition, an action that fails but is followed by a successful replan is credited, while one that fails irrecoverably or duplicates already\-retrieved information is penalized\. We then define thePlan Quality\(PQ\) andTool Use Efficiency\(Teff\{\}\_\{\\text\{eff\}\}\) metrics\. PQ measures the proportion of actions in the agent’s plan that are both successful and non\-redundant, crediting self\-correction through replanning\. Teff\{\}\_\{\\text\{eff\}\}measures the fraction of tool invocations that succeed on the first attempt, without considering recovery, thus penalising agents that reach a correct answer only after multiple failed invocations:
PQ=1\|Q\|∑q∈Q1\|Aq\|∑a∈Aqsuccess\(a\),Teff=1\|Q\|∑q∈Q1\|Aq\|∑a∈Aq𝟏\[⊤\(a\)\]\\text\{PQ\}=\\frac\{1\}\{\|Q\|\}\\sum\_\{q\\in Q\}\\frac\{1\}\{\|A\_\{q\}\|\}\\sum\_\{a\\in A\_\{q\}\}\\text\{success\}\(a\)\\,,\\qquad\\text\{T$\{\}\_\{\\text\{eff\}\}$\}=\\frac\{1\}\{\|Q\|\}\\sum\_\{q\\in Q\}\\frac\{1\}\{\|A\_\{q\}\|\}\\sum\_\{a\\in A\_\{q\}\}\\mathbf\{1\}\[\\top\(a\)\]\(4\)Here,AqA\_\{q\}is the set of actions executed by the agent for queryqq, and𝟏\[⊤\(a\)\]\\mathbf\{1\}\[\\top\(a\)\]is the indicator function that equals11if actionaasucceeds on the first attempt and00otherwise\. A compositeReAct Qualityscore is finally defined as the average of PQ and Teff\{\}\_\{\\text\{eff\}\}, rewarding both robust multi\-step planning and resilience to failure, as well as precision and efficiency in tool selection\. DeepSeek V3\.2 in thinking mode achieved the highest PQ \(0\.970\.97\), consistent with its explicit reasoning capabilities, which support more structured multi\-step planning\. Conversely, Gemini 3\.0 Flash attains the highest Teff\{\}\_\{\\text\{eff\}\}\(0\.560\.56\), reflecting more reliable first\-attempt tool selection and invocation\. On the composite ReAct Quality score, Gemini 3\.0 Flash \(0\.750\.75\) marginally outperformed reasoning\-enabled DeepSeek V3\.2 \(0\.730\.73\), while DeepSeek V3\.2 in non\-thinking mode \(0\.620\.62\) lags substantially behind\.
### 4\.3Phase 3 — Expert Qualitative Assessment
In this phase, experts evaluated system responses across four test scenarios—factual retrieval, comparative analysis, literature\-based questions, and mixed queries—using a five\-point Likert scale over eight criteria:clarity,completeness,logical consistency,correctness,factuality,relevance to the question,quality of interaction, andclinical relevance\. Scores were normalized to the\[0,1\]\[0,1\]interval\. Gemini 3\.0 Flash exhibits the most balanced profile, achieving the highest scores in logical consistency and clarity, with comparatively lower performance in completeness, suggesting well\-structured and accurate responses that occasionally omit relevant aspects\. DeepSeek V3\.2 in non\-thinking mode performs strongly in clarity and completeness but drops markedly in relevance, indicating a tendency toward detailed yet less focused answers\. In contrast, the reasoning\-enabled version of DeepSeek V3\.2 scores substantially lower than both models in factuality, correctness, and clinical relevance, despite leading in interaction quality\.
### 4\.4Overall Results
Theoverall scoreis computed as the average of Phase 1, Phase 2, and Phase 3 assessment scores, aggregated across experts and metrics\. Gemini 3\.0 Flash achieves the highest overall score \(0\.800\.80\), emerging as the most balanced backend for deployment in this setting\. DeepSeek V3\.2 variants perform comparably at the aggregate level, but exhibit complementary strengths: the standard variant \(0\.720\.72\) yields clearer and more complete responses according to expert evaluations, whereas the reasoning\-enabled variant \(0\.710\.71\) demonstrates superior multi\-step planning and greater resilience to tool failures, albeit at the cost of reduced factual reliability\.
## 5Conclusion
We presentedClinAgent, a ReAct\-based agentic AI system for conversational clinical trial information retrieval, along with a three\-phase evaluation framework to assess agentic approaches in biomedical information access\. Evaluation across three different LLMs highlights non\-trivial trade\-offs in backend selection: Gemini 3\.0 Flash achieves the highest overall score and the strongest expert ratings, making it the recommended choice for deployment, whereas DeepSeek’s reasoning\-enabled variant offers measurable advantages in multi\-step planning at the cost of lower factual reliability\. Future work will focus on extendingClinAgentto include additional domain\-specific sources, such as regulatory databases and institutional electronic health records\.
## Conflict of interests
The authors declare no conflicts of interest\.
## Funding
We acknowledge financial support from “FAIR – Future Artificial Intelligence Research” project \- CUP H23C22000860006, and “ECHO\-TWIN – Edge\-Cloud\-HPC Optimized Twins” project, an initiative of the National Center ICSC\-HPC, Big Data and Quantum Computing\.
## Availability of data and software code
## References
- \[1\]M\. Paunic, S\. Rim, O\. Hilal, R\. Nassar, Z\. Driedger,et al\.\(2025\)Cross sectional analysis of clinical trials search results for cancer patients using a navigator\-assisted clinical trials search using five different search engines\.Plos one20\(6\),pp\. e0326139\.Cited by:[§1](https://arxiv.org/html/2609.13860#S1.p1.1)\.
- \[2\]T\. Tse, K\. M\. Fain, and D\. A\. Zarin\(2018\)How to avoid common problems when using clinicaltrials\. gov in research: 10 issues to consider\.Bmj361\.Cited by:[§1](https://arxiv.org/html/2609.13860#S1.p1.1)\.
- \[3\]S\. Yao, J\. Zhao, D\. Yu, N\. Du, I\. Shafran,et al\.\(2022\)React: synergizing reasoning and acting in language models\.InICLR,Cited by:[§1](https://arxiv.org/html/2609.13860#S1.p2.1),[§3](https://arxiv.org/html/2609.13860#S3.p1.1)\.
- \[4\]R\. Yang, Y\. Ning, E\. Keppo, M\. Liu, C\. Hong,et al\.\(2025\)Retrieval\-augmented generation for generative artificial intelligence in health care\.Npj health systems2\(1\),pp\. 2\.Cited by:[§2](https://arxiv.org/html/2609.13860#S2.p1.1)\.
- \[5\]J\. Miao, C\. Thongprayoon, S\. Suppadungsuk, O\. A\. Garcia Valencia, and W\. Cheungpasitporn\(2024\)Integrating retrieval\-augmented generation with large language models in nephrology: advancing practical applications\.Medicina60\(3\),pp\. 445\.Cited by:[§2](https://arxiv.org/html/2609.13860#S2.p1.1)\.
- \[6\]OpenEvidenceNote:Accessed: April 2026[https://www\.openevidence\.com](https://www.openevidence.com/)Cited by:[§2](https://arxiv.org/html/2609.13860#S2.p1.1)\.
- \[7\]Q\. Jin, Z\. Wang, C\. S\. Floudas, F\. Chen, C\. Gong,et al\.\(2024\)Matching patients to clinical trials with large language models\.Nature communications15\(1\),pp\. 9074\.Cited by:[§2](https://arxiv.org/html/2609.13860#S2.p2.1)\.Similar Articles
@JenovaAIAgent: Clinical Research Advisor is an AI agent that helps you design, review, and de-risk clinical studies from protocol to F…
Clinical Research Advisor is an AI agent that helps design, review, and de-risk clinical studies from protocol to FDA and EMA submission with methodologist-level guidance.
Configurable Clinical Information Extraction with Agentic RAG: What Works, What Breaks, and Why
ACIE, an agentic RAG system for clinical information extraction, achieves 96.5% acceptance rate in nuclear-medicine physicians' judgments across 7,326 instances, addressing challenges of heterogeneous patient contexts and missing metadata.
Research Assistant: AstraZeneca's Agentic System for R&D
AstraZeneca describes Research Assistant, an internal LLM-based multi-agent system that lets scientists explore biomedical data via chat, with evidence grounding and citation links, deployed to 15,000 internal users.
"OncoAgent: A Dual-Tier Multi-Agent Framework for Privacy-Preserving Oncology Clinical Decision Support"
The article introduces OncoAgent, a dual-tier multi-agent framework designed for privacy-preserving clinical decision support in oncology. It details a system architecture that combines corrective RAG, a reflexion safety loop, and dual-tier QLoRA fine-tuning optimized for AMD hardware.
RadAgent: A tool-using AI agent for stepwise interpretation of chest computed tomography
RadAgent is a tool-using AI agent that generates chest CT reports through interpretable step-by-step reasoning, improving clinical accuracy by 36.4% relative and achieving 37% faithfulness—a capability absent in existing 3D vision-language models. The system provides fully inspectable reasoning traces allowing clinicians to validate and refine diagnostic outputs.