AI Personal Learning
and practical guidance
Beanbag Marscode1

TxAgent: the AI tool that helps doctors analyze drug effects and treatment options

General Introduction

TxAgent is an open-source AI tool developed by Harvard University's Medical and Scientific Artificial Intelligence Team (MIMS) to help physicians analyze drug interactions and develop personalized treatment plans. It generates therapeutic recommendations through multi-step reasoning and real-time retrieval of biomedical knowledge, taking into account patient-specific circumstances (e.g., age, genetics, disease state).TxAgent integrates a library of 211 biomedical tools called ToolUniverse, which covers all the drugs approved by the U.S. FDA since 1939, as well as clinical data from authoritative sources such as Open Targets. TxAgent integrates a library of 211 biomedical tools called ToolUniverse, covering all drugs approved by the FDA since 1939, as well as clinical data from authoritative sources such as Open Targets. Tests show that it outperforms many mainstream models with an accuracy of 92.11 TP3T in drug reasoning and personalized therapy tasks, 25.81 TP3T higher than GPT-4o. This tool is suitable for healthcare professionals and can significantly improve the efficiency of diagnosis and treatment.

TxAgent: an AI tool to help doctors analyze drugs and treatment options-1


 

Function List

  • Drug interaction analysis: Examine multiple drug combinations for interactions at the molecular, pharmacokinetic, and clinical levels, listing potential risks.
  • Contraindication Identification: Identify unsuitable medications based on the patient's disease and medication use.
  • Individualized treatment recommendations: Generate customized treatment plans that incorporate the patient's age, genetic information and disease progression.
  • Real-time knowledge retrieval: Up-to-date biomedical data from 211 tools to support decision-making.
  • multistep reasoning: Breaking down complex problems into multiple steps, analyzing them step-by-step and drawing conclusions.
  • cross-source authentication: Verify information from multiple authoritative databases to ensure that recommendations are reliable.
  • Drug Name Generic: Supports brand name, generic name and descriptive inputs with high recognition consistency.

Using Help

Installation process

TxAgent is an open source tool that users can download and install via GitHub or PyPI. Here are the detailed steps:

  1. Preparing the environment
    • A networked computer is required and an H100 GPU (with over 80GB of RAM) is recommended for optimal performance.
    • Install Python 3.8 or later.
    • Make sure you have Git installed for downloading code.
  2. Installing ToolUniverse
    • Open a terminal and type:
      git clone https://github.com/mims-harvard/ToolUniverse.git
      cd ToolUniverse
      python -m pip install . --no-cache-dir
      
    • or installed via PyPI:
      pip install tooluniverse
      
  3. Installing TxAgent
    • Enter the following command:
      git clone https://github.com/mims-harvard/TxAgent.git
      cd TxAgent
      python -m pip install . --no-cache-dir
      
    • or via PyPI:
      pip install txagent
      
  4. Download pre-trained model
    • Visit HuggingFace (https://huggingface.co/collections/mims-harvard/txagent-67c8e54a9d03a429bb0c622c) to download the model weights.
    • Available models include:
      • TxAgent-T1-Llama-3.1-8B: Core language model.
      • ToolRAG-T1-GTE-Qwen2-1.5B: Tool Retrieval Embedding Model.
    • Place the downloaded file in the TxAgent project directory.
  5. running program
    • Execute the sample code:
      python run_example.py
      
    • or launch the Gradio demo interface:
      python run_txagent_app.py
      

How to use the main features

TxAgent operates from the command line or the Gradio interface, and the following are detailed steps for the core functionality:

Drug interaction analysis

  • procedure::
    1. Start TxAgent and go to the main program or the Gradio interface.
    2. Enter the name of the drug (e.g. "Ibuprofen" and "Aspirin").
    3. Select the "Drug Interaction" function and run the analysis.
    4. The system returns a report showing potential risks, such as "may increase the risk of gastric bleeding".
  • typical example: Enter "Warfarin" and "Aspirin" and the results suggest that both may enhance anticoagulation.
  • take note of: Drug names are required to be in English and are recommended to be referenced in the FDA database.

Contraindication Identification

  • procedure::
    1. Select "Contraindication Check" on the screen.
    2. Enter patient information (e.g., "70 years old, chronic kidney disease") and medication (e.g., "Ibuprofen").
    3. The system analyzes and lists contraindicated tips.
  • typical example: Enter "renal insufficiency, taking Ibuprofen" and the result suggests that kidney damage may be aggravated.
  • finesse: The more specific the information entered, the more accurate the results.

Individualized treatment recommendations

  • procedure::
    1. Select "Treatment Plan Generation".
    2. Enter patient details (e.g., "50 year old male, hypertensive, carries CYP2C9 gene variant").
    3. The system generates recommendations such as "Recommend low dose Losartan".
  • typical example: Enter "Diabetes mellitus, 40 year old female" and "Metformin" may be suggested.
  • take note of: Recommendations need to be confirmed with your doctor before implementation.

Real-time knowledge retrieval

  • procedure::
    1. Enter a question in the search box, such as "What are the latest findings on Metformin?".
    2. The system retrieves and displays results from ToolUniverse.
  • typical example: Enter "Warfarin clinical data" to return to the latest studies and guidelines.
  • dominance: Data is updated in real time and covers authoritative sources.

Handling Precautions

  • Language Support: Only English input and output is currently supported.
  • Results Saving: The analysis report can be exported as text or PDF.
  • Networking requirements: ToolUniverse requires an Internet connection to run and ensure a stable network.
  • performance optimization: Using high-performance GPUs speeds up inference.

Demo Case

There are a few official examples of how to use it (see the GitHub page for an animation):

  • Case 1: Enter multiple antibiotics, check for interactions, and systematically suggest potential resistance risk.
  • Case 2: Adjusting the dosage for elderly patients and generating suitable treatment regimens.
  • Case 3: Retrieve the latest research on a drug to aid in academic analysis.

 

application scenario

  1. clinical diagnosis and treatment
    Physicians use TxAgent to check drug safety, optimize prescriptions, and reduce the risk of adverse events.
  2. drug development
    Researchers analyze the interaction of new drugs with existing drugs to verify clinical feasibility.
  3. medical education
    Students practice drug reasoning and learn clinical decision making through simulated cases.
  4. patient support
    Patients enter their condition and medication, get initial recommendations, and discuss with their doctor.

 

QA

  1. Can TxAgent replace a doctor?
    No. It is an aid and needs to be used by a physician in conjunction with professional judgment.
  2. What are the sources of data?
    The data comes from the FDA, Open Targets, and other authorities and covers all approved drugs since 1939.
  3. Why do you need high performance GPUs?
    Multi-step reasoning and big data processing require powerful computational capabilities, and the H100 GPU delivers a speed boost.
  4. Does it support Chinese interface?
    Currently unsupported, English only, may be updated with multi-language versions in the future.
May not be reproduced without permission:Chief AI Sharing Circle " TxAgent: the AI tool that helps doctors analyze drug effects and treatment options

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish