A double-layer adaptive learning knowledge graph dynamic construction method, system and device
By using a two-layer adaptive learning knowledge graph system, and leveraging multi-agent collaboration to construct macro-level career and micro-level curriculum graphs, the system addresses the issues of lag and inefficiency in traditional educational path planning, achieving dynamic, reliable, and efficient educational resource supply and path planning.
Patent Information
- Application Number
- CN202610951453.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-29
- Publication Date
- 2026-11-27
AI Technical Summary
Traditional educational pathway planning is static and reliant on manual intervention, resulting in delayed updates, bloated graph structures, low query efficiency, and poor knowledge reusability, making it difficult to achieve dynamic educational resource supply and efficient pathway planning.
A two-layer adaptive learning knowledge graph method is adopted, which constructs a macro-level career path graph and a micro-level course knowledge graph through multi-agent collaboration. A large language model is used for real-time data capture and structure transformation to achieve dynamic path planning and efficient querying.
It enables dynamic and precise supply of educational resources, improves system performance and knowledge modularity and reusability, reduces query complexity and cognitive bias, and supports educational path planning based on real-time market demands.
Smart Images

Figure CN123180293A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the interdisciplinary fields of artificial intelligence, digital education, and knowledge graph construction. Specifically, it relates to a method, system, and device for dynamically constructing a two-layer adaptive learning knowledge graph that includes macro-level vocational course paths and micro-level course knowledge point dependencies, utilizing Large Language Model (LLM) and multi-agent collaborative technology. Background Technology
[0002] Traditional educational pathway planning (such as school curriculum plans or online education platform course catalogs) is inherently static and faces the following core technological shortcomings: 1. Construction relies on manual labor and updates are severely lagging: The construction of traditional knowledge graphs requires education experts to manually break down knowledge points and plan paths, which is time-consuming and labor-intensive. Its update cycle lags far behind the rapid changes in the skills requirements of the real job market, resulting in a disconnect between "learning" and "application".
[0003] 2. Bulky single-layer graph structure and low query efficiency: Existing knowledge graphs often mix macro-level course relationships (e.g., "Advanced Mathematics" is a prerequisite for "Machine Learning") with micro-level conceptual relationships (e.g., "Derivative" is prerequisite knowledge for "Calculus") in the same flat, single-layer graph. This leads to an exponential expansion of graph nodes, resulting in extremely low graph traversal query efficiency when performing high-level path planning or low-level knowledge point diagnosis.
[0004] 3. Poor knowledge reusability and difficulty in expansion: A single-layer structure makes it difficult to achieve modular management of knowledge, and new career paths cannot reuse the existing underlying course knowledge structure, resulting in a large amount of data redundancy in the knowledge base. Summary of the Invention
[0005] The present invention provides a two-layer adaptive learning knowledge graph dynamic construction method, system and device that combines dynamism, efficiency, scalability and reliability, and can solve at least one of the above-mentioned technical problems.
[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A two-layer adaptive learning knowledge graph dynamic construction method includes the following steps: S1. The system receives the user's input target command and triggers a two-layer workflow; S2. When the input target instruction is a profession, construct a Level 1 macro-level career path map; S3. When a specific course is selected in the Level 1 macro career path map, a Level 2 micro course knowledge map is constructed. S4. Perform bidirectional persistence of mixed data for the Level 1 macro career path graph and the Level 2 micro course knowledge graph, and establish a foreign key association pointing to the Level 1 macro career path graph in the Level 2 micro course knowledge graph directory.
[0007] Furthermore, in S1, the two-layer adaptive learning knowledge graph system receives higher-order learning objectives input by the user. The objectives include macro and micro levels, corresponding to career objectives and course objectives, respectively. According to the objective type, the application service layer of the system asynchronously triggers the corresponding macro Level 1 or micro Level 2 multi-agent collaborative workflow.
[0008] Furthermore, in S2, the first multi-agent team is invoked for collaboration. This team includes a search agent, a summarizing agent, a planning agent, and a graph construction agent. The process of constructing the Level 1 macro-career path graph, i.e., the L1 graph, is as follows: S2.1 Search agent performs data retrieval: Calls the API interface of an external real-time recruitment platform to retrieve multiple original job description texts with earlier update dates related to the entered occupation; S2.2, The abstract agent performs requirement summarization: Based on the deep reasoning ability of the large language model, it extracts unstructured original job description text and outputs a structured list containing core knowledge requirements and skill requirements. S2.3 Planning the intelligent agent for instructional planning: Mapping the structured list to a specific curriculum system, designing prerequisite dependencies between courses, and generating a natural language learning plan that conforms to cognitive laws; S2.4 Graph Construction Agent Performs Structured Transformation: The natural language learning plan is accurately translated into a graph database query language, defined as "Course" nodes and "PRE_REQUISITE_FOR" edges, where nodes represent courses and edges represent prerequisite dependencies between courses.
[0009] Furthermore, in S3, the courses selected in the Level 1 macro-career path graph are used as input to the Level 2 micro-course knowledge graph. A second multi-agent team is invoked for collaboration. This second multi-agent team includes a search agent, a summarizing agent, and a graph construction agent. The process of constructing the Level 2 micro-course knowledge graph, i.e., the L2 graph, is as follows: S3.1 Search agent performs outline retrieval: Call the online education platform API to retrieve the authoritative teaching outline and detailed catalog corresponding to the selected courses in the L1 graph; S3.2, The abstract agent performs knowledge deconstruction: it identifies and extracts core knowledge points across linear outline chapters, infers deep, cross-chapter logical dependencies between knowledge points, and generates knowledge point dependencies. S3.3, Graph Construction Agent Performs Structured Transformation: The knowledge point dependencies are converted into a graph database query language, defined as “Knowledge” nodes and “PRE_REQUISITE_FOR” edges, where nodes represent knowledge points and edges represent the logical dependencies between knowledge points.
[0010] Furthermore, in S4, based on the callback function mechanism, the graph attribute metadata generated by the Level 1 macro career path graph (L1 graph) and the Level 2 micro course knowledge graph (L2 graph) are persisted to a relational database. At the same time, the generated graph database query language is automatically executed in the background thread of the system to inject the structured graph data, including nodes and edges, into the native graph database. A foreign key association pointing to the L1 graph is established in the L2 graph directory, so that the courses in the L2 graph can be reversed to the corresponding careers in the L1 graph.
[0011] A two-layer adaptive learning knowledge graph system, applicable to the dynamic construction method of the two-layer adaptive learning knowledge graph, includes: The AI engine layer is based on the AutoGen framework and encapsulates the client to directly interact with the deep inference large language model. It is configured with a first multi-agent team and a second multi-agent team with different System Messages and Function Tools. The AI engine layer adopts a polling group dialogue mode to orchestrate collaboration. A hybrid data persistence layer, connected to the AI engine layer, includes a relational database and a native graph database. The relational database stores graph attribute metadata of the Level 1 macro career path graph and the Level 2 micro course knowledge graph. The native graph database stores structured graph data of the Level 1 macro career path graph and the Level 2 micro course knowledge graph, and isolates the two levels of graphs through node labels in the structured graph data. The presentation layer, which serves as the front-end interface, is built on React and connected to the hybrid data persistence layer. It is used to retrieve data from the back-end and provide users with an intuitive knowledge graph visualization and interactive interface. The application service layer, which serves as the backend service framework, interacts with the three layers mentioned above to manage, process, invoke, and distribute data.
[0012] Furthermore, in the AI engine layer, both the first multi-agent team and the second multi-agent team include a search agent, a summary agent, and a graph construction agent. The first multi-agent team also includes a planning agent.
[0013] Furthermore, in the hybrid data persistence layer, in the structured graph data of the graph database query language generated by the Level 1 macro career path graph, node labels are defined as courses, and edge labels are the prerequisite dependencies between courses. In the structured graph data of the graph database query language generated by the Level 2 micro course knowledge graph, node labels are defined as knowledge points, and edge labels are the logical dependencies between knowledge points.
[0014] A computer device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the above-described two-layer adaptive learning knowledge graph dynamic construction method.
[0015] The beneficial effects of this invention are reflected in: 1. Transforming abstract goals into dynamic, structured paths (dynamic nature): This breaks through the limitations of large-scale static knowledge bases. The starting point of the Level 1 graph is real-time crawled data, and the generated learning paths are directly linked to market demand for personnel at the time of query, achieving dynamic and precise supply of educational resources.
[0016] 2. The two-tier architecture significantly improves system performance (efficiency): It decouples macro-level curriculum planning from micro-level knowledge point diagnosis. When planning a career path, only the sparse L1 graph needs to be traversed, and when diagnosing specific knowledge points, only the independent L2 graph needs to be searched, which greatly reduces the query complexity and computational overhead of the graph database.
[0017] 3. Knowledge modularization and high reusability (scalability): L1 and L2 graphs are logically linked through a foreign key (parent_id). Once a mature L2 graph (such as a "data structure") is generated once, it can be linked to countless different L1 graph career paths, avoiding redundant generation and storage of underlying knowledge.
[0018] 4. Heterogeneous agent orchestration reduces illusions (reliability): Applying different combinations of agent teams at different cognitive abstraction levels (L1 graph includes planning agents, L2 graph excludes planning agents). This "division of cognitive labor" breaks down the massive and complex single-step reasoning into multi-step collaboration, greatly reducing the error rate and cognitive bias of a single LLM model. Attached Figure Description
[0019] The accompanying drawings, which are provided to further illustrate this application and form part of this application, illustrate exemplary embodiments of this application and are used to explain this application, but do not constitute an undue limitation of this application.
[0020] Figure 1 This is a schematic diagram of the overall process of the two-layer adaptive learning knowledge graph dynamic construction method according to an embodiment of the present invention.
[0021] Figure 2 This is a schematic diagram of the two-layer knowledge graph architecture and data association in an embodiment of the present invention.
[0022] Figure 3 This is a schematic diagram of the collaborative workflow of the first multi-agent team according to an embodiment of the present invention.
[0023] Figure 4 This is a schematic diagram of the collaborative workflow of the second multi-agent team according to an embodiment of the present invention. Detailed Implementation
[0024] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0025] It should be noted that the meaning of "and / or" throughout the text includes three parallel solutions. Taking "A and / or B" as an example, it includes solution A, solution B, or a solution that simultaneously satisfies A and B. Furthermore, "multiple" refers to two or more. Additionally, the technical solutions of the various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. When the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed by this invention.
[0026] This invention provides a two-layer adaptive learning knowledge graph system, comprising: The AI engine layer encapsulates the client based on the AutoGen framework, directly interacts with deep inference large language models (such as Deepseek-reasoner), and is configured with a first multi-agent team and a second multi-agent team with different System Messages and Function Tools. The AI engine layer also uses a round-robin group chat mode to orchestrate collaboration. A hybrid data persistence layer, connected to the AI engine layer, includes a relational database (SQLite) and a native graph database (Neo4j). The relational database stores graph attribute metadata (such as graph ID, name, parent-child relationships, etc.) for the Level 1 macro career path graph and the Level 2 micro course knowledge graph. The native graph database stores structured graph data for the Level 1 macro career path graph and the Level 2 micro course knowledge graph, and isolates the two levels of graphs through node labels in the structured graph data. The presentation layer, which serves as the front-end interface, is built on React and connected to the hybrid data persistence layer. It is used to retrieve data from the back-end and provide users with an intuitive knowledge graph visualization and interactive interface. The application service layer, which serves as the backend service framework, interacts with the three layers mentioned above to manage, process, invoke, and distribute data (such as managing user logins, reading data from the hybrid data persistence layer based on user operations sent from the front end, and submitting tasks such as building graphs to the AI engine layer).
[0027] In this embodiment, in the AI engine layer, both the first multi-agent team and the second multi-agent team include a search agent, a summary agent, and a graph construction agent. The first multi-agent team also includes a planning agent.
[0028] It should be noted that the "intelligent agent" involved in this invention refers to an intelligent entity in the field of artificial intelligence that can perceive the environment through sensors (i.e., tool invocation), make autonomous decisions with its own intelligence, and act on the environment through actuators. Its core features are autonomy, responsiveness, proactiveness, and sociality. It can proactively plan and complete goals without continuous human intervention. It can be a software form of AI assistant or intelligent customer service, or a hardware entity such as autonomous driving or robot. Currently, intelligent agents based on large models have the ability to remember, invoke tools, and process complex tasks.
[0029] In this embodiment, in the hybrid data persistence layer, the structured graph data generated by the graph database query language (Cypher script) of the Level1 macro career path graph is defined with node labels as courses and edge labels as prerequisite dependencies between courses. In the structured graph data generated by the graph database query language of the Level2 micro course knowledge graph, node labels are defined as knowledge points and edge labels as logical dependencies between knowledge points.
[0030] "Prerequisite dependencies between courses" is a core concept in the education curriculum system. It defines the knowledge base that must be mastered before learning a specific course, usually in the form of "course A is a prerequisite for course B". This relationship not only directly affects the formulation of teaching plans and the planning of students' learning paths, but it is also a classic application scenario of graph theory algorithms in computer science, often used to detect circular dependencies in course arrangements and generate feasible learning sequences.
[0031] From a data structure and algorithm perspective, prerequisite relationships can be abstracted as a directed graph model. In this model, each course is considered a node in the graph, and a directed edge from node B to node A represents "course B is a prerequisite for course A," meaning that B must be completed before learning A. This modeling approach allows for the analysis of complex course dependency networks using graph theory algorithms. A key task is to determine the rationality of the course arrangement, i.e., whether there are circular dependencies in the graph. For example, if course A depends on course B, and course B depends on course A, a cycle is formed, preventing students from starting any courses; such a course plan is unfeasible. Detecting circular dependencies can be achieved using a depth-first search (DFS) algorithm. During traversal, nodes on the recursion stack are recorded; if a node is found to be visited repeatedly and still on the current path, a cycle exists.
[0032] If the course dependency graph is a directed acyclic graph (DAG), it means that there exists at least one valid course learning order, i.e., topological sorting. Topological sorting generates a linear sequence of courses, guaranteeing that for any edge (B -> A), course B always appears before course A. An efficient method for implementing topological sorting is the Kahn algorithm, which is based on breadth-first search (BFS) and utilizes the concept of in-degree. The core steps of the algorithm are as follows: First, construct the adjacency list of the graph and calculate the in-degree of each course node (i.e., how many courses directly depend on it); then, add all courses with an in-degree of 0 (i.e., courses without prerequisites) to a queue; next, sequentially remove courses from the queue and decrement the in-degree of all their subsequent courses by 1. If the in-degree of a subsequent course becomes 0 as a result, add it to the queue; finally, if all courses can be removed and learned (the number of completed courses equals the total number of courses), the topological sorting is successful, indicating that all courses can be completed; otherwise, it indicates the existence of a cycle in the graph. This method has a time complexity of O(V+E), where V is the number of courses and E is the number of dependencies, making it very efficient.
[0033] Beyond basic cycle detection and ranking, graph models enable deeper curriculum system analysis. For example, Breadth-First Search (BFS) can calculate the influence of a course—how many courses directly or indirectly depend on it—helping to identify core foundational courses. Furthermore, by calculating the longest path from a course with an in-degree of 0 to the final course in the graph, the minimum number of semesters required to complete all studies can be estimated—a critical path analysis—which is practically significant for curriculum planning and academic progress assessment. In more complex systems, machine learning methods such as network embeddings can be used to automatically mine and deduce potential prerequisite relationships from massive amounts of course description text, thereby constructing large-scale curriculum knowledge graphs to support personalized learning path recommendations.
[0034] The logical dependencies between knowledge points are similar to the prerequisite dependencies between courses mentioned above, and are also a core element in the construction of a knowledge system. They are mainly divided into the following four categories: 1) Progressive relationship One knowledge point is the foundation of another; you must master the former before you can understand the latter. For example, in mathematics, the derivation of theorems requires understanding the definitions and axioms before you can apply the theorems. 2) Relationship Although the knowledge points are not directly dependent on each other, they complement each other. Understanding one helps to deepen the understanding of another, such as the relationship between historical events and cultural background. 3) Organizational relationships (part-whole) In a knowledge base, knowledge points are organized in a hierarchical structure, such as the relationship between chapters and sub-chapter in a subject framework; 4) Logical dependencies (support relationships) There is a logical order between the knowledge points, and they need to be learned in a specific order, such as the dependency order of function calls in programming.
[0035] See Figure 1 and Figure 2 This invention also provides a method for dynamically constructing a two-layer adaptive learning knowledge graph, implemented using the aforementioned two-layer adaptive learning knowledge graph system, comprising the following steps: S1. The system receives the user's input target command and triggers a two-layer workflow; S2. When the input target instruction is a profession, construct a Level 1 macro-level career path map; S3. When a specific course is selected in the Level 1 macro career path map, a Level 2 micro course knowledge map is constructed. S4. Perform bidirectional persistence of mixed data for the Level 1 macro career path graph and the Level 2 micro course knowledge graph, and establish a foreign key association pointing to the Level 1 macro career path graph in the Level 2 micro course knowledge graph directory.
[0036] In this embodiment, in step S1, the two-layer adaptive learning knowledge graph system receives higher-order learning objectives input by the user. The objectives include macro and micro levels, corresponding to career objectives and course objectives, respectively. Based on the objective type (such as the career name "Python Development Engineer" or the course name "Advanced Mathematics"), the application service layer of the system asynchronously triggers the corresponding macro Level 1 or micro Level 2 multi-agent collaborative workflow.
[0037] See Figure 3 In this embodiment, in step S2, a first multi-agent team is invoked for collaboration. This team includes a search agent, a summarizing agent, a planning agent, and a graph construction agent. The process of constructing the Level 1 macro-career path graph, i.e., the L1 graph, is as follows: S2.1 Search agent performs data retrieval: Call the API interface of an external real-time recruitment platform to retrieve multiple original job description texts with earlier update dates related to the entered occupation; S2.2, The abstract agent performs requirement summarization: Based on the deep reasoning ability of the large language model, it extracts unstructured original job description text and outputs a structured list containing core knowledge requirements and skill requirements. S2.3 Planning the intelligent agent for instructional planning: Mapping the structured list to a specific curriculum system, designing prerequisite dependencies between courses, and generating a natural language learning plan that conforms to cognitive laws; S2.4 Graph Construction Agent Performs Structured Transformation: The natural language learning plan is accurately translated into a graph database query language (Cypher script), defined as "Course" nodes and "PRE_REQUISITE_FOR" edges, where nodes represent courses and edges represent prerequisite dependencies between courses.
[0038] See Figure 4 In this embodiment, in step S3, the courses selected in the Level 1 macro-career path graph are used as input to the Level 2 micro-course knowledge graph. A second multi-agent team is invoked for collaboration. This second multi-agent team includes a search agent, a summarizing agent, and a graph construction agent. The process of constructing the Level 2 micro-course knowledge graph, i.e., the L2 graph, is as follows: S3.1 Search agent performs outline retrieval: Call the API of online education platform (such as MOOC) to retrieve the authoritative teaching outline and detailed table of contents corresponding to the selected courses in L1 graph; S3.2, The abstract agent performs knowledge deconstruction: it identifies and extracts core knowledge points across linear outline chapters, infers deep, cross-chapter logical dependencies between knowledge points, and generates knowledge point dependencies. S3.3, Graph Construction Agent Performs Structured Transformation: Convert knowledge point dependencies into graph database query language (Cypher script), defined as "Knowledge" nodes and "PRE_REQUISITE_FOR" edges, where nodes represent knowledge points and edges represent logical dependencies between knowledge points.
[0039] It should be noted that the second multi-agent team does not include a "planning agent" because the micro-knowledge structure is a deterministic extraction based on an authoritative outline, which does not require open creation and avoids the illusion caused by the large model.
[0040] In this embodiment, in step S4, based on the callback function mechanism, the graph attribute metadata generated by the Level 1 macro career path graph (L1 graph) and the Level 2 micro course knowledge graph (L2 graph) are persisted to a relational database (SQLite). At the same time, the generated graph database query language is automatically executed in the background thread of the system to inject the structured graph data, including nodes and edges, into the native graph database (Neo4j). A foreign key association (parent_id) pointing to the L1 graph is established in the L2 graph directory, so that the courses in the L2 graph can be reversed to the corresponding careers in the L1 graph.
[0041] To further verify the feasibility of this method, the present invention will be illustrated with the following practical application examples.
[0042] Example 1: The generation process of Level 1 macro-career path map 1. Task registration and background execution: Users input professional keywords (such as "data scientist") on the front end. The application service layer (FastAPI) generates a globally unique task_id, marks the task type as level1, stores it in a lightweight task queue in memory, and immediately returns the task_id to the front end for polling the status. The system submits the task to the AI engine layer background thread via background_tasks.add_task.
[0043] @app.get(" / create_graph_l1") async def create_graph_l1(keyword: str, background_tasks:BackgroundTasks): # Step 1: Check if the corresponding map or quest for this profession already exists (to prevent duplicate generation) if check_graph_exists(keyword) or check_task_running(keyword): return {"success": False, "message": "Graph or Task already exists"} # Step 2: Generate a globally unique task_id, build a lightweight task manager and store it in an in-memory queue task = TaskManager(id=str(uuid4()), keyword=keyword, type="level1") tasks[task.id] = task # Step 3: Submit to a background thread for asynchronous execution of the Level 1 multi-agent workflow, and attach a double-write callback function (on_update). background_tasks.add_task(run_level1, keyword, task, on_update) # Step 4: Non-blocking design, immediately return task_id for the front-end interface to poll for progress. return {"success": True, "message": "Task started", "task_id":task.id} @app.get(" / create_graph_l1") async def create_graph_l1(keyword: str, background_tasks:BackgroundTasks): # Step 1: Check if the corresponding map or quest for this profession already exists (to prevent duplicate generation) if check_graph_exists(keyword) or check_task_running(keyword): return {"success": False, "message": "Graph or Task already exists"} # Step 2: Generate a globally unique task_id, build a lightweight task manager and store it in an in-memory queue task = TaskManager(id=str(uuid4()), keyword=keyword, type="level1") tasks[task.id] = task # Step 3: Submit to a background thread for asynchronous execution of the Level 1 multi-agent workflow, and attach a double-write callback function (on_update). background_tasks.add_task(run_level1, keyword, task, on_update) # Step 4: Non-blocking design, immediately return task_id for the front-end interface to poll for progress. return {"success": True, "message": "Task started", "task_id":task.id} 2. First Multi-Agent Team (RoundRobinGroupChat) Collaboration Flow: Search Agent: It comes pre-configured with a function tool named get_boss. Upon receiving instructions, it executes crawler logic to retrieve multiple job postings containing the word "data scientist" at the current time.
[0044] Summary Agent: Configures a deep reasoning model (such as deepseek-reasoner). The input is the crawled raw text. Based on the System Message requirements, it extracts high-frequency skill vocabulary (such as Python, machine learning, deep learning) and outputs a structured list of requirements.
[0045] Plan Agent: Acting as a university curriculum designer, the input is a list of requirements. Combining human cognitive patterns, it plans a course sequence from beginner to employment level, and clarifies prerequisite dependencies (e.g., "Calculus" -> "Probability Theory" -> "Machine Learning").
[0046] Graph Agent: The input is the result of a natural language programming exercise. Based on a predefined output format example, it translates the result precisely into a Cypher script. The task terminates when it encounters the termination condition TextMessageTermination("graph").
[0047] async def run_level1(keyword: str, task: TaskManager, on_update:Callable): # Initialize external data source tool: capture real-time job postings boss_tool = FunctionTool(get_boss, description="Query real-time job information") # Arranging four heterogeneous intelligent agents search_agent = AssistantAgent("search", tools=[boss_tool], system_message="Use the get_boss tool to query job information for this profession...") summary_agent = AssistantAgent("summary", system_message="Comprehensively extract job knowledge requirements and output a structured requirements list...") # The core of the L1 architecture: includes a planning agent for creatively planning learning paths. plan_agent = AssistantAgent("plan", system_message="As a course designer, I plan a progressive learning path based on the requirements...") graph_agent = AssistantAgent("graph", system_message="Transform natural language paths into Cypher graph scripts containing Course nodes and relationships...") # Build a polling collaboration group; terminate the dialogue upon encountering text output from a graph agent. team = RoundRobinGroupChat( [search_agent, summary_agent, plan_agent, graph_agent], termination_condition=TextMessageTermination("graph") ) # Execute dialogue tasks in a streaming manner and report intermediate results and final status in real time via callbacks. async for resp in team.run_stream(task=keyword): on_update(resp, task) Example 2: The Generation Process of the Level 2 Micro-course Knowledge Graph 1. Differences between triggers and team orchestration: When a user clicks the "Machine Learning" node in the L1 graph, an L2 generation task is triggered, carrying the parent_id of the L1 graph. The system then starts a second multi-agent team. The key difference from Example 1 is that the second team excludes the PlanAgent.
[0048] 2. Knowledge deconstruction and dependency reorganization: Search Agent: Uses the search_mooc and mooc_info tools to retrieve detailed syllabi (chapters, class hours) of real "Machine Learning" courses from the China University MOOC platform.
[0049] Summary Agent: In-depth analysis of the syllabus. Since the syllabus itself is a mature educational product, there is no need for the Plan Agent to re-plan it. The Summary Agent goes beyond the linear order of chapters, directly extracts core knowledge points (such as "gradient descent" and "loss function"), and autonomously infers the prerequisite relationships across chapters, outputting a natural language structure.
[0050] Graph Agent: Translates this into Cypher scripts that build Knowledge nodes and relationships.
[0051] async def run_level2(keyword: str, task: TaskManager, on_update:Callable): # Initialize external data source tool: scrape the authoritative syllabus of an online education platform (MOOC) mooc_tool = FunctionTool(mooc_info_func, description="Query details of Chinese university MOOC courses") # Orchestrate the L2 agent team (Note: To prevent the illusion of a large model, the Plan Agent is strictly excluded here) search_agent = AssistantAgent("search", tools=[mooc_tool], system_message="Retrieve course resources and obtain detailed syllabus...") summary_agent = AssistantAgent("summary", system_message="Breaking free from the linear constraints of the outline chapters, directly extracting knowledge points and independently deduce the prerequisite relationships across chapters...") graph_agent = AssistantAgent("graph", system_message="Cypher script for building Knowledge nodes and PRE_REQUISITE_FOR relationships...") # Also employs polling-based multi-agent collaboration team = RoundRobinGroupChat( [search_agent, summary_agent, graph_agent], termination_condition=TextMessageTermination("graph") ) async for resp in team.run_stream(task=keyword): on_update(resp, task) Example 3: Hybrid Database Transaction-Level Dual-Write Mechanism (Callback Integration) To ensure consistency between the metadata directory in the relational database and the network structure in the graph database, this invention designs an on_update callback mechanism in the application service layer: 1. When the Graph Agent of the AI engine layer successfully outputs Cypher text, it will call the on_update callback function with the generated content.
[0052] 2. Write to SQLite (relational database): Determine the task type. If it's a level 1 task, instantiate an L1Record object (fields include: id, name, content); if it's a level 2 task, instantiate an L2Record object (fields include: id, parent_id, name, content). Commit to SQLite via SQLAlchemy (SQLModel) transactions, ensuring the generation of the index directory and text backup.
[0053] 3. Write Neo4j (Native Graph Database): Within the same callback function, immediately invoke the encapsulated Neo4j graph database driver (create_database_and_inject_data) to execute the Cypher script described above. Utilize the native graph structure of the graph database to efficiently store the dependency network built from the large model.
[0054] 4. If any of the above steps fail, use relational database transactions to roll back and mark the task_id as failed to prevent dirty data from being generated.
[0055] def on_update(response, task: TaskManager): # Continuously track task results and store them in memory tasks[task.id].results.append(response) # Trigger: The graph-building agent (graph_agent) was detected to have output the final Cypher script code. if response.source == "graph" and response.result_type == "TextMessage": # Start a relational database session (based on SQLAlchemy / SQLModel) and use transactions to ensure atomicity. with Session(engine) as session: try: # Step 1: Write to SQLite (to save map metadata and Cypher text backup) if task.type == "level2": # Record L2-specific foreign key relationships (parent_id) to enable cross-graph reuse. record = L2Record(id=task.id, parent_id=task.parent_id, name=task.keyword, content=response.content) elif task.type == "level1": record = L1Record(id=task.id, name=task.keyword, content=response.content) session.add(record) session.commit() # Transaction commit # Step 2: Write Neo4j (execute the generated script and inject the native graph network relationship topology) # Note: Graph database operations should be performed within the same lifecycle as relational database operations, after the database commit. neo4j.create_database_and_inject_data(database_name=task.id, command=response.content) except Exception as e: If any part of the process fails, the transaction will be rolled back to prevent the spread of stale data. session.rollback() task.status = "failed" This invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the above-described two-layer adaptive learning knowledge graph dynamic construction method.
[0056] This invention also provides a computer device, including a memory and a processor. The memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of the above-described two-layer adaptive learning knowledge graph dynamic construction method.
[0057] This invention also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the steps of the above-described two-layer adaptive learning knowledge graph dynamic construction method.
[0058] It is understood that the system, device and storage medium provided in the embodiments of the present invention correspond to the method provided in the embodiments of the present invention, and the explanation, examples and beneficial effects of the relevant content can be referred to the corresponding parts of the above-described two-layer adaptive learning knowledge graph dynamic construction method.
[0059] It should be noted that those skilled in the art will understand that all or part of the steps implemented in the embodiments of the present invention can be implemented entirely or partially by software, hardware, firmware, or any combination thereof. When implemented in hardware, it can be implemented entirely or partially by purchasing standard parts or modifications. When implemented in software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid state disks (SSDs)).
[0060] In summary, this invention addresses the technical challenges of bloated structures, low query efficiency, and difficulty in cross-domain knowledge reuse in large-scale educational knowledge graphs by providing a two-layer adaptive learning knowledge graph system and dynamic construction method based on multi-agent collaboration. Utilizing Large Language Model (LLM) and multi-agent collaboration technology, it dynamically constructs a two-layer adaptive knowledge graph containing macro-level career course paths and micro-level course knowledge point dependencies. A two-layer graph architecture (macro-level course layer + micro-level knowledge layer) is designed, transforming the traditional static course design, which relies on manual intervention, into a fully automated dynamic planning process driven by real-time employment data.
[0061] It should be understood that the examples and embodiments described herein are for illustrative purposes only and are not intended to limit the invention. Those skilled in the art can make various modifications or changes based on them. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the protection scope of the invention.
Claims
1. A two-layer adaptive learning knowledge graph dynamic construction method, characterized in that, Includes the following steps: S1. Receive user input target instructions and trigger a two-layer workflow; S2. When the input target instruction is a profession, construct a Level 1 macro-level career path map; S3. When a specific course is selected in the Level 1 macro career path map, a Level 2 micro course knowledge map is constructed. S4. Perform bidirectional persistence of mixed data for the Level 1 macro career path graph and the Level 2 micro course knowledge graph, and establish a foreign key association pointing to the Level 1 macro career path graph in the Level 2 micro course knowledge graph directory.
2. The two-layer adaptive learning knowledge graph dynamic construction method as described in claim 1, characterized in that, In S1, higher-order learning objectives input by the user are received. The objectives include macro and micro levels, corresponding to career objectives and course objectives, respectively. Based on the objective type, the application service layer asynchronously triggers the corresponding macro Level 1 or micro Level 2 multi-agent collaborative workflow.
3. The method for dynamic construction of a two-layer adaptive learning knowledge graph as described in claim 1, characterized in that, In S2, the first multi-agent team is invoked for collaboration. This team includes a search agent, a summarizing agent, a planning agent, and a graph construction agent. The process of constructing the Level 1 macro-career path graph is as follows: S2.1 Search agent performs data retrieval: Call the API interface of an external real-time recruitment platform to retrieve multiple original job description texts with earlier update dates related to the entered occupation; S2.2, The abstract agent performs requirement summarization: Based on the deep reasoning ability of the large language model, it extracts unstructured original job description text and outputs a structured list containing core knowledge requirements and skill requirements. S2.3 Planning the intelligent agent for instructional planning: Mapping the structured list to a specific curriculum system, designing prerequisite dependencies between courses, and generating a natural language learning plan that conforms to cognitive laws; S2.4 Graph Construction Agent Performs Structured Transformation: The natural language learning plan is accurately translated into a graph database query language, defined as "Course" nodes and "PRE_REQUISITE_FOR" edges, where nodes represent courses and edges represent prerequisite dependencies between courses.
4. The method for dynamic construction of a two-layer adaptive learning knowledge graph as described in claim 1, characterized in that, In S3, the courses selected in the Level 1 macro-career path graph are used as input to the Level 2 micro-course knowledge graph. A second multi-agent team is invoked for collaboration. This team includes a search agent, a summarizing agent, and a graph construction agent. The process of constructing the Level 2 micro-course knowledge graph is as follows: S3.1 Search agent performs outline retrieval: Call the online education platform API to retrieve the authoritative teaching outline and detailed table of contents corresponding to the selected courses in the Level 1 macro career path map; S3.2, The abstract agent performs knowledge deconstruction: it identifies and extracts core knowledge points across linear outline chapters, infers deep, cross-chapter logical dependencies between knowledge points, and generates knowledge point dependencies. S3.3, Graph Construction Agent performs structured transformation: knowledge point dependencies are converted into graph database query language, defined as "Knowledge" nodes and "PRE_REQUISITE_FOR" edges, where nodes represent knowledge points and edges represent logical dependencies between knowledge points.
5. The method for dynamic construction of a two-layer adaptive learning knowledge graph as described in claim 1, characterized in that, In step S4, based on the callback function mechanism, the graph attribute metadata generated by the Level 1 macro career path graph and the Level 2 micro course knowledge graph are persisted to a relational database. At the same time, the generated graph database query language is automatically executed in the background thread to inject the structured graph data, including nodes and edges, into the native graph database. A foreign key association pointing to the Level 1 macro career path graph is established in the Level 2 micro course knowledge graph directory, so that the courses in the Level 2 micro course knowledge graph can be reversed to the corresponding occupations in the Level 1 macro career path graph.
6. A two-layer adaptive learning knowledge graph system, applicable to the dynamic construction method of a two-layer adaptive learning knowledge graph as described in any one of claims 1-5, characterized in that, include: The AI engine layer is based on the AutoGen framework and encapsulates the client to directly interact with the deep inference large language model. It is configured with a first multi-agent team and a second multi-agent team with different System Messages and Function Tools. The AI engine layer adopts a polling group dialogue mode to orchestrate collaboration. A hybrid data persistence layer, connected to the AI engine layer, includes a relational database and a native graph database. The relational database stores graph attribute metadata of the Level 1 macro career path graph and the Level 2 micro course knowledge graph. The native graph database stores structured graph data of the Level 1 macro career path graph and the Level 2 micro course knowledge graph, and isolates the two levels of graphs through node labels in the structured graph data. The presentation layer, which serves as the front-end interface, is built on React and connected to the hybrid data persistence layer. It is used to retrieve data from the back-end and provide users with an intuitive knowledge graph visualization and interactive interface. The application service layer, which serves as the backend service framework, interacts with the three layers mentioned above to manage, process, invoke, and distribute data.
7. The two-layer adaptive learning knowledge graph dynamic construction system as described in claim 6, characterized in that, In the AI engine layer, both the first multi-agent team and the second multi-agent team include a search agent, a summary agent, and a graph construction agent. The first multi-agent team also includes a planning agent.
8. The two-layer adaptive learning knowledge graph dynamic construction system as described in claim 6, characterized in that, In the hybrid data persistence layer, in the structured graph data generated by the graph database query language of the Level 1 macro career path graph, node labels are defined as courses, and edge labels are the prerequisite dependencies between courses. In the structured graph data generated by the graph database query language of the Level 2 micro course knowledge graph, node labels are defined as knowledge points, and edge labels are the logical dependencies between knowledge points.
9. A computer device, characterized in that, It includes a memory and a processor, the memory storing a computer program, which, when executed by the processor, causes the processor to perform the steps of the two-layer adaptive learning knowledge graph dynamic construction method as described in any one of claims 1-5.
