Method for building private domain teaching intelligent question-answering system based on retrieval enhancement generation architecture

By building an intelligent question-and-answer system based on search enhancement generation architecture in private domain teaching scenarios, the shortcomings of the existing system in accurately distinguishing problem focus, knowledge base management and personalized feedback are solved, and efficient and accurate knowledge retrieval and personalized teaching support are achieved.

CN119990317APending Publication Date: 2025-05-13CHANGZHOU COLLEGE OF INFORMATION TECHNOLOGY +2
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510071695.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

The existing intelligent question-and-answer system is difficult to accurately distinguish the focus of the problem in private domain teaching scenarios. The knowledge base management is not meticulous enough, the retrieval efficiency and accuracy need to be improved, and it is impossible to effectively use multi-source teaching materials for personalized feedback.

Method used

Using a private domain teaching intelligent question-and-answer system based on the search enhancement generation architecture, a multi-level classification knowledge base is built by building the FastGPT question-and-answer core components, Ollama local large language model library and One API model access gateway, and a multi-level classification knowledge base is built, and a FastGPT workflow orchestration is implemented to achieve problem classification, knowledge base search and AI question-and-answer modules.

Benefits of technology

It realizes accurate understanding and classification of student problems, optimizes the construction and management of the knowledge base, improves the efficiency and accuracy of knowledge retrieval, provides personalized feedback on teaching information, and improves teaching efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119990317A_ABST
    Figure CN119990317A_ABST
Patent Text Reader

Abstract

A method for building a private domain teaching intelligent question-answering system based on a retrieval enhancement generation architecture comprises the following steps: building a FastGPT question-answering core component, an Oplama local large language model library and an One API model access gateway, and then implanting a GLM4 model and a nomic-embedded-text model into the Oplama; and the configuration of the Ollan model library is realized in the One API, and a local model is accessed. Creating a knowledge base in FastGPT, and respectively defining knowledge bases corresponding to concept principles and practical operations by referring to a multi-level classification mode; a question and answer workflow is defined by taking courses as units in FastGPT, and a question classification module, a knowledge base retrieval module and an AI question and answer module are defined respectively. Professional and rapid solutions are provided for students, the students are helped to obtain accurate knowledge in a short time, understanding of principles and concepts is deepened, problems in practical operation are solved, and improvement of teaching quality is promoted.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent question-answering systems, and in particular to a method for building a private domain teaching intelligent question-answering system based on a retrieval-augmented generation (RAG) architecture. Background Art

[0002] In private domain teaching, with the continuous enrichment of teaching content, knowledge acquisition and communication efficiency have become bottlenecks, and traditional manual question-answering methods are difficult to meet the growing needs of students. The development of large model technology has led to the rise of intelligent question-answering systems, but existing systems still have many problems in the application of private domain teaching scenarios. For example, for students in the computer field, it is difficult to accurately distinguish the focus when answering principle concept-based and practical operation-based questions, and provide answers that meet students' needs. At the same time, the construction and management of the knowledge base is not detailed enough, the retrieval efficiency and accuracy need to be improved, and it is impossible to effectively use multi-source teaching material knowledge, teachers' professional background knowledge, and students' learning process knowledge for personalized feedback. In addition, in the process of interacting with users, the system lacks an effective multi-round dialogue and feedback loop mechanism, making it difficult to gradually optimize answers and improve user experience. Summary of the invention

[0003] The present invention provides a method for building a private domain teaching intelligent question and answer system based on a retrieval enhanced generation architecture, and distributes FastGPT and supporting MongoDB and PgSQL in a container virtual environment in the private domain teaching field. Build the Ollama local large language model library and implant the GLM4 and nomic-embed-text models. With the help of One API, FastGPT is connected to the model library provided by Ollama. A private domain teaching knowledge base is constructed with the help of multi-level classification. The question and answer session is constructed by FastGPT workflow data arrangement, which includes a question classification module, a knowledge base search module, and an AI dialogue module. Finally, the external system can interact with the intelligent question and answer system through the database and HttpAPI respectively.

[0004] A method for building a private domain teaching intelligent question-answering system based on a retrieval-enhanced generation architecture comprises the following steps:

[0005] Step S1: Private domain teaching system construction: Build the FastGPT question-answering core component, Ollama local large language model library, and One API model access gateway respectively, and then implant the GLM4 model and nomic-embed-text model in Ollama to realize the use of localized models;

[0006] Step S2: Build a multi-level classification knowledge base: Configure the Ollama model library in OneAPI and connect to the local model. After completing the above operations, create a knowledge base in FastGPT, and define the knowledge base corresponding to the concept principle and practical operation respectively according to the multi-level classification method;

[0007] Step S3: Implement intelligent question-and-answer session based on FastGPT workflow orchestration: In FastGPT, define the question-and-answer workflow based on courses, and define the question classification module, knowledge base retrieval module, and AI question-and-answer module respectively to implement intelligent question-and-answer of user questions.

[0008] Furthermore, the construction of the private domain teaching system in step S1 of the present invention specifically includes:

[0009] Step S11, building a container network based on Docker container technology, including the FastGPT container as the core component of the private domain teaching intelligent question-answering system. This container also includes MongoDB and PgSQL databases in the container network to achieve persistent storage of the database;

[0010] Step S12, building the Ollama local large language model framework component in a process manner, and introducing the GLM4 model and the nomic-embed-text model in the framework component in a localized manner; the GLM4 model is used for answer generation, and the nomic-embed-text model is used for understanding the knowledge base and questions;

[0011] Step S13, build the OneAPI gateway that matches FastGPT, and configure the large language model to access the Ollama component in the OneAPI gateway. On this basis, configure FastGPT to connect with the OneAPI gateway, and finally realize that FastGPT can use the local large language model in Ollama.

[0012] Furthermore, step S2 of the present invention of constructing a multi-level classification knowledge base specifically includes:

[0013] Step S21, construct a private domain teaching knowledge base, classify the knowledge base into two types: concept principles and practical operations in a multi-level classification manner, and construct a knowledge base for each type in a targeted manner, where the concept principles include the electronic teaching material knowledge base, the courseware material knowledge base, and the knowledge acceptance knowledge base, and the practical operations include the training manual knowledge base, the historical answer knowledge base, and the operation wrong question collection knowledge base; with the help of the nomic-embed-text model, the text in the knowledge base is divided into blocks and stored in the database in the form of vectors to prepare for the subsequent question and answer session.

[0014] Furthermore, the intelligent question-answering process is realized based on the FastGPT workflow arrangement in step S3 of the present invention, which specifically includes:

[0015] Step S31, check the FastGPT question-answering framework, the Ollama local model framework component, and the multi-level classified private domain teaching knowledge base to verify whether the construction is successful; construct the question-answering link through the FastGPT workflow data arrangement method, and introduce the corresponding models and knowledge bases in different modules; the modules include question classification module, knowledge base retrieval module, and AI dialogue module;

[0016] Step S32, design and implement a question classification module in workflow arrangement. When a user asks a question, the question will first enter the question classification module. By introducing the GLM4 model, the user's question is identified and classified into concept principles and practical operations;

[0017] Step S33, design and implement the knowledge base retrieval module in the workflow arrangement. After classifying the user's questions, the module will enter the knowledge base retrieval module; the questions are classified into two types: conceptual principles and practical operations. With the help of the nomic-embed-text model, the user's questions are first vectorized, and then the retriever provided by the module obtains the knowledge content of the knowledge base close to the question through vector similarity calculation;

[0018] Step S34, design and implement the AI ​​dialogue module in the workflow arrangement. After completing the knowledge base search in step S33, enter the AI ​​question-answering phase, use the GLM4 large language model, combine the results of the knowledge base search, and generate answers to user questions through corresponding answer templates;

[0019] Step S35, design and implement the interaction between the intelligent question-answering system and the external system, and open up the channel for the external system to access the question-answering system through the HTTP interface and database; after the question-answering link is built, the external system will interact with the MongoDB and PgSQL databases in the FastGPT question-answering framework; first, the user's questions will be saved in the form of vectors in PgSQL for knowledge base retrieval and answer generation; at the same time, with the help of FastGPT's API, the external system can interact with FastGPT through the HTTP interface;

[0020] Step S36, construct a knowledge base iterative update mechanism. In order to achieve the real-time and accuracy of data in private domain teaching, the system uses a large language model to continuously update and retrieve knowledge base content to improve the accuracy of answer generation in the AI ​​question and answer module.

[0021] The present invention adopts the above technical solution and has the following advantages compared with the prior art:

[0022] 1. Improve teaching efficiency and quality: Provide students with professional and fast answers to help them acquire accurate knowledge in a short time, deepen their understanding of principles and concepts, and solve problems in practical operations, thereby improving learning outcomes, optimizing the allocation of teaching resources, and promoting the improvement of teaching quality.

[0023] 2. Break through the limitations of time and space: Students can obtain learning support through the intelligent question-and-answer system anytime and anywhere, without being restricted by time and space, and achieve independent and personalized learning.

[0024] 3. Optimize knowledge base management: The multi-level classification and circular optimization of the knowledge base construction method makes knowledge management more systematic and efficient, ensuring that the knowledge base always contains the latest and most relevant teaching knowledge, providing a solid foundation for accurate answers.

[0025] 4. Personalized learning support: Integrate multi-source knowledge to achieve personalized teaching information feedback, meet the learning styles and progress requirements of different students, and improve students' enthusiasm and initiative in learning.

[0026] 5. Promote the intelligent development of private-domain teaching: Provide technical support and innovative impetus for the intelligent development of private-domain teaching, and promote innovation and transformation of education and teaching models. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 It is a schematic diagram of the construction process of the private domain teaching intelligent question-answering system of the present invention.

[0028] Figure 2 This is an example diagram of the architecture of the intelligent question-answering mechanism for private domain teaching of the present invention.

[0029] Figure 3 This is an example diagram of the course knowledge base structure of the present invention.

[0030] Figure 4 This is an example diagram of the actual FastGPT knowledge base content.

[0031] Figure 5 It is a schematic diagram of an example of the effect after understanding through the model in the actual knowledge base of the present invention.

[0032] Figure 6 It is a schematic diagram of the question-answering workflow implementation mechanism based on FastGPT of the present invention.

[0033] Figure 7 It is a schematic diagram of the actual workflow implementation mechanism of the present invention based on FastGPT.

[0034] Figure 8 This is an example diagram that specifies the cyclic update and understanding of a single knowledge base.

[0035] Fig. 9This is an example diagram of the smart question and answer for the conceptual principle question "What is the role of hash algorithm in blockchain?"

[0036] Fig.10 This is an example diagram of the smart question and answer for the practical operation question "How to use Python to implement the hash algorithm".

[0037] Fig.11 This is an example diagram of AI question and answer for the complex operational practice problem "Using Python to build the simplest blockchain system". DETAILED DESCRIPTION

[0038] A method for building a private domain teaching intelligent question-answering system based on a retrieval-enhanced generation architecture comprises the following steps:

[0039] Step S1: Private domain teaching system construction: Build FastGPT question-answering core components, Ollama local large language model library and One API model access gateway respectively, and then implant GLM4 model and nomic-embed-text model in Ollama to realize the use of localized model. Specifically include:

[0040] Step S11, building a container network based on Docker container technology, including the FastGPT container as the core component of the private domain teaching intelligent question-answering system. This container also includes MongoDB and PgSQL databases in the container network to achieve persistent storage of the database;

[0041] Step S12, building the Ollama local large language model framework component in a process manner, and introducing the GLM4 model and the nomic-embed-text model in the framework component in a localized manner; the GLM4 model is used for answer generation, and the nomic-embed-text model is used for understanding the knowledge base and questions;

[0042] Step S13, build the OneAPI gateway that matches FastGPT, and configure the large language model to access the Ollama component in the OneAPI gateway. On this basis, configure FastGPT to connect with the OneAPI gateway, and finally realize that FastGPT can use the local large language model in Ollama.

[0043] Step S2: Build a multi-level classification knowledge base: Configure the Ollama model library in OneAPI and access the local model. After completing the above operations, create a knowledge base in FastGPT, and define the concept principle and practical operation corresponding knowledge base respectively according to the multi-level classification method. Specifically include:

[0044] Build a private domain teaching knowledge base, classify the knowledge base into two types: concept principles and practical operations in a multi-level classification manner, and build a targeted knowledge base for each type. The concept principles include the electronic textbook knowledge base, the courseware material knowledge base, and the knowledge acceptance knowledge base. The practical operations include the training manual knowledge base, the historical question answering knowledge base, and the operation wrong question collection knowledge base. With the help of the nomic-embed-text model, the text in the knowledge base is divided into blocks and stored in the database in the form of vectors to prepare for the subsequent question-and-answer session.

[0045] Step S3: Implement intelligent question-answering based on FastGPT workflow arrangement: Define the question-answering workflow in units of courses in FastGPT, and define the question classification module, knowledge base retrieval module, and AI question-answering module to implement intelligent question-answering of user questions. Specifically, it includes:

[0046] Step S31, check the FastGPT question-answering framework, the Ollama local model framework component, and the multi-level classified private domain teaching knowledge base to verify whether the construction is successful; construct the question-answering link through the FastGPT workflow data arrangement method, and introduce the corresponding models and knowledge bases in different modules; the modules include question classification module, knowledge base retrieval module, and AI dialogue module;

[0047] Step S32, design and implement a question classification module in workflow arrangement. When a user asks a question, the question will first enter the question classification module. By introducing the GLM4 model, the user's question is identified and classified into concept principles and practical operations;

[0048] Step S33, design and implement the knowledge base retrieval module in the workflow arrangement. After classifying the user's questions, the module will enter the knowledge base retrieval module; the questions are classified into two types: conceptual principles and practical operations. With the help of the nomic-embed-text model, the user's questions are first vectorized, and then the retriever provided by the module obtains the knowledge content of the knowledge base close to the question through vector similarity calculation;

[0049] Step S34, design and implement the AI ​​dialogue module in the workflow arrangement. After completing the knowledge base search in step S33, enter the AI ​​question-answering phase, use the GLM4 large language model, combine the results of the knowledge base search, and generate answers to user questions through corresponding answer templates;

[0050] Step S35, design and implement the interaction between the intelligent question-answering system and the external system, and open up the channel for the external system to access the question-answering system through the HTTP interface and database; after the question-answering link is built, the external system will interact with the MongoDB and PgSQL databases in the FastGPT question-answering framework; first, the user's questions will be saved in the form of vectors in PgSQL for knowledge base retrieval and answer generation; at the same time, with the help of FastGPT's API, the external system can interact with FastGPT through the HTTP interface;

[0051] Step S36, construct a knowledge base iterative update mechanism. In order to achieve the real-time and accuracy of data in private domain teaching, the system uses a large language model to continuously update and retrieve knowledge base content to improve the accuracy of answer generation in the AI ​​question and answer module.

[0052] like Figure 1 As shown, the system building process of the present invention is given. First, the FastGPT question-answering core components, the Ollama local large language model library, and the OneAPI model access gateway are respectively built, and then the GLM4 model and the nomic-embed-text model are implanted in Ollama to realize the use of the localized model. The configuration of the Ollama model library is implemented in One API, and the local model is accessed. After completing the above operations, a knowledge base is created in FastGPT, and the conceptual principles and practical operation corresponding knowledge bases are defined respectively with reference to the multi-level classification method. Finally, the question-answering workflow is defined in FastGPT in units of courses, and the question classification module, knowledge base retrieval module, and AI question-answering module are defined respectively to realize intelligent question-answering of user questions.

[0053] Figure 2 The specific architecture after the system is developed is shown in which FastGPT, as the core component of intelligent question answering, uses MongoDB and PgSQL for persistent data message storage (corresponding to step S11). External systems can interact with FastGPT through HTTP or directly access the database to obtain messages (corresponding to step S35). Since FastGPT itself does not have the functions of question recognition and answer generation, it needs to use a large language model. Here, the local large language model library Ollama is accessed through One API (corresponding to step S13), and the GLM series model and the Embedding series model (the specified model used by the system here is GLM4 and nomic-embed-text model) are added to the Ollama model in advance (corresponding to step S12).

[0054] The introduction to the construction of the multi-level classification knowledge base for step S31 is as follows: After detailed practical research, it is known that the problems generated by students in the process of seeking knowledge in the computer field can be mainly divided into principle concept problems and practical operation problems, and for these two different types of problems, the key points emphasized in answering are significantly different.

[0055] For principle-based questions, the key focus of the answers is on the students' thorough understanding of the course knowledge points. For example, when learning the basics of computer programming, students should not only remember the definitions of concepts such as data types, variables, and operators, but also understand how they are stored in memory, their scope of action, and the conversion rules between different data types. When faced with multiple-choice questions such as determining the attribution of data types, analyzing the scope of variables in programs, or short-answer questions to explain certain programming concepts, it is particularly important for students to have a deep understanding of these principle concepts. Practical operation questions mainly focus on the various practical difficulties and challenges encountered by students in the actual process of writing program codes. For example, when using Python language to practice data analysis projects, students may encounter practical operation problems such as how to correctly import and process data files, how to use appropriate data structures to store and operate data, how to use functions and methods in the data analysis library to achieve specific analysis goals, and how to solve various errors that occur during code execution.

[0056] Based on the above analysis of the types of questions, we started to build a multi-level classification knowledge base. First, in the knowledge structure, there are principle concept category and practical operation category. Under the principle concept category, we added a material knowledge base including electronic textbooks, courseware, and knowledge extension. Under the practical operation category, we added a knowledge base including training manuals, historical answering process, and wrong question collection. For each course, the specific corresponding knowledge base is as follows: Figure 3 Corresponding knowledge base classification and corresponding functions. Figure 4 An example of an actual FastGPT knowledge base. Figure 5 This is the effect after the model is understood in the actual knowledge base.

[0057] Based on the FastGPT workflow orchestration, the specific introduction is as follows: In FastGPT, a question-answering mechanism is constructed in the form of a workflow, which includes a question classification module, a knowledge base retrieval module, and an AI question-answering module (step S31). When a user asks a question, the question classification module will first use the GLM4 model to identify and classify the question (step S32), and then enter the corresponding knowledge base retrieval module in the workflow (step S33). After the corresponding data of the knowledge base is retrieved through the retriever, it enters the AI ​​dialogue module and generates an answer through a large language model (step S34). Figure 6 Implementing mechanisms for FastGPT-based question-answering workflows. Figure 7For the actual workflow implementation based on FastGPT.

[0058] The knowledge base cyclic iteration update mechanism is constructed for step S36, which is specifically developed as follows: In order to improve the accuracy of the system's questions and answers, the system constructs a knowledge base update and understanding mechanism. With the help of a large language model, the knowledge base text is reprocessed and updated after the data is updated. Figure 8 Loop through updates and understanding examples for a given single knowledge base.

[0059] Figures 9 to 11 This is an example diagram of the Q&A interaction for conceptual and practical questions: Taking the "Principles of Blockchain Technology" course as an example, it shows the system's Q&A process and results when dealing with conceptual and practical questions (such as "The role of hash algorithms in blockchain") and practical questions (such as "How to use Python to implement hash algorithms" and "Use Python to build the simplest blockchain system"), reflecting the actual application effect of the system.

[0060] .FastGPT is a typical question-and-answer framework based on the RAG architecture. The core invention of the present invention is to use FastGPT and its supporting MongoDB and PgSQL in a container virtual environment in the field of private domain teaching. Build the Ollama local large language model library and implant the GLM4 and nomic-embed-text models. With the help of OneAPI, FastGPT is connected to the model library provided by Ollama. Construct a private domain teaching knowledge base with the help of multi-level classification. The question-and-answer session is constructed by FastGPT workflow data arrangement, which includes question classification module, knowledge base search module, and AI dialogue module. Finally, the external system can interact with the intelligent question-and-answer system through database and HttpAPI respectively.

[0061] The method for building a private domain teaching intelligent question-answering system based on a retrieval-enhanced generation architecture of the present invention includes two parts. The first part is to build the intelligent question-answering system, and the second part is to configure the FastGPT core component after the intelligent question-answering system is built. Because FastGPT is a question-answering system based on a large language model, the purpose of the configuration is to enable FastGPT to read the local knowledge base and adapt to the application scenario of intelligent question-answering in the field of private domain teaching. The technical core of the present invention is:

[0062] 1. FastGPT combined with the local construction of the Ollama large model framework can be used in private domain teaching scenarios (that is, offline scenarios).

[0063] 2. A solution to build a multi-level classification knowledge base using FastGPT to support knowledge retrieval for building a private domain teaching question-and-answer system.

[0064] 3. Use FastGPT to implement the core link of intelligent question answering through workflow orchestration.

[0065] The private domain teaching intelligent question-answering system based on the RAG architecture constructed by the construction method of the present invention can solve the following problems:

[0066] 1. Accurately understand and classify problems: Accurately identify the types of students' questions (principle concept type or practical operation type, etc.), provide a basis for subsequent targeted answers, and solve the problem that the existing system is difficult to distinguish the focus of the problem.

[0067] 2. Optimize knowledge base construction and management: Build a multi-level classified knowledge base, integrate multi-source teaching materials, and improve the systematicness and pertinence of the knowledge base; at the same time, optimize the update and iteration mechanism of the knowledge base to ensure the timeliness and accuracy of knowledge and improve the poor construction and management of the existing knowledge base.

[0068] 3. Improve knowledge retrieval efficiency and accuracy: By improving retrieval models and algorithms, combining semantic retrieval and rich retrieval strategies, the speed and accuracy of obtaining relevant information from the knowledge base can be improved, overcoming the current shortcomings of low retrieval efficiency and accuracy.

[0069] 4. Achieve efficient multi-round dialogue and feedback loop: Establish an effective multi-round dialogue and feedback loop mechanism so that the system can optimize the answer based on each round of user feedback, improve user experience, and make up for the shortcomings of the existing system in interaction optimization.

[0070] 5. Enhance the system's personalized teaching support capabilities: Comprehensively consider teachers' professional background knowledge and students' learning history knowledge to provide students with more personalized teaching information feedback, meet the learning needs of different students, and solve the problem of insufficient personalized support in the current system.

[0071] The technical solution of the present invention is described in detail below in conjunction with embodiments:

[0072] 1. Data acquisition, module parameters and prompt word settings

[0073] 1.1 Data Acquisition

[0074] Blockchain Technology Application Major (major code: 510212) is a new major established in higher vocational colleges in 2021. Changzhou Information Vocational and Technical College is the only school in Jiangsu Province that has applied for this major. After the construction of majors and courses from 2021 to 2024, it has initially accumulated relatively complete course implementation data. However, due to the relative lack of online resources related to the teaching of blockchain technology application majors in higher vocational colleges and the tendency to mislead, the use of intelligent question-answering systems can effectively alleviate such problems. Therefore, this professional course is selected as the application object. Figure 2The knowledge base construction methods shown are respectively built around professional core courses. The specific knowledge base construction information is shown in Table 1:

[0075] Table 1 Example of knowledge base for core courses in blockchain technology application major

[0076]

[0077] Note: The ○ in the above table indicates that the course provides corresponding knowledge base data support

[0078] 1.2 Module parameters and prompt word settings

[0079] In terms of module parameters, according to the data flow arrangement settings of the intelligent question-answering system, it includes question classification module, knowledge base indexing module and AI dialogue module. In the knowledge base retrieval module, semantic retrieval is used for the concept principle and practical operation knowledge base search modes, and the upper limit of a single search is set to 1500 and 2200 respectively, and the minimum similarity threshold is set to 0.9 and 0.65 respectively. In the AI ​​dialogue module, the GLM4 model is used for document generation, with a maximum of 125,000 tokens for a small text, a reply token upper limit of 8,000, and a temperature coefficient of 3 for relative rigor, and the longest historical record is 9.

[0080] In terms of prompt word settings, the question classification module and the AI ​​dialogue module will be involved. Among them, the question classification module needs to support two basic standards: context understanding and fuzzy matching, to ensure that the prompt words can cover a variety of expressions that users may use. For keywords that may have multiple interpretations, set fuzzy matching rules so that the system can more flexibly identify question categories. Table 3-2 is an example of setting the problem classification for the blockchain technology principle course. In the AI ​​dialogue module, when FastGPT references the knowledge base, a reference template will be used to design prompt words, where the reference template definition integrates the content in the knowledge base into the content of the AI ​​answer. Table 2 has an example of setting prompt words for the blockchain technology principle AI question and answer module.

[0081] Table 2 Example of prompt word settings for question classification module & AI question answering module

[0082]

[0083] The purpose of setting the prompt words of the question RefFen module in Table 2 is to determine the type of user questions through guidance, so that the specified type of knowledge base can be referenced and the corresponding AI question-answering module can be entered. In the AI ​​question-answering module, user questions are processed through a specific format. When a user asks a question "{{question}}", AI first identifies the question ("{{q}}") and uses it as an instruction to search for relevant information in the latest knowledge base. The searched background knowledge "{{quote}}" is used to construct a rigorous and accurate answer ("{{a}}"), which is then provided to the user as output. Throughout the conversation, the model follows three requirements: give priority to using background knowledge to answer questions to ensure the rigor of the content; if the background knowledge is not enough to answer the question, the AI ​​model will politely inform the user; and throughout the communication, the AI ​​model aims to provide accuracy and reliability in teaching support.

[0084] 2. Intelligent Question and Answer Application Example

[0085] Taking the core course "Principles of Blockchain Technology" as an example, we verified the intelligent question-answering system's answering of two types of questions: conceptual principles and practical operations. Starting from the course-related knowledge point "Role and implementation of hash algorithm in blockchain", we asked conceptual questions about "the role of hash algorithm in blockchain" and practical questions about "how to use Python to implement hash algorithm". Fig. 9 For concept and principle question and answer situations, when the user enters a question, the AI ​​question and answer will search the concept and principle knowledge base and then give the corresponding answer.

[0086] In practical operation questions and answers, when the user enters a question, the AI ​​question and answer module will provide a principle introduction after searching the knowledge base, and then give the code required for the question based on the content understood in the knowledge base, such as Fig.10 Shown is an application example of the practical problem "How to implement hash algorithm using Python".

[0087] In the course of blockchain technology principles, some skill points are relatively complex, such as "realizing blockchain functions by building a system". This type of practical operation question requires the question-answering system to search and understand the specified knowledge base and give a relatively accurate answer in the AI ​​question-answering module, such as Fig.11 In the question-and-answer process of "Using Python to build the simplest blockchain system", the AI ​​module will understand and give answers based on the standard code of the corresponding textbook after searching according to the specified knowledge base.

Claims

1. A method for building a private domain teaching intelligent question-answering system based on a retrieval-enhanced generation architecture, characterized in that The steps include: Step S1: Private domain teaching system construction: Build the FastGPT question-answering core component, Ollama local large language model library, and One API model access gateway respectively, and then implant the GLM4 model and nomic-embed-text model in Ollama to realize the use of localized models; Step S2: Build a multi-level classification knowledge base: Configure the Ollama model library in OneAPI and connect to the local model. After completing the above operations, create a knowledge base in FastGPT, and define the knowledge base corresponding to the concept principle and practical operation respectively according to the multi-level classification method; Step S3: Implement intelligent question-and-answer session based on FastGPT workflow orchestration: In FastGPT, define the question-and-answer workflow based on courses, and define the question classification module, knowledge base retrieval module, and AI question-and-answer module respectively to implement intelligent question-and-answer of user questions.

2. The method for building a private domain teaching intelligent question-answering system based on a retrieval enhancement generation architecture according to claim 1 is characterized in that The private domain teaching system construction of the above step S1 specifically includes: Step S11, building a container network based on Docker container technology, including the FastGPT container as the core component of the private domain teaching intelligent question-answering system. This container also includes MongoDB and PgSQL databases in the container network to achieve persistent storage of the database; Step S12, building the Ollama local large language model framework component in a process manner, and introducing the GLM4 model and the nomic-embed-text model in the framework component in a localized manner; the GLM4 model is used for answer generation, and the nomic-embed-text model is used for understanding the knowledge base and questions; Step S13, build the OneAPI gateway that matches FastGPT, and configure the large language model to access the Ollama component in the OneAPI gateway. On this basis, configure FastGPT to connect with the OneAPI gateway, and finally realize that FastGPT can use the local large language model in Ollama.

3. The method for building a private domain teaching intelligent question-answering system based on a retrieval enhancement generation architecture according to claim 2 is characterized in that The construction of a multi-level classification knowledge base in step S2 above specifically includes: Step S21, construct a private domain teaching knowledge base, classify the knowledge base into two types: concept principles and practical operations in a multi-level classification manner, and construct a knowledge base for each type in a targeted manner, where the concept principles include the electronic teaching material knowledge base, the courseware material knowledge base, and the knowledge acceptance knowledge base, and the practical operations include the training manual knowledge base, the historical answer knowledge base, and the operation wrong question collection knowledge base; with the help of the nomic-embed-text model, the text in the knowledge base is divided into blocks and stored in the database in the form of vectors to prepare for the subsequent question and answer session.

4. The method for building a private domain teaching intelligent question-answering system based on a retrieval enhancement generation architecture according to claim 3 is characterized in that The above step S3 implements the intelligent question-answering process based on FastGPT workflow orchestration, which specifically includes: Step S31, check the FastGPT question-answering framework, the Ollama local model framework component, and the multi-level classified private domain teaching knowledge base to verify whether the construction is successful; construct the question-answering link through the FastGPT workflow data arrangement method, and introduce the corresponding models and knowledge bases in different modules; the modules include question classification module, knowledge base retrieval module, and AI dialogue module; Step S32, design and implement a question classification module in workflow arrangement. When a user asks a question, the question will first enter the question classification module. By introducing the GLM4 model, the user's question is identified and classified into concept principles and practical operations; Step S33, design and implement the knowledge base retrieval module in the workflow arrangement. After classifying the user's questions, the module will enter the knowledge base retrieval module; the questions are classified into two types: conceptual principles and practical operations. With the help of the nomic-embed-text model, the user's questions are first vectorized, and then the retriever provided by the module obtains the knowledge content of the knowledge base close to the question through vector similarity calculation; Step S34, design and implement the AI ​​dialogue module in the workflow arrangement. After completing the knowledge base search in step S33, enter the AI ​​question-answering phase, use the GLM4 large language model, combine the results of the knowledge base search, and generate answers to user questions through corresponding answer templates; Step S35, design and implement the interaction between the intelligent question-answering system and the external system, and open up the channel for the external system to access the question-answering system through the HTTP interface and database; after the question-answering link is built, the external system will interact with the MongoDB and PgSQL databases in the FastGPT question-answering framework; first, the user's questions will be saved in the form of vectors in PgSQL for knowledge base retrieval and answer generation; at the same time, with the help of FastGPT's API, the external system can interact with FastGPT through the HTTP interface; Step S36, construct a knowledge base iterative update mechanism. In order to achieve the real-time and accuracy of data in private domain teaching, the system uses a large language model to continuously update and retrieve knowledge base content to improve the accuracy of answer generation in the AI ​​question and answer module.

Citation Information

Cited By

  • Free text report processing method and system for nasopharynx cancer case information

    CN120874762A