Skip to main content

TxAgent: An AI Agent for Therapeutic Reasoning Across a Universe of Tools

Project description

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

ProjectPage PaperLink TxAgent-PIP ToolUniverse-PIP TxAgent ToolUniverse HuggingFace

Overview

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. TxAgent

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

# Install from pip:
pip install tooluniverse

Install TxAgent:

cd ../
python -m pip install . --no-cache-dir

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


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

txagent-0.1.1.1.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

txagent-0.1.1.1-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

Details for the file txagent-0.1.1.1.tar.gz.

File metadata

  • Download URL: txagent-0.1.1.1.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for txagent-0.1.1.1.tar.gz
Algorithm Hash digest
SHA256 04e68a9352c1b709df3e187b1c72cf8038b1d2669efbb7714ac8f8ca8b0b9a1c
MD5 261976d6153a4a7880adc9bbb41cef46
BLAKE2b-256 50c41b179a82b57b5ac12f85ff3a2cb89d3b983505f341f30c141a4a0a767ece

See more details on using hashes here.

File details

Details for the file txagent-0.1.1.1-py3-none-any.whl.

File metadata

  • Download URL: txagent-0.1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for txagent-0.1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0967f23211ac7dd7256d155d087d8154bb38b191b2628938b0954deb42eb18e
MD5 45f1afb1e07b31b7c704baba31e1ec9d
BLAKE2b-256 4427374e4824ee39918e0dbf63875884ed8c9f29104c37426ea5daf2805950d9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page