Clinical drug intelligence platform — Knowledge graph + hybrid RAG over 19k+ DrugBank compounds. Drug interaction detection, semantic search, and graph-powered alternative suggestions.
0
stars
24
commits
TypeScript
primary language
Apr 18, 2026
updated
A full-stack pharmaceutical intelligence platform combining Neo4j Knowledge Graph, RAG (Retrieval-Augmented Generation), and interactive visualization for drug discovery, safety analysis, and therapeutic alternatives.
┌─────────────────────────────────────────────────────────────┐
│ Frontend (React + Vite) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Search │ │Assistant │ │ Safety │ │ Graph │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘
↕ REST API
┌─────────────────────────────────────────────────────────────┐
│ Backend (FastAPI) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Vector Store │ │ RAG Engine │ │ Neo4j Driver │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
↕ Cypher
┌─────────────────────────────────────────────────────────────┐
│ Neo4j Knowledge Graph │
│ Drugs ←→ Targets ←→ Categories ←→ Interactions │
└─────────────────────────────────────────────────────────────┘
git clone https://github.com/Harsha430/drugraph.git
cd drugraph
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp ../.env.example ../.env
# Edit .env with your Neo4j and Groq credentials
# Run backend server
python -m uvicorn api.main:app --reload --host 127.0.0.1 --port 8000
Backend will be available at: http://127.0.0.1:8000
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev
Frontend will be available at: http://localhost:5173
cd backend
# 1. Parse DrugBank XML
python -m scripts.parse_drugbank
# 2. Enrich with RxNav data
python -m scripts.enrich_rxnav
# 3. Build embeddings
python -m scripts.build_embeddings
# 4. Load to Neo4j
python -m scripts.load_to_neo4j
Data Sources:
fulldb.xml).env)# Neo4j Configuration
NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password
NEO4J_DATABASE=neo4j
# LLM Configuration
GROQ_API_KEY=your-groq-api-key
GROQ_MODEL=llama-3.1-8b-instant
# Embedding Configuration
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
VECTOR_INDEX_NAME=drug_embeddings
VECTOR_NODE_LABEL=Drug
VECTOR_TEXT_PROPERTY=rag_text
VECTOR_EMBEDDING_PROPERTY=embedding
drugraph/
├── backend/
│ ├── api/
│ │ └── main.py # FastAPI endpoints
│ ├── core/
│ │ ├── config.py # Environment config
│ │ └── schemas.py # Pydantic models
│ ├── db/
│ │ └── neo4j.py # Neo4j driver
│ ├── services/
│ │ └── rag.py # RAG engine
│ ├── scripts/
│ │ ├── parse_drugbank.py # XML parser
│ │ ├── enrich_rxnav.py # Interaction enrichment
│ │ ├── build_embeddings.py # Vector generation
│ │ └── load_to_neo4j.py # Graph loader
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── layout/ # Sidebar, TopBar, etc.
│ │ │ └── pillars/ # Feature views
│ │ │ ├── Search/
│ │ │ ├── Assistant/
│ │ │ ├── Safety/
│ │ │ ├── Graph/
│ │ │ └── Alternatives/
│ │ ├── services/
│ │ │ └── api.ts # API client
│ │ ├── store/
│ │ │ └── index.ts # Zustand state
│ │ ├── types/
│ │ │ └── index.ts # TypeScript types
│ │ └── App.tsx
│ └── package.json
├── datasets/ # Processed CSV data
├── .env.example
└── README.md
POST /search - Semantic drug search
{ "query": "diabetes medication", "k": 5 }
POST /ask - RAG-powered Q&A
{ "question": "What are the side effects of Metformin?" }
POST /check - Multi-drug interaction check
{ "drugs": ["Aspirin", "Warfarin"] }
GET /graph?limit=200 - Knowledge graph dataGET /drug/{drug_id} - Drug details with relationshipsGET /alternatives/{drug}/{condition}?current_meds=Med1,Med2
cd backend
python -m pytest tests/
cd frontend
npm run typecheck
# Backend
cd backend
pip install -r requirements.txt
# Frontend
cd frontend
npm run build
MIT License - See LICENSE file for details
Contributions welcome! Please:
Harsha - GitHub
Project Link: https://github.com/Harsha430/drugraph
Built with ❤️ for clinical intelligence and drug safety
24 commits
TypeScript
73.1%
Python
14.9%
HTML
7.9%
CSS
2.5%
Cypher
1.1%
Clinical drug intelligence platform — Knowledge graph + hybrid RAG over 19k+ DrugBank compounds. Drug interaction detection, semantic search, and graph-powered alternative suggestions.
0
stars
24
commits
TypeScript
primary language
Apr 18, 2026
updated
A full-stack pharmaceutical intelligence platform combining Neo4j Knowledge Graph, RAG (Retrieval-Augmented Generation), and interactive visualization for drug discovery, safety analysis, and therapeutic alternatives.
┌─────────────────────────────────────────────────────────────┐
│ Frontend (React + Vite) │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Search │ │Assistant │ │ Safety │ │ Graph │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────┘
↕ REST API
┌─────────────────────────────────────────────────────────────┐
│ Backend (FastAPI) │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Vector Store │ │ RAG Engine │ │ Neo4j Driver │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────┘
↕ Cypher
┌─────────────────────────────────────────────────────────────┐
│ Neo4j Knowledge Graph │
│ Drugs ←→ Targets ←→ Categories ←→ Interactions │
└─────────────────────────────────────────────────────────────┘
git clone https://github.com/Harsha430/drugraph.git
cd drugraph
cd backend
# Create virtual environment
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Configure environment
cp ../.env.example ../.env
# Edit .env with your Neo4j and Groq credentials
# Run backend server
python -m uvicorn api.main:app --reload --host 127.0.0.1 --port 8000
Backend will be available at: http://127.0.0.1:8000
cd frontend
# Install dependencies
npm install
# Run development server
npm run dev
Frontend will be available at: http://localhost:5173
cd backend
# 1. Parse DrugBank XML
python -m scripts.parse_drugbank
# 2. Enrich with RxNav data
python -m scripts.enrich_rxnav
# 3. Build embeddings
python -m scripts.build_embeddings
# 4. Load to Neo4j
python -m scripts.load_to_neo4j
Data Sources:
fulldb.xml).env)# Neo4j Configuration
NEO4J_URI=neo4j+s://your-instance.databases.neo4j.io
NEO4J_USERNAME=neo4j
NEO4J_PASSWORD=your-password
NEO4J_DATABASE=neo4j
# LLM Configuration
GROQ_API_KEY=your-groq-api-key
GROQ_MODEL=llama-3.1-8b-instant
# Embedding Configuration
EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
VECTOR_INDEX_NAME=drug_embeddings
VECTOR_NODE_LABEL=Drug
VECTOR_TEXT_PROPERTY=rag_text
VECTOR_EMBEDDING_PROPERTY=embedding
drugraph/
├── backend/
│ ├── api/
│ │ └── main.py # FastAPI endpoints
│ ├── core/
│ │ ├── config.py # Environment config
│ │ └── schemas.py # Pydantic models
│ ├── db/
│ │ └── neo4j.py # Neo4j driver
│ ├── services/
│ │ └── rag.py # RAG engine
│ ├── scripts/
│ │ ├── parse_drugbank.py # XML parser
│ │ ├── enrich_rxnav.py # Interaction enrichment
│ │ ├── build_embeddings.py # Vector generation
│ │ └── load_to_neo4j.py # Graph loader
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── components/
│ │ │ ├── layout/ # Sidebar, TopBar, etc.
│ │ │ └── pillars/ # Feature views
│ │ │ ├── Search/
│ │ │ ├── Assistant/
│ │ │ ├── Safety/
│ │ │ ├── Graph/
│ │ │ └── Alternatives/
│ │ ├── services/
│ │ │ └── api.ts # API client
│ │ ├── store/
│ │ │ └── index.ts # Zustand state
│ │ ├── types/
│ │ │ └── index.ts # TypeScript types
│ │ └── App.tsx
│ └── package.json
├── datasets/ # Processed CSV data
├── .env.example
└── README.md
POST /search - Semantic drug search
{ "query": "diabetes medication", "k": 5 }
POST /ask - RAG-powered Q&A
{ "question": "What are the side effects of Metformin?" }
POST /check - Multi-drug interaction check
{ "drugs": ["Aspirin", "Warfarin"] }
GET /graph?limit=200 - Knowledge graph dataGET /drug/{drug_id} - Drug details with relationshipsGET /alternatives/{drug}/{condition}?current_meds=Med1,Med2
cd backend
python -m pytest tests/
cd frontend
npm run typecheck
# Backend
cd backend
pip install -r requirements.txt
# Frontend
cd frontend
npm run build
MIT License - See LICENSE file for details
Contributions welcome! Please:
Harsha - GitHub
Project Link: https://github.com/Harsha430/drugraph
Built with ❤️ for clinical intelligence and drug safety
24 commits
TypeScript
73.1%
Python
14.9%
HTML
7.9%
CSS
2.5%
Cypher
1.1%