Harness the power of LLMs to synthesize and reason over live clinical trial data -- bridging trial evidence and insight in real-time!
(c) Copyright 2025. Vin Bhaskara and Dr. Philip Mathew, MD.
Tl;dr. Quick installation: docker run -p 8000:8000 vinbhaskara/clintrialsgpt:latest
Chat just as you would with ChatGPT -- except that any query relevant to clinical trials will trigger an API call to the ClinicalTrials.gov database with relevant search terms inferred from the user's query (i.e. "agentic retrieval"). The responses to queries are grounded in the clinical trial data retrieved with appropriate citations.
Docker hub image link: vinbhaskara/clintrialsgpt:latest
Here is an example screenshot:
The following diagram illustrates the complete workflow pipeline for ClinTrialsGPT:
graph TD
A[User Input] --> B{Interface Type}
B -->|A2A Protocol| C[A2A Server]
B -->|Web Interface| D[Streamlit App]
C --> E[A2A Agent Executor]
D --> F[Streamlit Handler]
E --> G[Process Message]
F --> G
G --> H[LLM Query Analysis]
H --> I{Clinical Trial<br/>Related?}
I -->|No| J[Regular Chat Response]
I -->|Yes| K[Extract Search Parameters]
K --> L[Parse Parameters:<br/>- Condition<br/>- Terms<br/>- Intervention]
L --> M[ClinicalTrials.gov API Call]
M --> N[Retrieve Clinical Trial Data]
N --> O[Format as JSON Context]
O --> P[Context-Aware LLM Processing]
P --> Q[Generate Grounded Response<br/>with Citations]
Q --> R{Response Format}
R -->|A2A| S[A2A Protocol Response]
R -->|Streamlit| T[Streamlit Chat Display]
S --> U[Client Application]
T --> V[Web Browser]
J --> W[Standard LLM Response]
W --> R
%% Context Management
G --> X[Conversation History]
X --> P
%% External Services
M --> Y[ClinicalTrials.gov Database]
H --> Z[OpenAI API]
P --> Z
%% Styling
classDef userInput fill:#e1f5fe
classDef processing fill:#f3e5f5
classDef external fill:#e8f5e8
classDef output fill:#fff3e0
class A,B userInput
class C,D,E,F,G,H,I,K,L,P,Q,R processing
class M,Y,Z external
class S,T,U,V,J,W output
ClinTrialsGPT now supports the A2A (Agent2Agent) protocol developed by Google! This allows the agent to be used as a remote service by other applications and agents.
- Remote Agent Access: Use ClinTrialsGPT as a service from other applications
- Standardized Protocol: Follows Google's A2A specification for agent communication
- Streaming Support: Real-time streaming responses
- Agent Discovery: Automatic capability discovery via agent cards
- Context Management: Maintain conversation context across requests
# Start A2A server
python start_a2a_server.py --mode a2a
# Or use Docker
docker run -p 8000:8000 vinbhaskara/clintrialsgpt:latestFor detailed A2A documentation, see README_A2A.md.
Find your OpenAI API key by following instructions here: Link
Three ways to get the app running -
First, install Docker.
After installing Docker, open the Terminal/Command Prompt and run:
For A2A Server (default):
docker run -p 8000:8000 vinbhaskara/clintrialsgpt:latestFor Streamlit App:
docker run -p 8501:8501 -e RUN_MODE=streamlit vinbhaskara/clintrialsgpt:latestRun docker-compose up --build to build your own local image:
- A2A server will be available at http://localhost:8000
- Streamlit app will be available at http://localhost:8501
After installing the required python packages in requirements.txt:
For A2A Server (default):
python start_a2a_server.py --mode a2a
# Or directly: python a2a_server.pyFor Streamlit App:
python start_a2a_server.py --mode streamlit
# Or directly: streamlit run clintrialsgpt.pyThe start_a2a_server.py script provides an easy way to choose between modes:
# Check if OpenAI API key is configured
python start_a2a_server.py --check-key
# Start A2A server (default)
python start_a2a_server.py
# Start Streamlit app
python start_a2a_server.py --mode streamlitCheck the official A2A SDK website for further development info.
This tool is for informational and educational purposes only. It does not provide medical advice, diagnosis, or treatment. The information is retrieved from publicly available clinical trials data and may be incomplete, outdated, or misinterpreted.
By using this app, you acknowledge that all use is at your own risk. The creators accept no responsibility or liability for any outcomes, decisions, or actions taken based on the information provided.
Always consult a qualified healthcare professional for medical advice.
