Skip to content

TUDB-Labs/LLM-Medical-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LLM Multi-Agent Medical Data Processing

This project is a multi-agent system designed to process medical data using large language models (LLMs). The system is modular, with agents responsible for different tasks, such as data loading, preprocessing, and analysis using LLMs like GPT-4. This framework can be extended for various medical data analysis use cases, such as diagnostics, predictions, and clinical document processing.

Features

  • Multi-Agent System: Modular agents for data collection, preprocessing, and analysis.
  • LLM Integration: Seamless integration with large language models (e.g., GPT-4, GPT-3).
  • Medical Data Processing: Process and analyze medical data for insights using AI models.
  • Extendable: Add new agents for additional tasks or other AI models.

Project Structure

llm-multi-agent-medical-data/
├── agents/
│   ├── __init__.py         # Initializes the agents module
│   ├── data_agent.py       # Agent for loading and preprocessing medical data
│   ├── analysis_agent.py   # Agent for analyzing data using an LLM
├── data/
│   ├── sample_data.csv     # Sample medical data for development
├── models/
│   ├── llm_model.py        # LLM model integration logic
├── tests/
│   ├── test_agents.py      # Unit tests for the agents
├── README.md               # Project documentation
├── requirements.txt        # Project dependencies
├── main.py                 # Entry point to run the system
└── .gitignore              # Files to ignore in version control

Getting Started

Prerequisites

Make sure you have the following installed:

  • Python 3.x
  • OpenAI or Hugging Face API Key (if you're using GPT-3 or GPT-4)

Installation

  1. Clone the repository:

    git clone https://github.com/TUDB-Labs/LLM-Medical-Agent.git
    cd llm-multi-agent-medical-data
  2. Install the dependencies:

    pip install -r requirements.txt
  3. Add your API key for the LLM (if applicable). For OpenAI, for example:

    export OPENAI_API_KEY="your-api-key"

Running the Project

To run the system, execute:

python main.py

The agents will load the sample data, preprocess it, and analyze it using the specified LLM.

Sample Data

The data/sample_data.csv contains placeholder data. Replace this with actual medical data for real-world use cases.

Usage

  1. DataAgent: Responsible for loading and preprocessing medical data.

    • Example:
      data_agent = DataAgent('data/sample_data.csv')
      data = data_agent.load_data()
      preprocessed_data = data_agent.preprocess_data()
  2. LLMModel: A wrapper around the large language model API to process text data.

    • Example:
      llm_model = LLMModel('gpt-4')
      result = llm_model.process_text("Analyze this medical record")
  3. AnalysisAgent: Uses the LLM to analyze the preprocessed data.

    • Example:
      analysis_agent = AnalysisAgent(llm_model)
      analysis_agent.analyze(preprocessed_data)

Testing

To run the unit tests:

pytest tests/

Roadmap

  • Add more agents for data validation and transformation.
  • Expand LLM integration to support different models (e.g., BERT, BioBERT).
  • Improve data preprocessing for medical-specific data formats (e.g., DICOM, HL7).
  • Implement additional test cases for robust validation.

Contributing

Contributions are welcome! Please submit a pull request or open an issue for discussion.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Multi Agent Framework for the Medical Data Processing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published