DentalQuest: An Adaptive Learning System for Dental Education using Knowledge Graph and Retrieval-Augmented Generation
DentalQuest is an AI-powered adaptive learning platform that combines knowledge graphs, neural retrieval, and large language models to deliver personalized dental education and assessment.
- Converts dental learning material into a structured Knowledge Graph
- Retrieves clinically relevant concepts using graph-enhanced embeddings
- Generates adaptive MCQs with explanations using an LLM
- Tracks learner mastery over time and adjusts question difficulty
- Provides an interactive dashboard for self-assessment and progress tracking
Figure 1:High-level architecture showing offline knowledge preparation and the online adaptive learning loop.
- Multimodal Knowledge Graph: Constructs a structured domain-specific graph from dental datasets, linking concepts (e.g., "Dental Caries") with their clinical attributes.
- GNN-Enhanced Retrieval: Uses a Graph Convolutional Network (GCN) to refine BioBERT embeddings, capturing inter-concept relationships for 94% Top-1 retrieval accuracy.
- MedGemma RAG Engine: Generates context-aware multiple-choice questions (MCQs) and explanations using the MedGemma-4b-it Large Language Model.
- Adaptive Knowledge Tracing: Implements Bayesian Knowledge Tracing (BKT) to dynamically model learner mastery and adjust question difficulty in real-time.
- Interactive Dashboard: A Gradio-based interface for students to take quizzes, track progress, and visualize their knowledge gaps.
This project follows a modular source layout. Please run all commands from the root directory.
DentalQuest/
├── data/ # Store your JSON dataset files here
├── models/ # Stores trained GNN embeddings (.pkl)
├── src/
│ ├── core.py # Backend logic (RAG, BKT, Knowledge Graph)
│ ├── gnn_train.py # GNN training script (GCN/GAT)
│ ├── kg_viz.py # Network visualization scripts
│ └── gnn_viz.py # Embedding analysis (t-SNE plots)
├── app.py # Web application entry point
├── requirements.txt # Python dependencies
└── README.md
- Python 3.10+
- CUDA-enabled GPU (Recommended for MedGemma & GNN training)
- Hugging Face Account (For model access)
Run the following commands in your terminal after cloing the repositiory.
Install base requirements
pip install -r requirements.txt
Install Graph Neural Network binaries (Crucial Step!) FOR CUDA 11.8 (Most GPUs):
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv -f [https://data.pyg.org/whl/torch-2.0.0+cu118.html](https://data.pyg.org/whl/torch-2.0.0+cu118.html)
DentalQuest needs access to the Hugging Face Hub to download the MedGemma-4b-it model. This requires a personal access token.
Steps to get a Hugging Face token:
- Go to Hugging Face and sign up or log in.
- Click on your profile picture → Settings → Access Tokens.
- Click New token, give it a name, select read scope, and click Generate.
- Copy the generated token.
Add the token to DentalQuest:
- Check for a
.envfile in the root of the repository. If it doesn’t exist, create one. - Open
.envand add your Hugging Face token:HF_TOKEN=your_huggingface_token_here
- Save the file. The system will automatically load this token at startup using python-dotenv.
Note: Do not commit your .env file to GitHub or any version control system. It is already included in .gitignore
Phase 1: Data Preparation
Ensure your dental synopsis JSON files are placed inside the data/ directory. The system automatically loads all .json files found there.
Phase 2: Train GNN Embeddings
To enable the "Graph-Enhanced" retrieval mode, train the GNN model:
python3 -m src.gnn_train
This will save the trained embeddings to models/gcn_enhanced_embeddings.pkl.
Phase 3: Run the Application
Launch the interactive learning dashboard:
python3 app.py
Open your browser to the local URL provided.
Knowledge Graph Network: Generates the network topology and community detection plots.
python3 -m src.kg_viz
Embedding Space (t-SNE): Generates the comparison between BioBERT and GNN embeddings.
python3 -m src.gnn_viz
This project is licensed under the Apache-2.0 License. See LICENSE for details.
For questions or clarifications, please contact drajo_george@Dicemed.in