Skip to main content

TxAgent: An AI agent for therapeutic reasoning across a universe of tools

ProjectPage PaperLink TxAgent-PIP ToolUniverse-PIP TxAgent ToolUniverse HuggingFace

Overview

TxAgent

Precision therapeutics require multimodal adaptive models that generate personalized treatment recommendations. We introduce TxAgent, an AI agent that leverages multi-step reasoning and real-time biomedical knowledge retrieval across a toolbox of 211 tools to analyze drug interactions, contraindications, and patient-specific treatment strategies.

  • TxAgent evaluates how drugs interact at molecular, pharmacokinetic, and clinical levels, identifies contraindications based on patient comorbidities and concurrent medications, and tailors treatment strategies to individual patient characteristics, including age, genetic factors, and disease progression.
  • TxAgent retrieves and synthesizes evidence from multiple biomedical sources, assesses interactions between drugs and patient conditions, and refines treatment recommendations through iterative reasoning. It selects tools based on task objectives and executes structured function calls to solve therapeutic tasks that require clinical reasoning and cross-source validation.
  • The ToolUniverse consolidates 211 tools from trusted sources, including all US FDA-approved drugs since 1939 and validated clinical insights from Open Targets.

TxAgent outperforms leading LLMs, tool-use models, and reasoning agents across five new benchmarks: DrugPC, BrandPC, GenericPC, TreatmentPC, and DescriptionPC, covering 3,168 drug reasoning tasks and 456 personalized treatment scenarios.

  • It achieves 92.1% accuracy in open-ended drug reasoning tasks, surpassing GPT-4o by up to 25.8% and outperforming DeepSeek-R1 (671B) in structured multi-step reasoning.
  • TxAgent generalizes across drug name variants and descriptions, maintaining a variance of < 0.01 between brand, generic, and description-based drug references, exceeding existing tool-use LLMs by over 55%.

By integrating multi-step inference, real-time knowledge grounding, and tool- assisted decision-making, TxAgent ensures that treatment recommendations align with established clinical guidelines and real-world evidence, reducing the risk of adverse events and improving therapeutic decision-making.

Setups

Dependency:

- An H100 GPU with more than 80GB of memory is recommended when running TxAgent. 
- ToolUniverse requires a device with an internet connection.

Install ToolUniverse:

# Install from source code:
git clone https://github.com/mims-harvard/ToolUniverse.git
cd ToolUniverse
python -m pip install . --no-cache-dir
OR
# Install from pip:
pip install tooluniverse

Install TxAgent:

# Install from source code:
git clone https://github.com/mims-harvard/TxAgent.git
python -m pip install . --no-cache-dir
OR
# Install from pip:
pip install txagent

Run the example:

python run_example.py

Run the gradio demo:

python run_txagent_app.py

Pretrained models

Pretrained model weights are available in HuggingFace.

Model Description
TxAgent-T1-Llama-3.1-8B TxAgent LLM
ToolRAG-T1-GTE-Qwen2-1.5B Tool RAG embedding model

Demo cases

Please visit project page for more details. Demo1 Demo1 Demo1

Citation

@misc{gao2025txagent,
      title={TxAgent: An AI Agent for Therapeutic Reasoning Across a Universe of Tools}, 
      author={Shanghua Gao and Richard Zhu and Zhenglun Kong and Ayush Noori and Xiaorui Su and Curtis Ginder and Theodoros Tsiligkaridis and Marinka Zitnik},
      year={2025},
      eprint={2503.10970},
      archivePrefix={arXiv},
      primaryClass={cs.AI},
      url={https://arxiv.org/abs/2503.10970}, 
}

Contact

If you have any questions or suggestions, please email Shanghua Gao and Marinka Zitnik.

Metadata

Release files for txagent 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for txagent 0.1.3
File Size Uploaded
txagent-0.1.3.tar.gz 16.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for txagent 0.1.3
File Interpreter ABI Platform
txagent-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 30.9 kB

Release files / txagent-0.1.3.tar.gz

Download URL txagent-0.1.3.tar.gz
Size 16.3 kB
Tags Source
SHA-256 checksum
How to use checksums
c2eb9786594eaff0c6e257aaa50607c64dc720d6faa178310512917ef4a05168
BLAKE2b-256 checksum
How to use checksums
b851766838628e6468a329fdf69353cb35328bd71d4c17e20c8cd2dfd21392e2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.7

Release files / txagent-0.1.3-py3-none-any.whl

Download URL txagent-0.1.3-py3-none-any.whl
Size 14.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c1665572604a33d5ec4ad340eaabdc2c30f9547970bf905968c2cba0abd3635d
BLAKE2b-256 checksum
How to use checksums
941a4332606c43163eaa7df19ee764df259d2bc2ecd6c9c324d6ad2bdb7f6a17
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.7

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page