Skip to content

Dbansal06/drug-repurposing-agent

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Drug Repurposing Agent ๐Ÿ’Š๐Ÿค–

A sophisticated multi-agent AI system for medical diagnosis, drug repurposing analysis, and clinical insights. This platform combines symptom prediction, medical knowledge retrieval, and clinical trial analysis to provide comprehensive healthcare intelligence.

๐ŸŒŸ Features

Multi-Agent Architecture

  • Symptom Predictor: ML-based disease prediction from user-described symptoms
  • Medical Knowledge Agent: RAG-powered medical information retrieval
  • Clinical Trials Agent: Analysis of clinical trial data and drug efficacy
  • Market Analysis Agent: Pharmaceutical market intelligence and forecasting
  • Orchestrator: Intelligent routing and coordination between agents

Core Capabilities

  • ๐Ÿ” 3-Layer Medical System: Diagnosis โ†’ Knowledge โ†’ Triage workflow
  • ๐Ÿง  RAG Integration: Vector database with medical literature (PubMed)
  • ๐Ÿ›ก๏ธ Safety Validation: Medical integrity guards and audit logging
  • ๐Ÿ“Š Data-Driven: Operates strictly on curated medical datasets
  • ๐ŸŽฏ Urgency Assessment: Triage system for medical condition prioritization

๐Ÿ—๏ธ Architecture

drug-repurposing-agent/
โ”œโ”€โ”€ backend/              # FastAPI backend
โ”‚   โ”œโ”€โ”€ main.py          # API entry point
โ”‚   โ”œโ”€โ”€ models.py        # Database models
โ”‚   โ”œโ”€โ”€ routers/         # API endpoints
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ frontend/            # React/TypeScript UI
โ”‚   โ”œโ”€โ”€ src/            # Source code
โ”‚   โ”œโ”€โ”€ public/         # Static assets
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ agents/             # AI Agents system
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ agents/     # Agent implementations
โ”‚   โ”‚   โ”œโ”€โ”€ core/       # Core functionality
โ”‚   โ”‚   โ”œโ”€โ”€ rag/        # RAG system
โ”‚   โ”‚   โ””โ”€โ”€ ...
โ”‚   โ”œโ”€โ”€ data/           # Medical datasets
โ”‚   โ””โ”€โ”€ docs/           # Agent documentation
โ””โ”€โ”€ docs/               # Project documentation

๐Ÿ“‹ Prerequisites

  • Python 3.10+
  • Node.js 18+
  • Ollama (for local AI agents)
    • Install from ollama.com
    • Pull required model: ollama pull llama3

๐Ÿš€ Installation

1. Clone the Repository

git clone https://github.com/yourusername/drug-repurposing-agent.git
cd drug-repurposing-agent

2. Backend Setup

# Install Python dependencies
pip install -r backend/requirements.txt

# Initialize database
python backend/init_db.py

3. Frontend Setup

cd frontend
npm install

4. Agents Setup

cd agents
pip install -r requirements.txt

5. Environment Configuration

Create a .env file in the root directory (use .env.example as template):

# Google Search Configuration
GOOGLE_API_KEY=your_google_api_key
GOOGLE_CSE_ID=your_google_cse_id

# AI Configuration
MISTRAL_API_KEY=your_mistral_api_key
GOOGLE_GENAI_KEY=your_google_genai_key
OPENROUTER_API_KEY=your_openrouter_api_key

# Ollama
OLLAMA_MODEL=llama3

# Database
DATABASE_URL=sqlite:///./medical.db

# JWT Secret
SECRET_KEY=your_secret_key_here

๐ŸŽฎ Usage

Start Ollama

Ensure Ollama is running:

ollama serve

Start the Backend

# From root directory
uvicorn backend.main:app --reload --host 127.0.0.1 --port 8000

API will be available at:

Start the Frontend

# From frontend directory
cd frontend
npm run dev

Application will be available at: http://localhost:5173

๐Ÿ”Œ API Endpoints

Agents

  • POST /agents/query - Query the multi-agent system
    {
      "query": "What are the symptoms of diabetes?"
    }

Authentication

  • POST /auth/register - Register new user
  • POST /auth/login - User login
  • GET /auth/me - Get current user

Medical Data

  • GET /diseases - List diseases
  • GET /symptoms - List symptoms
  • POST /predict - Predict disease from symptoms

๐Ÿ“Š Datasets

The system uses three core medical datasets:

  1. symbipredict_cleaned.csv: Symptom-disease mappings for ML prediction
  2. disease_knowledge_enriched.csv: Disease information, symptoms, precautions
  3. synthetic_medical_triage.csv: Urgency assessment and triage data

๐Ÿงช Testing

Backend Tests

pytest backend/tests/

Agent Tests

cd agents
pytest tests/

๐Ÿ“š Documentation

  • USAGE.md - Detailed usage instructions
  • CHANGELOG.md - Version history
  • agents/docs/ - Agent-specific documentation
    • AUDIT_LOG_FORMAT.md
    • DATA_QUALITY_CHECKLIST.md
    • INTEGRITY_GUARD_INTEGRATION.md

๐Ÿ›ก๏ธ Safety & Compliance

This system includes:

  • Integrity Guards: Validates medical data quality
  • Audit Logging: Tracks all agent interactions
  • Safety Validators: Ensures responses meet medical standards
  • Dataset-Driven: Operates strictly on curated medical data

โš ๏ธ Disclaimer: This system is for research and educational purposes only. It is not a substitute for professional medical advice, diagnosis, or treatment.

๐Ÿค Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License

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

๐Ÿ™ Acknowledgments

  • Medical datasets from public health repositories
  • LangChain for agent orchestration
  • FastAPI for backend framework
  • React for frontend framework
  • Ollama for local LLM inference

๐Ÿ“ง Contact

For questions or support, please open an issue on GitHub.


Built with โค๏ธ for advancing medical AI research

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 54.5%
  • Python 45.3%
  • Other 0.2%