Next Article in Journal
The Effect of Selected Winter Wheat Cultivars and the Growing Season on the Antioxidant Activity, Polyphenol Profile, and Organoleptic Assessment of Beers Produced from Them
Previous Article in Journal
CTQRS-Based Reinforcement Learning Framework for Reliable Bug Report Generation Using Open-Source Large Language Models
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

KA-RAG: Integrating Knowledge Graphs and Agentic Retrieval-Augmented Generation for an Intelligent Educational Question-Answering Model

1
Hubei Key Laboratory of Intelligent Robot, School of Computer Science and Engineering, Wuhan Institute of Technology, Wuhan 430205, China
2
Library, Wuhan Institute of Technology, Wuhan 430205, China
*
Author to whom correspondence should be addressed.
Appl. Sci. 2025, 15(23), 12547; https://doi.org/10.3390/app152312547
Submission received: 19 October 2025 / Revised: 14 November 2025 / Accepted: 18 November 2025 / Published: 26 November 2025
(This article belongs to the Section Computing and Artificial Intelligence)

Abstract

Generative artificial intelligence (AI) and large language models (LLMs) are reshaping the landscape of intelligent educational systems; however, existing solutions often suffer from unstructured resource organization, limited interpretability, and suboptimal retrieval precision. To address these challenges, this study introduces KA-RAG, a course-oriented question answering (QA) framework that integrates a structured Knowledge Graph (KG) with an Agentic Retrieval-Augmented Generation (Agentic-RAG) workflow. The system incorporates a responsive interface, a unified agent controller (ToolPlanner), a course knowledge graph, and a vector-based retrieval subsystem. By combining symbolic graph reasoning with dense semantic retrieval, the proposed dual-retrieval strategy supports interpretable, context-aware responses to course-related queries. Experiments conducted on a graduate-level Pattern Recognition course demonstrate that KA-RAG achieves a retrieval accuracy of 91.4%, semantic consistency of 87.6%, and an average response latency of 2.8 s. User surveys further reveal significant improvements in learning efficiency and satisfaction. The results validate the feasibility of integrating KG and Agentic-RAG techniques for knowledge-grounded educational applications, offering a practical pathway toward intelligent knowledge organization and interactive learning support.

1. Introduction

Recent advances in large language models (LLMs) have transformed intelligent information retrieval and educational technologies [1,2]. Traditional rule-driven tutoring systems are increasingly being replaced by adaptive agents capable of multi-step reasoning, tool use, and contextual understanding [3,4,5]. Nevertheless, a persistent challenge remains: because LLMs are parametric in nature, their knowledge is constrained by static training corpora, which can lead to hallucinations, outdated information, or factual inaccuracies when addressing knowledge-intensive educational queries [6,7,8].
Retrieval-Augmented Generation (RAG) introduces a promising direction by enabling LLMs to ground their outputs in dynamically retrieved external evidence [9]. Yet, conventional RAG architectures rely primarily on unstructured vector databases, which, while effective at semantic similarity search, struggle to capture relational structures, hierarchical course dependencies, and cross-entity connections inherent to educational resources [10,11,12].
Educational knowledge is inherently structured—courses map to chapters, chapters to knowledge points, and each point links to pedagogical resources such as papers, videos, and case studies [13]. These rich relationships are more effectively represented via Knowledge Graphs (KGs), which support explicit reasoning over entities and relations. However, KG-centric systems alone lack the flexibility to address open-ended, text-based queries.
This motivates the integration of vector-based retrieval with symbolic graph reasoning, enabling both semantic flexibility and structured interpretability. To enable such synergy, recent progress in agentic reasoning frameworks (e.g., ReAct, Toolformer) introduces LLM controllers capable of planning and executing multi-step tool invocations [14]. These methods provide a mechanism for dynamic tool orchestration, supporting hybrid retrieval and iterative refinement.
To bridge these gaps, we propose KA-RAG, a unified framework combining an Agentic-RAG architecture with a structured course knowledge graph. The system employs an LLM-based controller (ToolPlanner) to determine query intent, select retrieval tools, and coordinate evidence fusion [15]. Through a hybrid fusion strategy that integrates dense semantic retrieval and symbolic relational cues, KA-RAG enhances retrieval accuracy, interpretability, and responsiveness [16].
The major contributions of this study are as follows:
A unified Agentic-RAG architecture integrating vector-based retrieval and cross-module KG reasoning in a coherent pipeline.
A structured course knowledge graph incorporating pedagogically grounded entity schemas and multi-level relations.
A hybrid evidence fusion mechanism employing dynamic weighting to balance relational and semantic relevance.
Empirical evaluation demonstrating substantial gains in accuracy, semantic consistency, latency, and user satisfaction.

2. Related Work

2.1. Retrieval-Augmented Generation and Hybrid Retrieval Mechanisms

The overall RAG workflow is illustrated in Figure 1. The RAG architecture [17,18,19,20] introduces a dual-stage pipeline: a retriever R ( q ) selects the top-k passages based on query embeddings, and a generator G conditions on these retrieved contexts to produce an answer y = G ( q , R ( q ) ) .
Figure 1 provides a schematic overview of this fundamental RAG workflow. It visually encapsulates the primary strength of RAG: grounding the LLM’s generation in dynamically retrieved, external evidence to mitigate hallucinations and factual inaccuracies. The retriever’s effectiveness is fundamentally dependent on the process depicted in Figure 2. This component illustrates the Embedding Model, which is the engine for dense vector retrieval. The core mechanism involves transforming both the user’s query and all documents in the knowledge base into high-dimensional numerical vectors (embeddings).
As shown in Figure 2, retrieval is performed by computing the cosine similarity between the query vector and all document vectors in this latent space, returning the passages with the highest similarity scores. While this method achieves high semantic recall, its vector-only representation limits its ability to capture entity-level relationships, leading to redundancy and weak logical coherence across passages. These drawbacks are particularly salient in educational contexts, where knowledge points are intrinsically linked. This limitation motivates our hybrid approach, where symbolic knowledge from a Knowledge Graph is integrated to enhance relational inference and answer traceability.
Subsequent works such as FiD [20] and RankRAG [21] improved evidence aggregation through fusion-in-decoder attention, contextual re-ranking, and long-context optimization [22]. While RAG achieves high semantic recall, its vector-only representation limits its ability to capture entity-level relationships, leading to redundancy and weak logical coherence across passages. These drawbacks motivate hybrid approaches where symbolic knowledge is integrated to enhance relational inference and answer traceability.

2.2. Knowledge Graph Representation and Relational Learning

Knowledge graphs (KGs) encode entities (E) and relations (R) as triples ( h , r , t ) and employ embedding models such as TransE [23] and R-GCN [24,25] to project symbolic structures into continuous spaces. In educational systems, KGs represent course hierarchies and dependencies, supporting inference over curriculum design, resource mapping, and knowledge point connectivity [26,27,28,29,30]. Recent graph-neural approaches apply message passing and relational aggregation:
h v ( l + 1 ) = σ r R u N r ( v ) W r h u ( l ) + b r ,
where h v ( l ) is the embedding of node v at layer l, and W r captures the semantics of relation type r. However, KG-based systems are limited by static topology and sparse coverage—making them less responsive to open-ended, text-based queries. Figure 3 provides a concrete example of how our system performs Knowledge Graph Retrieval and Reasoning.
As illustrated, the KG moves beyond simple entity storage to enable complex, multi-hop queries. For instance, it can trace the path from a Coursenode to a specific Knowledge Point, and then to all related Resources(e.g., videos, papers), thereby answering complex questions about learning paths and resource dependencies. This capability for explicit relational reasoning is a key advantage over unstructured retrieval methods but requires integration with semantic search to handle the variety of natural language queries, a challenge addressed by our hybrid framework.

2.3. Agentic Reasoning and Tool-Augmented Language Models

The emergence of agentic reasoning frameworks, such as ReAct and Toolformer, introduces procedural control over retrieval and reasoning operations [31,32]. An agent decomposes a complex query Q into sub-tasks { q 1 , q 2 , , q n } , dynamically selecting between tools (e.g., vector retriever, KG query, or calculator) via a learned policy π ( a t | s t ) that conditions on conversational state s t [33]. This multi-round decision process allows the model to refine answers iteratively, a key capability for multi-hop educational questions that span conceptual and factual dimensions simultaneously [34,35]. Yet, prior systems seldom address the consistency problem between retrieved text embeddings and KG nodes—limiting cross-modal evidence fusion [17].

2.4. Fusion Strategies Between RAG and Knowledge Graphs

Integrating RAG and KG involves constructing a joint representation space or a hierarchical fusion mechanism [36,37]. Hybrid approaches typically compute a composite relevance score:
S ( q , e ) = α · sim v e c ( q , e ) + ( 1 α ) · sim k g ( q , e ) ,
where sim v e c is embedding-based cosine similarity, sim k g is graph-path similarity, and α is a dynamic weighting parameter controlling modality preference. Works such as KG-FiD [33] demonstrate that relational cues improve grounding accuracy, whereas joint GCN-RAG hybrids enhance explainability at the cost of computational complexity [38,39]. Our proposed Agentic-RAG employs an adaptive α schedule and evidence-fusion layer to optimize the trade-off between retrieval precision and inference latency. The complete workflow is depicted in Figure 4.
Figure 4 illustrates the integration of Agentic RAG and Knowledge Graphs. The process involves query intent recognition by the ToolPlanner, followed by parallel retrieval from the knowledge graph (via Cypher queries) and the vector database (via semantic search). The results are then fused using a hybrid scoring mechanism. This approach combines the strengths of structured KG reasoning and flexible vector search.

2.5. Comparative Analysis of RAG, KG, and Agentic-RAG Frameworks

Table 1 summarizes a comparative overview of key algorithmic characteristics across RAG, KG, and the proposed Agentic-RAG architectures.

2.6. Research Gap and Contributions

Existing literature has explored RAG retrieval, KG reasoning, and tool-augmented LLMs independently [26,27,31,33,40,40], but few efforts have established a unified algorithmic framework for hybrid retrieval and reasoning. Most educational RAG applications lack structural grounding, whereas KG systems are static and data-bound [41]. This work bridges these gaps by introducing an Agentic-RAG framework with cross-module KG integration, featuring dynamic tool selection, hybrid retrieval scoring, and adaptive evidence fusion [42]. The innovative aspects are as follows: A unified algorithmic framework that integrates retrieval and reasoning has been established, which combines the interconnections among RAG retrieval, KG reasoning, and tool–augmented large language models [43,44,45]. To tackle the problems of the lack of structural grounding in educational RAG applications and the static and data–bound nature of KG systems, the Agentic–RAG framework with cross–module KG integration has been introduced for effective solutions [46,47,48,49]. This framework is equipped with features such as dynamic tool selection and hybrid retrieval scoring, enabling more intelligent and flexible information processing and integration of information [50,51]. Through algorithmic synergy between dense embedding retrieval and symbolic reasoning, our method achieves improved interpretability and computational balance—advancing the state of knowledge-grounded intelligent tutoring systems.

3. Methods and Materials

3.1. Overall Architecture

The intelligent course-tutoring system proposed in this study is organized into three cooperative layers: (1) the Intelligent Decision Layer, (2) the Knowledge Retrieval Layer, and (3) the Answer Generation Layer. These layers operate collaboratively to accomplish the complete pipeline of query understanding, knowledge acquisition, and answer generation., as shown in Figure 5.
First, the Intelligent Decision Layer receives user input and, using a ChatGPT4-based large language model (LLM) acting as a ToolPlanner, performs intent recognition and task classification. This decision-making LLM is different from and independent of the Gemini-1.5-Flash model used in the Answer Generation Layer. In the learning scenario, students may raise various types of questions—such as inquiries about course information, departmental affiliation, conceptual explanations, resource access, assignment questions, or casual dialogue. Therefore, this layer assumes the critical responsibility of identifying the query type and dynamically selecting appropriate tools.
Subsequently, the Knowledge Retrieval Layer provides the system’s core knowledge support. It integrates retrieval-augmented generation (RAG) with a cross-module knowledge graph (KG), combining semantic retrieval and structured querying to enable comprehensive utilization of course knowledge. The vector knowledge base stores unstructured textual information, including chapter summaries, key concepts, and algorithmic principles, thereby supporting semantically rich explanations for learning-oriented queries. In parallel, the cross-module KG aggregates structured data—course attributes, affiliated schools, majors, chapter structures, knowledge points, and resource links—allowing the system to answer questions related to course management, relationships, and learning-path planning. The two knowledge sources operate concurrently, and the Intelligent Decision Layer coordinates their use based on query intent, achieving unified orchestration of structured and unstructured knowledge.
Finally, the Answer Generation Layer, powered by the Gemini-1.5-Flash model, fuses the retrieved results semantically and synthesizes a coherent natural-language answer. Because retrieved data may originate from both the vector database and the knowledge graph—differing in format, granularity, and semantic structure—the model performs unified encoding and recombination to ensure accuracy, contextual consistency, and logical coherence. Together, the three layers establish a closed feedback loop of “decision-driven retrieval, retrieval-supported generation, and generation-guided decision,’’ addressing limitations of conventional RAG pipelines with fixed tools and shallow KG integration. This design enables dynamic knowledge fusion and high-quality response generation in educational scenarios.

3.2. Hybrid Slicing Method for Educational Vector Databases

To construct a vector database suitable for educational data, a hybrid slicing strategy was proposed to mitigate issues of semantic fragmentation, redundancy, and information loss commonly observed in traditional RAG pipelines. Course knowledge is typically presented in structured tables, where each row represents a complete knowledge unit containing the knowledge-point name, summary, chapter affiliation, and difficulty level. Hence, the system first applies a row-level slicing method, treating each row as a basic information block for embedding. This preserves the inherent logical structure of educational data and prevents semantic breakage caused by length- or column-based slicing, ensuring that each vector corresponds to a complete concept or knowledge point.
However, certain courses contain semantically interdependent knowledge points whose definitions, derivations, or examples may span multiple adjacent records. To handle such cases, a semantic-similarity-based merging mechanism is introduced. Using embedding vectors, the system computes similarity between neighboring slices and automatically merges those with similarity above 0.85, forming larger and more semantically complete knowledge units. This hybrid approach maintains structural integrity while increasing semantic density, improving retrieval performance and enabling the model to access more comprehensive, context-consistent knowledge when answering theoretical questions.

3.3. Cross-Module Knowledge Graph Construction

The cross-module knowledge graph (KG) is designed to support organization, retrieval, and reasoning over structured educational knowledge. Its construction involves three stages: (1) module definition, (2) knowledge extraction and relation construction, and (3) storage and query optimization. The KG represents both the internal structure of course content and its external connections to supporting resources, providing a unified representation of course knowledge across layers and entity types.

3.3.1. Module Definition and Structure

Based on data sources and usage patterns, the KG is divided into two subsystems: the course-attribute module and the knowledge–resource module. The former describes high-level administrative information—course entities and their associated schools, majors, credits, and delivery modes—while the latter models the instructional content, including chapters, knowledge points, and learning resources such as videos or papers, as shown in Figure 6. To maintain semantic clarity, all entities and relations are formally defined. For example, a course entity contains name, code, and credit; a school or major entity records the offering and target domains; a chapter entity defines the logical division of content; a knowledge-point entity captures specific teaching units; and a resource entity represents supporting materials. Relations such as offered_by, belongs_to, and associated_with are modeled as triples to explicitly encode semantics. This modular design provides a solid structural foundation for subsequent extraction, linking, and cross-module querying.

3.3.2. Knowledge Extraction and Relation Construction

The KG is populated using course metadata tables, chapter–knowledge-point mappings, and resource tables. A rule-based and NLP-assisted extraction pipeline identifies entities and attributes from structured and semi-structured data. Fields with stable formats (e.g., course names, school names, course codes) are extracted via rule matching, while natural-language fields (e.g., knowledge-point descriptions or resource summaries) employ lightweight NLP for entity and attribute recognition. Relations are then constructed following the hierarchy Course–Chapter–KnowledgePoint–Resource, ensuring accurate internal semantic representation.
To enable cross-module reasoning, semantic associations are added between modules—for instance, linking a course’s teaching school to related example resources through provides or associated_with relations, or connecting majors with relevant knowledge points via recommended_learning. These cross-module links allow the KG to represent educational content both hierarchically and relationally, forming a full-chain knowledge system spanning course attributes, instructional content, and learning resources.

3.3.3. Storage and Query Optimization

The KG is implemented using the Neo4j 5.15 graph database, chosen for its efficient management of complex relationships and real-time querying capabilities. Considering the frequent, multi-hop queries typical in tutoring scenarios, indices are created on key attributes such as course, chapter, and knowledge-point names. Relationship indices are also added for frequently used relations (belongs_to, associated_with) to speed up cross-module traversal. Cypher query templates are optimized by limiting irrelevant node scans, constraining relation directions, and leveraging WITH clauses to minimize intermediate results. These optimizations substantially reduce average query latency, ensuring the responsiveness required for interactive agent-based dialogues.

3.4. Agentic-RAG Multi-Round Tool-Calling Mechanism

Agent Decision Module Design

To achieve dynamic responses for complex educational queries, an Agentic-RAG multi-round tool-calling framework is proposed. The agent serves as the central controller, combining LLM-based reasoning with multi-tool orchestration for flexible, iterative retrieval and synthesis. It comprises two key components: query-intent parsing and tool-selection strategy. The ToolPlanner, built on ChatGPT4, interprets user queries and classifies them into four categories: course-attribute queries, knowledge-point Q&A, resource retrieval, and composite queries. It outputs both a query label and essential requirements.
The overall workflow of this agentic architecture is systematically depicted in Figure 7.
As illustrated, the workflow begins with a user Query, which undergoes Intent Parsing by the ToolPlanner.This is followed by a dynamic Tool Selection phase where the agent, based on the parsed intent, chooses the appropriate retrieval tools. The retrieval then occurs in parallel: structured knowledge is fetched via KG Query (Cypher) to the Neo4j database, while unstructured information is retrieved through Vector Retrieval from the vector database. The gathered evidence is then fused in the Evidence Fusion step. The fused context is passed to the Answer Generation module, and the process incorporates a Feedback Loop that allows the agent to initiate additional retrieval rounds if the evidence is deemed insufficient for a comprehensive answer. This visualized pipeline effectively complements the conceptual description, highlighting the agent’s role in orchestrating the hybrid retrieval process.
A QueryType–ToolCapability mapping defines the available tools: course_tool, knowledge_tool, and library_tool. During decision-making, the agent considers the current intent, historical feedback, and tool performance to dynamically adjust the invocation sequence. When a single retrieval is insufficient, the agent triggers additional tool switches or supplementary retrieval rounds, incrementally aggregating complete evidence before generating the final answer.

3.5. Joint RAG–Knowledge-Graph Retrieval Process

Under the multi-round mechanism, the agent activates corresponding retrieval pipelines according to the query type, achieving joint access to structured and unstructured knowledge. For structured data, the KG tool executes predefined Cypher queries to obtain target entities and relations—for example, retrieving the link between a course and its offering school. For unstructured data, the system encodes the query using the BAAI/bge-large-zh-v1.5 embedding model and performs semantic retrieval in the vector database to return the top-k most relevant text fragments. This hybrid strategy balances coverage and precision. Post-retrieval, the system applies two-dimensional filtering: semantic-relevance pruning and authority-based filtering, ensuring that the final evidence is both comprehensive and credible.
Symbolic and Vector Retrieval Integration. After intent recognition, ToolWizard extracts candidate entities and maps them to KG node IDs via a dictionary lookup augmented with a fuzzy matching step (string similarity threshold τ = 0.75 ).
For symbolic retrieval, ToolWizard generates parameterized Cypher queries and executes them on Neo4j to obtain subgraphs.
For semantic retrieval, node descriptions and resource fragments were embedded using sentence–transformers/all–MiniLM–L6–v2 (dimension = 384) and indexed in an HNSW index ( M = 16 , e f C o n s t r u c t i o n = 200 ). We first retrieve the top–K vector candidates by cosine similarity ( K = 50 ), then rerank candidates using a hybrid score:
s c o r e = α × n o r m a l i z e d _ k g _ s c o r e + ( 1 α ) × c o s i n e _ s i m i l a r i t y ,
where kg_score accounts for the subgraph connectivity (number of hops between matched entities) and document–level BM25–like term overlap. In our experiments α was tuned on a validation fold ( α = 0.6 ).
Retrieved evidences are verbalized into short evidence chains and concatenated into the LLM prompt using a fixed template, reducing hallucination and improving traceability.

3.6. Generative Model and Prompt Optimization

3.6.1. Model Configuration

The Gemini-1.5-Flash model serves as the core generative component, transforming aggregated knowledge into natural-language answers. To balance accuracy and diversity, the model is configured with a temperature of 0.3 and a maximum output length of 512 tokens. The low temperature minimizes stochasticity, preventing factual drift during structured information generation, while the length limit ensures complete coverage of course attributes, knowledge hierarchies, and resource details.Note that this generative model is different from the ChatGPT4-based LLM used in the Intelligent Decision Layer for intent recognition and tool planning.

3.6.2. Scenario-Based Prompt Templates

Customized prompt templates are designed for different query types:
  • Course-attribute queries: enforce structured output following the order course name–credit–school–applicable majors.
  • Knowledge-point Q&A: emphasize hierarchical reasoning (chapter–core concept–application case) and integrate textual and linked evidence.
  • Composite queries: require synthesis of attributes, knowledge points, and resources into coherent multi-source answers with cited evidence.
This scenario-driven prompting strategy allows the model to adapt to varying educational query types, ensuring responses that are accurate, complete, and pedagogically coherent.

4. Results

4.1. Experimental Design

To evaluate the effectiveness of the proposed QA system, a series of experiments were conducted focusing on its ability to handle course-specific knowledge queries. The evaluation assessed three aspects: retrieval accuracy, response quality, and system performance in real-time educational settings. For each of the 50 test questions, a gold-standard reference answer was prepared by two subject-matter experts. For every system variant, the same two experts independently evaluated each generated answer.
Accuracy was defined as the proportion of responses whose main factual content matched the reference answer without key factual errors or contradictions. Semantic consistency was rated on a three-level scale (fully consistent, partially consistent, inconsistent) based on how well the generated response aligned with the meaning and coverage of the reference answer. For reporting semantic consistency (%), answers rated as either fully or partially consistent were counted as semantically consistent. All inter-rater disagreements were resolved through discussion.
In addition, response quality was further assessed in terms of explanatory clarity, while system performance was measured by the average response time. User satisfaction was investigated through surveys administered to student participants.
The experimental workflow included the following steps: (i) construction of a course knowledge graph based on the target curriculum; (ii) preparation of a question–answer dataset for testing; and (iii) comparison of system outputs against reference answers to compute accuracy and reliability metrics.

4.2. Case Selection and Analysis

The Pattern Recognition course was selected as the test case due to its conceptual complexity and relevance in computer science education. This course covers core topics such as Bayesian decision theory, supervised learning, clustering, and feature extraction, making it a suitable subject for assessing the system’s capability to answer knowledge-intensive questions.
A knowledge graph was constructed from the course syllabus, lecture notes, and supplementary teaching materials, encompassing entities such as course metadata, chapters, and key knowledge points (Figure 8). Each knowledge point was enriched with definitions, examples, and references to online resources.

Representative Multi-Turn Dialog and UI Screenshots

To illustrate the practical behavior of the KA-RAG system, two representative interaction cases from the deployed prototype are presented below, Figure 9 and Figure 10. Figure 10 shows a multi-turn dialog in which the user asks, “Can you introduce the Pattern Recognition Principles course?” The agent first performs intent recognition and initiates a knowledge-graph retrieval using the ToolWizard module. It identifies the Pattern Recognition Principles course node in the Neo4j graph and returns its structured attributes, including the course code (4085414), offering department, chapter structure, and associated learning resources.
During the RAG stage, the system verbalizes the retrieved KG facts and integrates the top-3 vector-retrieved passages, prompting the LLM to generate a unified and coherent explanation. The resulting answer explains that the course is offered by the Graduate School for graduate-level students and contains five chapters, including Classification (Bayesian decision theory, Naive Bayes, SVM, etc.). The evidence chain is displayed beneath the generated answer, for example: Course → Chapter 1 (Classification) → Resource (lecture_01.pdf) → Video link.
When the user follows up with “Where can I find the lecture video for Chapter 1?”, the agent retrieves the corresponding resource entity and returns the exact learning link from the resource repository.
Figure 11 presents the full user-interface workflow for another query: “Which colleges require students to learn Pattern Recognition?” The interface demonstrates how the agent first queries the knowledge graph to identify relationships between the course node and affiliated colleges, and then triggers a vector-retrieval step to supplement relevant textual descriptions.
The retrieved evidence indicates that the course Pattern Recognition is primarily offered by the School of Computer Science and Technology, School of Automation, and School of Electronic and Information Engineering. The final system answer summarizes these findings and clarifies that students majoring in Artificial Intelligence, Machine Learning, and Signal and Image Processing are required to take this course. The user interface clearly visualizes the sequential operations of intent parsing, dual-source retrieval, evidence fusion, and final answer generation.

4.3. Experimental Results and Discussion

4.3.1. Datasets

The experiments are conducted on the graduate-level course Pattern Recognition. Two structured datasets were constructed:
  • Course attributes: course name, course code, credit value (3.0), offering school (School of Computer Science), and five applicable majors.
  • Knowledge hierarchy: eight chapters (e.g., “Fundamentals of Pattern Recognition,” “Bayesian Classifier,” “Support Vector Machine”) containing 42 key knowledge points. Each knowledge point includes a difficulty level, concept explanation, and associated application scenarios.
The resource dataset consists of 156 items, including 32 tutorial videos, 68 Science Citation Index (SCI) papers linked to specific knowledge points, and 56 engineering case studies extracted from instructional materials. The knowledge graph was constructed in a semi-automatic manner, with approximately 60% of the nodes and relations generated through rule-based extraction and the remaining 40% verified and refined manually. In total, it took two graduate researchers approximately 25 h to complete the Pattern Recognition knowledge graph, which contains 42 knowledge points and 156 associated resources.

4.3.2. Test Dataset Construction

The following 50 questions were used to evaluate the KA-RAG system on the Pattern Recognition course. They are grouped into five categories. Each question was validated by subject experts.
A representative subset of this test dataset, illustrating the variety and structure of the questions, is presented in Table 2.
The complete Test dataset of 50 questions and answers is provided in tabular form, categorized as: (1) Course Attribute Queries, (2) Knowledge-Point Q&A, (3) Resource Retrieval, (4) Cross-Dimensional Queries, and (5) Complex Multi-Topic Queries. This dataset reflects realistic student questions collected during the 2023–2024 academic year.

4.3.3. Experimental Environment

Experiments ran on an Intel Xeon Gold 6330 CPU (32 cores) and an NVIDIA A100 GPU (80 GB) with 128 GB RAM, Ubuntu 22.04 LTS, Python 3.9, PyTorch 2.0, Neo4j 5.15, SentenceTransformer 2.2.2, and OpenAI API. Vector storage employed SSD (2 TB) for both the pgvector database and the Neo4j KG.

4.3.4. Ablation Study on System Components

To evaluate the contribution of each major component of the KA-RAG architecture, we conducted an ablation study with four comparative setups: (1) Basic RAG uses only vector-based retrieval and generation, without the knowledge graph or agent. (2) KG+RAG augments the basic RAG pipeline with knowledge-graph–based retrieval but does not include the agent. (3) Agent+RAG (no KG) introduces the agent for intent recognition and tool planning but does not use the knowledge graph. (4) Agent+KG+RAG combines both the agent and the knowledge graph, forming the full proposed model.This ablation design isolates the contribution of each module and provides a controlled comparison of their individual and combined effects.
The quantitative results of this ablation study are summarized in Table 3, which clearly illustrates the performance differences across the four system variants on the key metrics of accuracy and semantic consistency.
The evaluation results demonstrated that the proposed system achieved an average retrieval accuracy of 91.4% across 50 test queries. The generated answers exhibited 87.6% semantic consistency with expert-annotated references, confirming the effectiveness of the RAG-enhanced framework in producing contextually accurate and interpretable responses. System performance was satisfactory, with an average response time of 2.8 s, which is adequate for real-time educational applications.
Analysis by question type revealed that definition-based queries achieved the highest accuracy, as the system could reliably locate relevant nodes in the knowledge graph and generate explanatory responses. Course information queries also performed consistently well. However, performance was relatively lower for extended resource queries, where generated responses occasionally lacked sufficient references or completeness.
User survey results indicated that approximately 84% of participants considered the system responses valuable for supporting their learning activities. Students particularly appreciated the clarity of concept explanations and the inclusion of links to external resources. Nevertheless, limitations were noted when queries extended beyond the coverage of the knowledge graph or involved cross-disciplinary knowledge, where the system occasionally produced incomplete responses.
These findings confirm the system’s potential as an effective educational support tool, while also highlighting areas for improvement, such as expanding knowledge graph coverage, enhancing multi-hop reasoning, and integrating broader cross-course resources.

5. Practical Impact and Implications

5.1. Practical Impact

The proposed course-oriented QA system demonstrated tangible benefits for both learners and instructors in higher education contexts.
1. Improved retrieval efficiency: Students were able to obtain precise answers to course-related questions without navigating lengthy lecture materials, significantly reducing search time. 2. Enhanced learning experience: Responses included explanatory chains and links to online resources, supporting self-directed learning and reinforcing understanding of complex topics. 3. Support for academic services: The system offers a scalable extension to traditional library functions by providing semantic, course-specific information services, thereby contributing to the broader digital transformation of academic support environments.
Collectively, these outcomes confirm that integrating knowledge graphs and RAG into educational applications provides an effective means of bridging structured course content with natural language interaction.

5.2. Implications and Future Directions

Beyond empirical performance, this study provides several implications for educational technology and institutional practices.
Generalizability of the framework: Although demonstrated on the Pattern Recognition course, the KA-RAG architecture can be extended to other disciplines, including medicine, economics, and engineering, by adapting the entity schema and enriching domain-specific resources.
Redefining the role of libraries: The system illustrates how academic libraries can evolve from passive repositories of documents into intelligent platforms for knowledge organization, semantic retrieval, and personalized academic assistance.
Transparency and explainability in learning support: By embedding source evidence and knowledge paths into generated responses, the system enhances the traceability and credibility of academic information, aligning with the principles of responsible AI in education.
Future work will explore three directions: (i) expansion to multi-course and cross-disciplinary knowledge graphs, enabling more comprehensive coverage of curricula; (ii) integration of multimodal data, such as lecture slides and instructional videos, into the retrieval pipeline; and (iii) incorporation of user modeling and adaptive learning path recommendations to support personalized education at scale.

6. Conclusions

This study proposed and implemented a course-oriented question answering system that integrates a knowledge graph with retrieval-augmented generation (RAG) to enhance knowledge retrieval and learning support in higher education. The system was designed with four key components: (i) a responsive user interface for natural language interaction, (ii) an intelligent control module (ToolWizard) for intent recognition and query routing, (iii) a course knowledge graph and vector database for structured and semantic retrieval, and (iv) a RAG-based response generation mechanism to ensure accuracy and explainability.
Empirical evaluation using the Pattern Recognition course demonstrated that the system achieved high retrieval accuracy (91.4%) and semantic consistency (87.6%), with acceptable response latency for real-time educational use. User surveys further confirmed its practical value in improving learning efficiency and supporting academic services in library settings. These findings validate the feasibility of integrating knowledge graphs and RAG frameworks to bridge structured educational resources with natural language queries.
Nevertheless, several limitations remain. The current implementation is limited to a single course and does not fully address cross-disciplinary queries or multimodal resources. In addition, while the system enhances accuracy and explainability, its reasoning capacity for multi-hop and highly abstract queries is still constrained. Moreover, we did not perform a systematic benchmark of different large language models for the Intelligent Decision Layer and the Answer Generation Layer; the choice of a ChatGPT4-based controller and Gemini-1.5-Flash was mainly guided by preliminary pilot experiments and deployment constraints, which we leave as future work to optimize. Future research will therefore focus on extending the system to multi-course and cross-domain knowledge graphs, incorporating multimodal content such as lecture slides and videos, and integrating user modeling techniques to deliver adaptive learning recommendations. These directions will not only broaden the system’s applicability but also deepen its role in shaping intelligent educational services and digital libraries.

Author Contributions

Conceptualization, F.G. and S.X.; methodology, F.G. and W.H.; software, W.H. and T.L.; validation, T.L. and F.G.; formal analysis, F.G.; investigation, W.H. and T.L.; resources, S.X. and W.H.; data curation, F.G.; writing—original draft preparation, F.G. and W.H.; writing—review and editing, S.X. and W.H.; visualization, T.L.; supervision, W.H.; project administration, F.G.; funding acquisition, T.L. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported in part by the National Natural Science Foundation of China (62072350, 62171328), Central Government Guides Local Science and Technology Development Special Projects (ZYYD2022000021), the National Natural Science Foundation of Hubei (2023AFB158), Enterprise Technology Innovation Project (2022012202015060), Academic Project of Hubei Provincial Library Society (stxh2024A01), Academic Project of Wuhan Institute of Technology (2024ZH08).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The de-identified datasets and experimental scripts used in this study are available from the corresponding author upon reasonable request. The anonymized dataset and core code have been released on GitHub: https://github.com/gfjgfjgfj/KA-RAG- (accessed on 17 November 2025) to support reproducibility.

Conflicts of Interest

The authors declare no conflicts of interest.

References

  1. García-Méndez, S.; e Arriba-Pérez, F.; Somoza-López, M.D.C. A Review on the Use of Large Language Models as Virtual Tutors. Sci. Educ. 2025, 34, 877–892. [Google Scholar] [CrossRef]
  2. Shen, S. Application of Large Language Models in the Field of Education. Theor. Nat. Sci. 2024, 34, 1163. [Google Scholar] [CrossRef]
  3. Park, J.-H.; Kim, S.-J.; Lee, S.-T. AI and Creativity in Entrepreneurship Education: A Systematic Review of LLM Applications. AI 2025, 6, 100. [Google Scholar] [CrossRef]
  4. Lai, C.H.; Huang, J.; Chen, T. ITS-CAL: An Intelligent Tutoring System for Coding Powered by Large Language Models. Appl. Sci. 2025, 15, 1922. [Google Scholar] [CrossRef]
  5. Zhou, X.; Li, Y.; Wang, Z.; Zhang, C.; Liu, P.; Chen, X.; Yang, F.; Wu, Z.; Li, H.; Zhang, W.; et al. Difficulty-Aware Programming Knowledge Tracing via Large Language Models. Sci. Rep. 2025, 15, 7422. [Google Scholar]
  6. Wang, T.; Zhan, Y.; Lian, J.; Hu, Z.; Yuan, N.J.; Zhang, Q.; Xie, X.; Xiong, H. LLM-Powered Multi-Agent Framework for Goal-Oriented Learning in Intelligent Tutoring Systems. arXiv 2025, arXiv:2501.15749. [Google Scholar]
  7. Gaeta, A.; Weber, F.; D’Angelo, G.; Di Adamo, D.; Persico, D.; Pinto, M.; Roselli, T.; Sessa, S.; Taibi, D.; Temperini, M. Enhancing Traditional Intelligent Tutoring Architectures with Large Language Models: Design and Evaluation. In Proceedings of the International Conference on Information Systems (ICIS 2025), Nashville, TN, USA, 14–17 December 2025; AIS Electronic Library: Redmond, WA, USA, 2025; pp. 1–15. [Google Scholar]
  8. Rashtchian, C.; Juan, P. Deeper Insights into Retrieval-Augmented Generation: The Role of Sufficient Context. Google Research Blog. 2025. Available online: https://research.google/blog/deeper-insights-into-retrieval-augmented-generation-the-role-of-sufficient-context/ (accessed on 13 November 2025).
  9. Wang, H.; Shi, Y. Knowledge Graph Combined with Retrieval-Augmented Generation for Enhancing LMs Reasoning: A Survey. Acad. J. Sci. Technol. 2025, 14, 227–235. [Google Scholar] [CrossRef]
  10. Klesel, M.; Wittmann, H.F. Retrieval-Augmented Generation (RAG). Bus. Inf. Syst. Eng. 2025, 67, 551–561. [Google Scholar] [CrossRef]
  11. You, X.; Luo, Y.; Gu, L. MS-RAG: Simple and Effective Multi-Semantic Retrieval-Augmented Generation. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, Suzhou, China, 4–9 November 2025; Association for Computational Linguistics. 2025; pp. 22620–22636. [Google Scholar] [CrossRef]
  12. Yu, Y.; Zhao, S.; Wang, Z.; Fan, M.; Zhang, X.; Zhang, Y.; Zhengfan, W.; Huang, H.; Liu, T. RAG+: Enhancing Retrieval-Augmented Generation with Application-Aware Reasoning. In Proceedings of the 2025 Conference on Empirical Methods in Natural Language Processing, Suzhou, China, 4–9 November 2025; Association for Computational Linguistics. 2025; pp. 32001–32025. [Google Scholar] [CrossRef]
  13. Zhu, X.; Xie, Y.; Liu, Y.; Li, Y.; Hu, W. Knowledge Graph-Guided Retrieval-Augmented Generation. In Proceedings of the 2025 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (NAACL 2025), Long Papers, Albuquerque, NM, USA, 29 April–4 May 2025; pp. 8912–8924. [Google Scholar] [CrossRef]
  14. Lu, T.; Wang, F.; Huang, L. OctoTools: An Agentic Framework with Extensible Tools for Complex Reasoning. arXiv 2025, arXiv:2502.11271. [Google Scholar] [CrossRef]
  15. Osei Opoku, D.; Sheng, M.; Zhang, Y. DO-RAG: A Domain-Specific QA Framework Using Knowledge Graph-Enhanced Retrieval-Augmented Generation. arXiv 2025, arXiv:2505.17058. [Google Scholar]
  16. An, B.; Zhang, S.; Dredze, M. RAG LLMs Are Not Safer: A Safety Analysis of Retrieval-Augmented Generation for Large Language Models. arXiv 2025, arXiv:2504.18041. [Google Scholar]
  17. Lewis, P.; Perez, E.; Piktus, A.; Petroni, F.; Karpukhin, V.; Goyal, N.; Küttler, H.; Lewis, M.; Yih, W.-t.; Rocktäschel, T.; et al. Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks. Adv. Neural Inf. Process. Syst. 2020, 33, 9459–9474. [Google Scholar]
  18. Karpukhin, V.; Oguz, B.; Min, S.; Lewis, P.S.; Wu, L.; Edunov, S.; Chen, D.; Yih, W.-t. Dense Passage Retrieval for Open-Domain Question Answering. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing (EMNLP 2020), Online, 16–20 November 2020; pp. 6769–6781. [Google Scholar]
  19. Guu, K.; Lee, K.; Tung, Z.; Pasupat, P.; Chang, M.-W. REALM: Retrieval-Augmented Language Model Pre-Training. arXiv 2020, arXiv:2002.08909. [Google Scholar] [CrossRef]
  20. Izacard, G.; Grave, É. Leveraging Passage Retrieval with Generative Models for Open-Domain Question Answering. In Proceedings of the 16th Conference of the European Chapter of the Association for Computational Linguistics (EACL 2021), Online, 19–23 April 2021; pp. 874–880. [Google Scholar]
  21. Yu, Y.; Ping, W.; Liu, Z.; Wang, B.; You, J.; Zhang, C.; Shoeybi, M.; Catanzaro, B. RankRAG: Unifying Context Ranking with Retrieval-Augmented Generation in LLMs. Adv. Neural Inf. Process. Syst. 2024, 37, 121156–121184. [Google Scholar]
  22. Jiang, Z.; Ma, X.; Chen, W. LongRAG: Enhancing Retrieval-Augmented Generation with Long-Context LLMs. arXiv 2024, arXiv:2406.15319. [Google Scholar]
  23. Bordes, A.; Usunier, N.; Garcia-Duran, A.; Weston, J.; Yakhnenko, O. Translating Embeddings for Modeling Multi-Relational Data. Adv. Neural Inf. Process. Syst. 2013, 26, 2787–2795. [Google Scholar]
  24. Kipf, T.N.; Welling, M. Semi-Supervised Classification with Graph Convolutional Networks. In Proceedings of the International Conference on Learning Representations (ICLR), Toulon, France, 24–26 April 2017. [Google Scholar]
  25. Schlichtkrull, M.; Kipf, T.N.; Bloem, P.; Van Den Berg, R.; Titov, I.; Welling, M. Modeling Relational Data with Graph Convolutional Networks. In Proceedings of the European Semantic Web Conference (ESWC), Crete, Greece, 3–7 June 2018; pp. 593–607. [Google Scholar]
  26. Li, L.; Wang, Z. Knowledge Graph Enhanced Intelligent Tutoring System Based on Exercise Representativeness and Informativeness. arXiv 2023, arXiv:2307.15076. [Google Scholar] [CrossRef]
  27. Canal-Esteve, M.; Gutiérrez, Y. Educational Material to Knowledge Graph Conversion: A Methodology to Enhance Digital Education. In Proceedings of the 1st Workshop on Knowledge-Augmented Language Models (KaLLM); Association for Computational Linguistics: Bangkok, Thailand, 2024. [Google Scholar]
  28. Qu, K.; Li, K.C.; Wong, B.T.M.; Wu, M.M.; Liu, M. A Survey of Knowledge Graph Approaches and Applications in Education. Electronics 2024, 13, 2537. [Google Scholar] [CrossRef]
  29. Aliyu, I.; Kana, A.F.D.; Aliyue, S. Development of Knowledge Graph for University Courses Management. Int. J. Educ. Manag. Eng. 2020, 10, 1–10. [Google Scholar] [CrossRef]
  30. Kim, D.H.; Shakya, R. A Study on the Curriculum Design for K–12 AI Education Using Knowledge Graph. Eur. J. Sci. Innov. Technol. 2023, 3, 515–531. [Google Scholar]
  31. Yao, S.; Zhao, J.; Yu, D.; Du, N.; Shafran, I.; Narasimhan, K.R.; Cao, Y. ReAct: Synergizing Reasoning and Acting in Language Models. arXiv 2022, arXiv:2210.03629. [Google Scholar]
  32. Schick, T.; Dwivedi-Yu, J.; Dessì, R.; Raileanu, R.; Lomeli, M.; Hambro, E.; Zettlemoyer, L.; Cancedda, N.; Scialom, T. Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv 2023, arXiv:2302.04761. [Google Scholar] [CrossRef]
  33. Yu, D.; Zhu, C.; Fang, Y.; Yu, W.; Wang, S.; Xu, Y.; Ren, X.; Yang, Y.; Zeng, M. KG-FiD: Infusing Knowledge Graphs into Fusion-in-Decoder. arXiv 2021, arXiv:2110.04330. [Google Scholar]
  34. Guu, K.; Lee, K.; Tsvetkov, Y. Multimodal Retrieval-Augmented Learning for STEM Education. In Proceedings of the 40th International Conference on Machine Learning, Honolulu, HI, USA, 23–29 July 2023; pp. 1–8. [Google Scholar]
  35. Adams, A. From Novice to Navigator: Students’ Help-Seeking Behavior and Perceived Usefulness of ChatGPT. Educ. Inf. Technol. 2023, 28, 5431–5450. [Google Scholar]
  36. Zhang, X.; Zhang, Y.; Wang, Y. A Systematic Review of Key Retrieval-Augmented Generation Techniques. arXiv 2025, arXiv:2507.18910. [Google Scholar]
  37. Chen, J.; Liu, S.; Zhang, Z. LightRAG: Simple and Fast Retrieval-Augmented Generation. arXiv 2025, arXiv:2410.05779. [Google Scholar]
  38. Gao, Y.; Zhang, L.; Liu, X.; Xu, C. A Systematic Review of Key Retrieval-Augmented Methods for Large Language Models. arXiv 2023, arXiv:2312.10997. [Google Scholar]
  39. Henkel, O.; Lindl, T.; Stöter, J. Retrieval-Augmented Generation to Improve Math Question Answering. In Proceedings of the 18th International Conference on Educational Data Mining (EDM), Atlanta, GA, USA, 14–17 July 2024; pp. 289–298. [Google Scholar]
  40. Song, J.; Xu, Z.; He, M.; Feng, J.; Shen, B. Graph Retrieval-Augmented Large Language Models for Rare Genetic Disease Diagnosis. NPJ Digit. Med. 2025, 8, 543. [Google Scholar] [CrossRef] [PubMed]
  41. Chen, S. AcademicRAG: Knowledge Graph Enhanced Retrieval-Augmented Generation for Academic Contexts. arXiv 2025, arXiv:2502.01763. [Google Scholar]
  42. Sun, S.; Li, X.; Li, W.; Lei, D.; Li, S.; Yang, L.; Wu, Y. Review of Graph Neural Networks Applied to Knowledge Graph Reasoning. J. Comput. Sci. Explor. 2023, 17, 27–52. [Google Scholar]
  43. Bei, Y.; Zhang, W.; Wang, S.; Chen, W.; Zhou, S.; Chen, H.; Li, Y.; Bu, J.; Pan, S.; Yu, Y.; et al. Graphs Meet AI Agents: Taxonomy, Progress, and Future Opportunities. arXiv 2025, arXiv:2506.18019. [Google Scholar] [CrossRef]
  44. Liu, Q.; Li, Y.; Duan, H.; Liu, Y.; Qin, Z. Survey on the Construction Technology of Knowledge Graphs. J. Comput. Res. Dev. 2016, 53, 582–600. [Google Scholar]
  45. Jiang, W.; Zhang, M.; Li, Q. MAS-KCL: Knowledge Component Graph Structure Learning with Large Language Model-Based Agentic Workflow. arXiv 2025, arXiv:2505.14126. [Google Scholar] [CrossRef]
  46. Tan, Y.; Zhang, J.; Xia, L. Study on the Development History and Current Status of Semantic Networks. J. Doc. Inf. Knowl. 2019, 6, 102–110. [Google Scholar] [CrossRef]
  47. Li, S.; Yin, Q.W.; Hu, Y.J.; Guo, M.; Fu, X.J. A Review of Ontology Research. Comput. Res. Dev. 2004, 41, 1041–1052. [Google Scholar]
  48. Xue, H. Research on Smart Education Systems Driven by Knowledge Graphs. China New Telecommun. 2024, 26, 43–45. [Google Scholar]
  49. Li, H.; Zhong, B. Educational Knowledge Graph: Research Progress and Future Development. Comput. Eng. 2024, 50, 1–12. [Google Scholar]
  50. Berners-Lee, T.; Hendler, J.; Lassila, O. The Semantic Web. Sci. Am. 2001, 284, 34–43. [Google Scholar] [CrossRef]
  51. Chen, L.; Tong, P.; Jin, Z.; Sun, Y.; Ye, J.; Xiong, H. Plan-on-Graph: Self-Correcting Adaptive Planning of Large Language Models on Knowledge Graphs. Adv. Neural Inf. Process. Syst. (NeurIPS) 2024, 37, 37665–37691. [Google Scholar]
Figure 1. RAG Structure.
Figure 1. RAG Structure.
Applsci 15 12547 g001
Figure 2. Embedding Model.
Figure 2. Embedding Model.
Applsci 15 12547 g002
Figure 3. Knowledge Graph Retrieval and Reasoning.
Figure 3. Knowledge Graph Retrieval and Reasoning.
Applsci 15 12547 g003
Figure 4. Integration of Agentic RAG and Knowledge Graphs. The query is processed through five stages: Query, Intent Recognition, KG Retrieval (Cypher), Vector Retrieval (Embedding Search), and Evidence Fusion. The ToolPlanner identifies query type, retrieves structured (KG) and unstructured (vector) knowledge, and fuses results using a hybrid score (K = 50, α = 0.6, τ = 0.75, T = 0.3).
Figure 4. Integration of Agentic RAG and Knowledge Graphs. The query is processed through five stages: Query, Intent Recognition, KG Retrieval (Cypher), Vector Retrieval (Embedding Search), and Evidence Fusion. The ToolPlanner identifies query type, retrieves structured (KG) and unstructured (vector) knowledge, and fuses results using a hybrid score (K = 50, α = 0.6, τ = 0.75, T = 0.3).
Applsci 15 12547 g004
Figure 5. System Structure.The ToolPlanner LLM at the Intelligent Decision Layer interprets user intent and selects retrieval tools. The Knowledge Retrieval Layer performs hybrid retrieval from the Knowledge Graph and Vector Database to gather structured and unstructured evidence. The Answer Generation Layer fuses these inputs via Gemini-1.5-Flash to produce coherent, accurate, and context-aware responses.
Figure 5. System Structure.The ToolPlanner LLM at the Intelligent Decision Layer interprets user intent and selects retrieval tools. The Knowledge Retrieval Layer performs hybrid retrieval from the Knowledge Graph and Vector Database to gather structured and unstructured evidence. The Answer Generation Layer fuses these inputs via Gemini-1.5-Flash to produce coherent, accurate, and context-aware responses.
Applsci 15 12547 g005
Figure 6. Course Knowledge Graph. Rectangles denote courses, circles denote knowledge points, and arrows illustrate their relationships. The ’contains’ relationship between the ’Pattern Recognition Principles’ course entity and the ’Random Forest’ knowledge point entity, as illustrated in the diagram, serves as a typical case of automated construction achieved through rule-based matching against the course-chapter mapping table.
Figure 6. Course Knowledge Graph. Rectangles denote courses, circles denote knowledge points, and arrows illustrate their relationships. The ’contains’ relationship between the ’Pattern Recognition Principles’ course entity and the ’Random Forest’ knowledge point entity, as illustrated in the diagram, serves as a typical case of automated construction achieved through rule-based matching against the course-chapter mapping table.
Applsci 15 12547 g006
Figure 7. Agentic-RAG multi-round tool-calling architecture. The workflow proceeds as: Query → Intent Parsing → Tool Selection → KG Query (Cypher)/Vector Retrieval → Evidence Fusion → Answer Generation → Feedback Loop. Key parameters: K = 50 , α = 0.6 , τ = 0.75 , temperature = 0.3 .
Figure 7. Agentic-RAG multi-round tool-calling architecture. The workflow proceeds as: Query → Intent Parsing → Tool Selection → KG Query (Cypher)/Vector Retrieval → Evidence Fusion → Answer Generation → Feedback Loop. Key parameters: K = 50 , α = 0.6 , τ = 0.75 , temperature = 0.3 .
Applsci 15 12547 g007
Figure 8. Pattern Recognition course Knowledge Graph. Rectangles denote courses, circles denote knowledge points, and arrows illustrate their relationships.
Figure 8. Pattern Recognition course Knowledge Graph. Rectangles denote courses, circles denote knowledge points, and arrows illustrate their relationships.
Applsci 15 12547 g008
Figure 9. Example of a KG search of the question “Can you introduce the Pattern Recognition Principles course?”.
Figure 9. Example of a KG search of the question “Can you introduce the Pattern Recognition Principles course?”.
Applsci 15 12547 g009
Figure 10. Multi-turn dialog illustrating KG-based retrieval, vector-based evidence fusion, and agent reasoning.
Figure 10. Multi-turn dialog illustrating KG-based retrieval, vector-based evidence fusion, and agent reasoning.
Applsci 15 12547 g010
Figure 11. Screenshot showing the full workflow from question → tool invocation → evidence integration → evidence-supported answer.
Figure 11. Screenshot showing the full workflow from question → tool invocation → evidence integration → evidence-supported answer.
Applsci 15 12547 g011
Table 1. Algorithmic Comparison of RAG, Knowledge Graph, and Agentic-RAG Frameworks.
Table 1. Algorithmic Comparison of RAG, Knowledge Graph, and Agentic-RAG Frameworks.
CriterionRAGKnowledge GraphAgentic-RAG (Proposed)
Core representationDense embeddings (vector DB)Symbolic triples ( h , r , t ) Hybrid semantic–structural graph embeddings
Retrieval mechanismCosine similarity in high-dimensional spaceGraph traversal/Cypher queryPolicy-guided hybrid retrieval
Reasoning depthShallow (context window limited)Deep relational reasoningMulti-hop reasoning via agent planning
ExplainabilityLow (latent space)High (explicit relations)High, with evidence trace and fusion weights
Computational complexity O ( n d ) retrieval + decoding O ( | E | + | R | ) traversal O ( k d + | E | ) adaptive hybrid
Adaptivity to user intentStatic retrieverRule-based query templatesDynamic multi-tool orchestration
Performance on educational QAModerate accuracy, low interpretabilityHigh structure, limited coverageHigh accuracy, explainable, adaptive
Table 2. User Q&A Test Set.
Table 2. User Q&A Test Set.
CategorySample Question (Subset)Reference Answer (Example)
Course AttributeWhich college offers the course?College of Computer Science.
Knowledge Q&AWhat is Naive Bayes?Naive Bayes is a simple and efficient classification algorithm based on Bayes’ theorem. It calculates the probability of each class given the input features and assumes all features are independent.
Resource RetrievalHelp me find the learning link for the Pattern Recognition Principles course.https://www.bilibili.com/video/BV144411D74h/
Cross-DimensionalWhich majors include SVM?Artificial Intelligence; Data Science.
Complex Multi-TopicCompare Naive Bayes and Random Forest.Naive Bayes assumes independence, while Random Forest uses ensembles for variance reduction.
Table 3. Comparison of KA-RAG variants on accuracy and semantic consistency.
Table 3. Comparison of KA-RAG variants on accuracy and semantic consistency.
Accuracy (%)Semantic Consistency (%)
Basic RAG87.0%85.5%
KG+ RAG88.3%86.6%
Agent+RAG (no KG)87.5%86.7%
Agent+KG+RAG91.4%87.6%
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Gao, F.; Xu, S.; Hao, W.; Lu, T. KA-RAG: Integrating Knowledge Graphs and Agentic Retrieval-Augmented Generation for an Intelligent Educational Question-Answering Model. Appl. Sci. 2025, 15, 12547. https://doi.org/10.3390/app152312547

AMA Style

Gao F, Xu S, Hao W, Lu T. KA-RAG: Integrating Knowledge Graphs and Agentic Retrieval-Augmented Generation for an Intelligent Educational Question-Answering Model. Applied Sciences. 2025; 15(23):12547. https://doi.org/10.3390/app152312547

Chicago/Turabian Style

Gao, Fangqun, Shu Xu, Weiyan Hao, and Tao Lu. 2025. "KA-RAG: Integrating Knowledge Graphs and Agentic Retrieval-Augmented Generation for an Intelligent Educational Question-Answering Model" Applied Sciences 15, no. 23: 12547. https://doi.org/10.3390/app152312547

APA Style

Gao, F., Xu, S., Hao, W., & Lu, T. (2025). KA-RAG: Integrating Knowledge Graphs and Agentic Retrieval-Augmented Generation for an Intelligent Educational Question-Answering Model. Applied Sciences, 15(23), 12547. https://doi.org/10.3390/app152312547

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop