🚀 Bridging AI & Drug Repurposing: Unlocking New Possibilities 🧬💊
In the ever-evolving landscape of AI and healthcare, I'm working on an MVP that connects a SwiftUI frontend with a Flask-based Python backend powered by DeepSeek 7B (via Ollama) to facilitate rare disease queries and drug repurposing insights.
🔍 The Goal?
To harness reasoning LLMs for drug repurposing insights by integrating public biomedical datasets and leveraging LLM-powered retrieval to assist medical professionals and researchers in accelerating discoveries.
💡 Key Data Sources:
📌 Drug Information – DrugBank, PubChem, ChEMBL, RxNorm 📌 Target & Pathways – UniProt, KEGG, Reactome, Human Protein Atlas 📌 Disease Insights – OMIM, MeSH, ICD-10, DisGeNET 📌 Clinical Trials & Literature – ClinicalTrials.gov, PubMed, Google Scholar
⚡ Why This Matters?
Drug discovery is expensive & time-consuming. By utilizing LLMs with Test-Time Compute, we can:
✅ Fast-track insights & hypothesis generation ✅ Uncover new therapeutic uses ✅ Enable data-driven decision-making for researchers
🔭 Future Directions: Expanding AI’s Role in Drug Repurposing
🤖 AI Agents for Data Collection & Thinking
Automated biomedical data gathering from structured (databases, APIs) and unstructured (papers, patents) sources. Multi-agent collaboration: Specialized retrieval agents, reasoning agents, and verification agents working in tandem.
🧠 Co-Researcher AI Agents
AI-powered co-researchers that simulate expert reasoning, suggest hypotheses, and validate findings. Multi-modal LLMs to integrate text, molecular structures, and clinical data.
⚙️ Advancing Retrieval & Reasoning
Retrieval-Augmented Generation (RAG): Enhancing LLMs with real-time access to biomedical literature & trials. GraphRAG: Leveraging knowledge graphs for a structured, explainable approach to drug repurposing. Dynamic Test-Time Compute Reasoning: Using LLMs not just for retrieval but for complex biomedical inference at runtime.
🎯 The Tech Stack:
🖥️ Frontend: SwiftUI for a clean, intuitive UX ⚙️ Backend: Flask API with RESTful endpoints & CORS 🧠 AI Model: DeepSeek 7B for reasoning-driven biomedical queries 🔍 Data Processing: RAG, GraphRAG, and multi-agent workflows
By bridging LLM reasoning, real-time retrieval, and multi-agent collaboration, we’re pushing drug repurposing & biomedical research into a new era of AI-driven discovery. 🚀🔬
- Python 3.9+ — for the Flask backend
- Ollama — local LLM runtime (must be installed and running)
- Xcode 15+ — for the SwiftUI iOS/macOS frontend
- iOS 16+ / macOS 13+ — minimum deployment target
git clone https://github.com/rathodkunj2005/RePurposeRx.git
cd RePurposeRxInstall Python dependencies:
pip install -r requirements.txt flask flask-corsPull the required Ollama models (Ollama must already be running):
ollama pull llama3.2:latest
ollama pull deepseek-r1:7bAll configuration values have sensible defaults (see RePurposeRx/Sources/config.py). To override them, export variables before starting the server or add them to a .env file:
# LLM model selection
export METADATA_EXTRACTION_MODEL=llama3.2:latest
export RESPONSE_GENERATION_MODEL=deepseek-r1:7b
# Optional: API keys for extended data sources
export OMIM_API_KEY=your_omim_api_key
export DISGENET_API_KEY=your_disgenet_api_keyOpen Package.swift in Xcode. Before building, update the teamIdentifier field in Package.swift with your Apple Developer Team ID. Select your target device or simulator, then press Run.
Start the Flask backend:
cd RePurposeRx/Sources
python server.pyThe API will be available at http://localhost:5000. You can smoke-test it with:
curl -X POST http://localhost:5000/deepseek \
-H "Content-Type: application/json" \
-d '{"query": "What drugs could be repurposed for Alzheimer disease?"}'Launch the SwiftUI app:
Run the app from Xcode (⌘R) on your target device or simulator. Make sure the Flask backend is running before sending queries from the app.
No automated tests are included yet — contributions are welcome!


