Abstract
Retrieval-Augmented Generation (RAG) combined with Large Language Models (LLM) is increasingly used to develop conversational educational chatbots. However, general-purpose LLMs, even when augmented with standard RAG pipelines, lack the structural grounding needed for educational contexts and may produce responses that exceed course scope, misinterpret student queries, or generate hallucinated content. To address these limitations, we propose a system that integrates Knowledge Graphs (KGs), RAG, and LLMs to build a reliable, explainable, and personalized learning assistant. By grounding responses in a well-defined KG, our system keeps answers aligned with lecture content while reducing hallucination. The graph structure provides inherent explainability, and topic-level progress tracking enables personalized learning through knowledge gap identification and targeted recommendations. Our data-driven extraction framework replaces previous unconstrained information extraction with ontology constrained extraction. The pipeline defines a domain-specific ontology, semantically chunks course materials, and iteratively builds the knowledge graph using a sliding-window algorithm that enforces ontological constraints. The resulting graph is then stored in Neo4j where nodes are clustered into communities, summarized by an LLM, and enriched with vector embeddings to enable hybrid retrieval. At inference time, student queries are translated into structured graph queries to extract relevant subgraphs, which are provided to an LLM under strict context restrictions, ensuring the generated answers rely exclusively on verified educational content. We validated our framework against a RAG-only baseline, demonstrating that our approach enables more accurate and schema-aligned reasoning with stronger factual grounding.
Keywords
Undergraduate research; knowledge graphs
Date of this Version
4-14-2026
Recommended Citation
Xu, Zhenghao; Wu, Boyang; Sakalabhaktula, Aishani; and Chauhan, Anya, "From Slides to Chatbots: Ontology-Driven Pedagogical Knowledge Graphs" (2026). Information Studies Undergraduate Works. Paper 2.
https://docs.lib.purdue.edu/is_undergrad_works/2