TxAgent: An AI Agent for Therapeutic Reasoning and Personalized Medication
What is TxAgent?
TxAgent is an AI therapeutic agent developed by Harvard Medical School that provides personalized treatment recommendations for patients through multi-step reasoning and real-time biomedical knowledge retrieval, combined with a toolbox of 211 tools. It can analyze drug interactions and contraindications, and develop treatment strategies based on individual patient characteristics (such as age, genetic factors, and disease progression).

TxAgent Features
Multi-step reasoning: TxAgent can evaluate drug interactions at the molecular, pharmacokinetic, and clinical levels, and identify contraindications based on the patient's comorbidities and concurrent medications.
Real-time knowledge retrieval: It can retrieve and synthesize evidence from multiple biomedical sources, and iteratively refine treatment recommendations through reasoning.
Tool invocation and decision support: TxAgent selects appropriate tools based on task objectives and executes structured function calls to solve treatment tasks that require clinical reasoning and cross-source validation.
Personalized treatment plans: It can tailor treatment strategies based on individual patient characteristics such as age, genetic factors, and disease progression.
Transparent reasoning traces: TxAgent generates natural language responses and provides detailed reasoning traces that explain each step of its decision-making process.
TxAgent's Capabilities
Knowledge grounding: Retrieves validated knowledge through tool calls and provides outputs based on it.
Goal-oriented tool selection: Uses the ToolRAG model to select and apply the most appropriate tool from ToolUniverse.
Multi-step reasoning for problem solving: Solves complex tasks or handles unexpected responses from tools through multiple iterations of thinking and function calls.
Leveraging continuously updated knowledge bases: Accesses continuously updated databases through tools to address questions beyond TxAgent's built-in knowledge.

Performance
TxAgent has performed excellently across multiple benchmarks, covering 3,168 drug reasoning tasks and 456 personalized treatment scenarios:
In open-ended drug reasoning tasks, it achieved an accuracy of 92.1%, outperforming GPT-4o by 25.8%.
In structured multi-step reasoning, it surpassed DeepSeek-R1 (671B).
In generalization across drug name variants and descriptions, it maintained variance of <0.01, exceeding existing tool-using LLMs by more than 55%.
TxAgent Applications
Drug reasoning tasks: TxAgent has performed excellently across multiple benchmarks, covering 3,168 drug reasoning tasks and 456 personalized treatment scenarios.
Clinical decision support: It can provide physicians with precise treatment recommendations, reducing the risk of adverse events and improving treatment decisions.
Drug interaction analysis: By calling external databases and machine learning models, TxAgent can evaluate interactions between drugs.
Personalized treatment adjustment: For example, adjusting drug dosages based on a patient's liver function status.
How to Use
1. Install dependencies:
An H100 GPU is recommended, with memory greater than 80GB.
Install ToolUniverse:
pip install tooluniverse
Install TxAgent:
pip install txagent
2. Run examples:
Run the example code:
python run_example.py
Run the Gradio demo:
python run_txagent_app.py
3. Pretrained models: Pretrained model weights are available on HuggingFace.
4. Toolbox (ToolUniverse): The core component of TxAgent, containing 211 tools covering all US FDA-approved drugs since 1939.
Script Planner Assistant▸
AI Apps
AI News 