Intelligent question answering system based on large language model and knowledge base
By combining a large language model with a dynamic knowledge base, the defect of traditional question-answering systems in being unable to cope with complex open-domain problems is solved, and a personalized, multimodal and efficient question-answering system with rapid response and personalized adaptation capabilities is realized.
Patent Information
- Application Number
- CN202510469947.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-15
- Publication Date
- 2025-09-12
AI Technical Summary
Traditional question-answering systems rely on rule engines or simple retrieval technologies, which are unable to cope with complex, open-domain question-answering needs, and information lags can lead to misleading information.
It uses a large language model module for text parsing and deep semantic intent recognition, combines it with a dynamic knowledge base for real-time cross-validation, generates answers through multi-level text analysis and attention mechanisms, and supports multi-round dialogue and feedback mechanisms.
It achieves accurate and personalized answers to complex open domain questions, avoids misleading information delays, supports multimodal output and personalized adaptation, and has millisecond-level response capabilities.
Smart Images

Figure CN120632014A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence application technology, and more specifically, to an intelligent question-answering system based on a large language model and a knowledge base. Background Art
[0002] In the information age, quickly obtaining accurate information has become a basic need in people's daily lives and work. With the rapid development of the Internet, massive amounts of data and information are exploding. However, as the diversity and complexity of information increase, the challenges users face are becoming increasingly severe.
[0003] In recent years, the rapid development of artificial intelligence, especially natural language processing technology, has provided new possibilities for the construction of intelligent question-answering systems. Large language models have the ability to understand and generate natural language, and can simulate the way human conversations interact with users. At the same time, knowledge bases, as important data sources for decision support, can provide structured and reliable information and provide accurate answers to user queries.
[0004] However, it still has some shortcomings in actual use. For example, traditional question-answering systems mainly rely on rule engines or simple retrieval technologies. Their capabilities are limited by predefined rules and static knowledge bases, making it difficult to cope with complex and open-domain question-answering needs. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides an intelligent question-answering system based on a large language model and a knowledge base to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] Large language model module: used to receive natural language questions input by users and generate preliminary answers or related context;
[0008] Knowledge base module: used to build a knowledge base to store structured domain knowledge;
[0009] Retrieval and matching module: used to retrieve information related to user questions from the knowledge base and match and fuse it with the preliminary answers generated by the large language model;
[0010] Answer generation module: Generates the final answer based on the retrieved knowledge and the output of the large language model and returns it to the user;
[0011] User interaction module: used to receive user input and display the answers generated by the system, supporting multi-round dialogue and feedback mechanism.
[0012] Preferably, the large language model module, as the core processing unit of the intelligent question-answering system, extracts key entities and identifies deep semantic intent through multi-level text parsing technology based on the pre-trained large-scale language model Qwen-Plus; the module calls the internal reasoning engine and generates preliminary answers or context frames in combination with pre-trained knowledge;
[0013] Multi-level text analysis techniques include word segmentation, syntactic analysis, and attention mechanisms;
[0014] Perform word segmentation on the input text to extract key entities; construct a dependency tree through syntactic analysis to identify the main structure of the question; use the attention mechanism to calculate the correlation weight between word vectors to capture deep semantic intent;
[0015] The module introduces a dynamic knowledge collaboration mechanism, connects to the structured knowledge base in real time, and cross-validates and supplements the generated content through semantic matching and embedded retrieval based on graph neural networks;
[0016] For example, when answering the question "What is the latest vaccination guide for the new coronavirus vaccine?", the module searches the knowledge base for the latest policy documents issued by authoritative agencies, and dynamically corrects key information such as vaccination intervals and contraindications to avoid misleading due to data lags.
[0017] Preferably, the method for constructing the knowledge base module includes preparing the knowledge base content, designing the knowledge base structure, uploading to the knowledge base management platform, testing the knowledge base, and deploying and maintaining the knowledge base;
[0018] The specific methods for preparing knowledge base content are:
[0019] The first step in building a knowledge base is to clarify its scope and content. The core content of the knowledge base should be determined based on the industry background and business needs of the company's overseas expansion. Data sources include internal company documents, market research reports, industry white papers, and legal and regulatory documents. Subsequently, the data should be cleaned and pre-processed to remove duplicate, invalid, and outdated data, and categorized and labeled. Documents in different formats, such as PDF, Word, and Excel, should be uniformly converted to text format. Typical cases of companies going overseas should be collected to form a case library.
[0020] Among them, industry background includes target market, laws and regulations, and cultural differences; business needs include market development, supply chain management, and customer service;
[0021] The specific method for designing the knowledge base structure is:
[0022] Categorize the knowledge base based on business needs, such as "market analysis," "laws and regulations," "cultural differences," and "business operation guidelines." Each category is further divided into subcategories. For example, "market analysis" might include "economic environment" and "consumer behavior." Each subcategory contains specific knowledge items, such as "economic environment" might include "GDP growth rate" and "inflation rate." Design relationships between knowledge items, such as the association between "market analysis" and "laws and regulations," and construct a knowledge graph to intuitively display the relationships between knowledge items using a graph structure.
[0023] The specific method of uploading to the knowledge base management platform is:
[0024] Select the FastGPT knowledge base management platform and configure the platform's classification, labeling, and permission settings based on the knowledge base structure; import cleaned and preprocessed data into the platform in batches, and manually enter and proofread small amounts of data or data in special formats; configure the platform's retrieval algorithm, keyword retrieval, and category browsing retrieval methods, and design the user interface.
[0025] The specific method of testing the knowledge base is:
[0026] Before the knowledge base is officially put into use, comprehensive testing is carried out; functional testing includes verification of retrieval functions, associations, and multi-language support to ensure that users can quickly and accurately find the information they need; user experience testing is carried out by inviting internal employees or external users to try out the system, collecting feedback and fixing problems; performance testing focuses on the response speed and stability of the knowledge base to ensure that it can still quickly respond to user requests under high concurrency conditions and remain stable during long-term operation.
[0027] Preferably, in the retrieval and matching module, the user question is converted into a high-dimensional semantic vector, and the vector is generated through an encoder model;
[0028] Then, the inverted index is used to quickly locate the knowledge items containing the core entities, and the cosine similarity between the user question vector and the knowledge base items is calculated using a vector database (such as FAISS and Milvus). The top k pieces of knowledge with a similarity higher than a threshold are retained. For graph structure retrieval, multi-hop reasoning is performed using the Cypher query language.
[0029] Preferably, in the answer generation module, after retrieving relevant knowledge, the module semantically aligns the preliminary answer generated by the large language model with the retrieved knowledge base entry and assigns weights through an attention mechanism;
[0030] α i =softmax(a T ·[q;d i ]), where α iIt is represented as a scalar value, which represents the normalized weight or probability among all knowledge items; a is represented as a learnable parameter, q is represented as a semantic vector, and d i is represented as a knowledge entry vector and T is represented as its transpose.
[0031] Preferably, in the user interaction module, the generated answers are output in a multimodal form: the text content is displayed in logical segments, and supports embedding flowcharts, data charts or hyperlinks, while providing a voice broadcast function to meet the needs of different scenarios.
[0032] In multi-round dialogues, the module tracks the dialogue history through the memory network to ensure contextual coherence;
[0033] For example, when a user consecutively asks "Brazil customs clearance documents" and "Is a certificate of origin required?", the system automatically links the preceding questions and generates a precise response: "Yes, a certificate of origin is one of the required documents, along with a commercial invoice and packing list." Users can provide instant feedback on the quality of the answer using the "Helpful / Not Helpful" button or submit detailed correction suggestions.
[0034] The retrieval and fusion strategies are dynamically optimized through user feedback data. If the user marks the answer inaccurately, the question-answer pair is added to the reinforcement learning buffer, and the retrieval and fusion strategies are optimized through policy gradient.
[0035] Technical effects and advantages of the present invention:
[0036] The intelligent question-answering system of the present invention is based on the pre-trained large-scale language model Qwen-Plus, which can receive natural language questions and generate preliminary answers; the system parses text through word segmentation, syntactic analysis and attention mechanism, and introduces a dynamic knowledge collaboration mechanism to connect to the structured knowledge base in real time for cross-validation; the knowledge base is constructed from internal corporate documents, market research, etc., and is uploaded to the management platform after cleaning and pre-processing, and deployed after comprehensive testing; user questions are converted into semantic vectors, relevant knowledge items are quickly located and similarities are calculated; the output of the large language model and the retrieved knowledge are integrated to generate the final answer; multiple rounds of dialogue and feedback mechanism are supported, answers are output in a multimodal form, and personalized adaptation is based on user portraits and geographic locations; the present invention generates answers based on real-time interaction between the large language model and the knowledge base, combining pre-trained knowledge and structured data, which can meet the question-answering needs of complex open domains, and can also provide personalized answers, automatically adapting to the needs and contexts of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 Schematic diagram of module connection of the present invention. DETAILED DESCRIPTION
[0038] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0039] See also Figure 1 As shown, the present invention provides an intelligent question-answering system based on a large language model and a knowledge base, which includes: a large language model module, a knowledge base module, a retrieval and matching module, an answer generation module, and a user interaction module.
[0040] Large language model module: used to receive natural language questions input by users and generate preliminary answers or related context;
[0041] In the large language model module, as the core processing unit of the intelligent question-answering system, the large language model module extracts key entities and identifies deep semantic intent through multi-level text parsing technology based on the pre-trained large-scale language model Qwen-Plus; the module calls the internal reasoning engine and combines pre-trained knowledge to generate preliminary answers or context frames;
[0042] Multi-level text analysis techniques include word segmentation, syntactic analysis, and attention mechanisms;
[0043] The input text is segmented and key entities are extracted. A dependency tree is constructed through syntactic analysis to identify the main structure of the question. The attention mechanism is used to calculate the correlation weights between word vectors to capture deep semantic intent. The specific method for calculating semantic relevance is as follows:
[0044] Among them, A(B, K, V) represents the semantic relevance, B represents the query vector, K represents the key vector, V represents the value vector, and z k Dimensions expressed as a vector;
[0045] The module introduces a dynamic knowledge collaboration mechanism, connects to the structured knowledge base in real time, and cross-validates and supplements the generated content through semantic matching and embedded retrieval based on graph neural networks;
[0046] For example, when answering the question "What are the latest vaccination guidelines for the new coronavirus vaccine?", the module searches the knowledge base for the latest policy documents issued by authoritative organizations and dynamically corrects key information such as vaccination intervals and contraindications to avoid misleading information due to data lags.
[0047] The module supports multimodal context perception, integrating historical conversation records, user profiles, and environmental information for personalized generation. For example, in response to the consecutive questions "Dietary taboos for diabetics" and "Can mangoes be eaten?", the module tracks the conversation state through the memory network and generates differentiated suggestions based on the blood sugar data in the user's health record. At the same time, the module has an embedded security and ethics control layer and uses reinforcement learning alignment technology to constrain the generated content.
[0048] For example, it can automatically filter out sensitive information involving privacy and avoid factual contradictions through logical consistency detection algorithms.
[0049] In terms of performance, the module achieves millisecond-level response through a distributed computing framework and supports lightweight deployment, adapting to diverse scenarios from cloud servers to edge devices. The module builds a "generate-verify-optimize" closed loop. After user feedback data is desensitized, the model parameters are dynamically updated through the online learning pipeline to continuously improve domain adaptability.
[0050] Knowledge base module: used to build a knowledge base to store structured domain knowledge;
[0051] The knowledge base module, the method of constructing a knowledge base includes preparing knowledge base content, designing knowledge base structure, uploading to the knowledge base management platform, testing the knowledge base, and knowledge base deployment and maintenance;
[0052] The specific methods for preparing knowledge base content are:
[0053] The first step in building a knowledge base is to clarify its scope and content. The core content of the knowledge base should be determined based on the industry background and business needs of the company's overseas expansion. Data sources include internal company documents, market research reports, industry white papers, and legal and regulatory documents. Subsequently, the data should be cleaned and pre-processed to remove duplicate, invalid, and outdated data, and categorized and labeled. Documents in different formats, such as PDF, Word, and Excel, should be uniformly converted to text format. Typical cases of companies going overseas should be collected to form a case library.
[0054] Among them, industry background includes target market, laws and regulations, and cultural differences; business needs include market development, supply chain management, and customer service;
[0055] The specific method for designing the knowledge base structure is:
[0056] Categorize the knowledge base based on business needs, such as "market analysis," "laws and regulations," "cultural differences," and "business operation guidelines." Each category is further divided into subcategories. For example, "market analysis" might include "economic environment" and "consumer behavior." Each subcategory contains specific knowledge items, such as "economic environment" might include "GDP growth rate" and "inflation rate." Design relationships between knowledge items, such as the association between "market analysis" and "laws and regulations," and construct a knowledge graph to intuitively display the relationships between knowledge items using a graph structure.
[0057] The specific method of uploading to the knowledge base management platform is:
[0058] Select the FastGPT knowledge base management platform and configure the platform's categories, tags, and permission settings based on the knowledge base structure; import cleaned and preprocessed data into the platform in batches, and manually enter and proofread small amounts of data or data in special formats; configure the platform's retrieval algorithm, keyword retrieval, and category browsing retrieval methods, and design the user interface.
[0059] The specific method of testing the knowledge base is:
[0060] Before the knowledge base is officially put into use, comprehensive testing is carried out; functional testing includes verification of retrieval functions, associations, and multi-language support to ensure that users can quickly and accurately find the information they need; user experience testing is carried out by inviting internal employees or external users to try out the system, collecting feedback and fixing problems; performance testing focuses on the response speed and stability of the knowledge base to ensure that it can still quickly respond to user requests under high concurrency conditions and remain stable during long-term operation.
[0061] The specific methods for knowledge base deployment and maintenance are as follows:
[0062] During the knowledge base deployment phase, the knowledge base is deployed to the enterprise's internal server or cloud platform, and access permissions are configured so that users with different roles can only access content within their permissions. Knowledge base maintenance includes regular content updates, user training, and issue tracking. By analyzing user usage data, the structure and content of the knowledge base are optimized, and as technology develops, the technical architecture of the knowledge base is regularly upgraded.
[0063] Retrieval and matching module: used to retrieve information related to user questions from the knowledge base and match and fuse it with the preliminary answers generated by the large language model;
[0064] In the retrieval and matching module, the user question is converted into a high-dimensional semantic vector, and the vector is generated through the encoder model. The specific method for calculating the semantic vector is:
[0065] q=Encoder query(Q), where q represents a semantic vector, Encoder represents a neural network module, and Q represents user input text;
[0066] Then, the inverted index is used to quickly locate the knowledge items containing the core entities, and the cosine similarity between the user question vector and the knowledge base items is calculated using a vector database (such as FAISS or Milvus). The specific method for calculating the cosine similarity between the user question vector and the knowledge base items is as follows:
[0067] Among them, Score(Q,D i ) is represented by the cosine similarity between the user question and the knowledge base entry, q is represented by the semantic vector, and d i Represented as a knowledge item vector;
[0068] The top k pieces of knowledge with similarity higher than a threshold are retained; for graph structure retrieval, multi-hop reasoning is performed using the Cypher query language.
[0069] Answer generation module: Generates the final answer based on the retrieved knowledge and the output of the large language model and returns it to the user;
[0070] In the answer generation module, after retrieving relevant knowledge, the module semantically aligns the preliminary answer generated by the large language model with the retrieved knowledge base entries and assigns weights through the attention mechanism;
[0071] α i =softmax(a T ·[q;d i ]), where α i It is represented as a scalar value, which represents the normalized weight or probability among all knowledge items; a is represented as a learnable parameter, q is represented as a semantic vector, and d i It is represented as a knowledge item vector, and T is represented as the transpose;
[0072] In dynamic fusion, a gating mechanism is used to determine the fusion ratio. The calculation method of the fusion weight is as follows:
[0073] β=σ(W·[q;a gen ]), where β represents the fusion weight, σ represents the Sigmoid function, and a gen Generate the semantic vector of the answer, q is represented as the semantic vector; the final answer is generated by weighting the generated answer and the retrieved knowledge.
[0074] User interaction module: used to receive user input and display the answers generated by the system, supporting multi-round dialogue and feedback mechanism;
[0075] In the user interaction module, the generated answers are output in a multimodal form: the text content is displayed in logical segments, and supports embedding flowcharts, data charts or hyperlinks, while providing voice broadcast function to meet the needs of different scenarios.
[0076] In multi-round dialogues, the module tracks the dialogue history through the memory network to ensure contextual coherence;
[0077] For example, when a user consecutively asks "Brazil customs clearance documents" and "Is a certificate of origin required?", the system automatically links the preceding questions and generates a precise response: "Yes, a certificate of origin is one of the required documents, along with a commercial invoice and packing list." Users can provide instant feedback on the quality of the answer using the "Helpful / Not Helpful" button or submit detailed correction suggestions.
[0078] The retrieval and fusion strategies are dynamically optimized using user feedback data. If the user marks an inaccurate answer, the question-answer pair is added to the reinforcement learning buffer, and the retrieval and fusion strategies are optimized using policy gradients. The gradient calculation method is as follows:
[0079] in, Expressed as the gradient of the objective function j, It is expressed as the expected value, R(f) is expressed as the reward function based on user feedback; P(f|Q) is expressed as the probability of behavior f given the query Q; Expressed as the partial derivative of parameter θ;
[0080] The module supports personalized adaptation, adjusts the professional depth of answers according to user portraits, and automatically switches language versions based on geographic location; it achieves millisecond-level response through asynchronous loading and caching technologies (such as Redis), and adopts a plug-in architecture to be compatible with third-party services.
[0081] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An intelligent question-answering system based on a large language model and a knowledge base, characterized by: include: Large language model module: used to receive natural language questions input by users and generate preliminary answers or related context; Knowledge base module: used to build a knowledge base to store structured domain knowledge; Retrieval and matching module: used to retrieve information related to user questions from the knowledge base and match and fuse it with the preliminary answers generated by the large language model; Answer generation module: Generates the final answer based on the retrieved knowledge and the output of the large language model and returns it to the user; User interaction module: used to receive user input and display the answers generated by the system, supporting multi-round dialogue and feedback mechanism.
2. The intelligent question-answering system based on a large language model and a knowledge base according to claim 1, characterized in that: In the large language model module, the large language model module serves as the core processing unit of the intelligent question-answering system. Based on the pre-trained large-scale language model Qwen-Plus, it extracts key entities and identifies deep semantic intent through multi-level text parsing technology; the module calls the internal reasoning engine and combines pre-trained knowledge to generate preliminary answers or context frameworks.
3. The intelligent question-answering system based on a large language model and a knowledge base according to claim 2, characterized in that: The input text is segmented and key entities are extracted. A dependency tree is constructed through syntactic analysis to identify the main structure of the question. The attention mechanism is used to calculate the correlation weights between word vectors to capture deep semantic intent. The specific method for calculating semantic relevance is as follows: Among them, A(B, K, V) represents the semantic relevance, B represents the query vector, K represents the key vector, V represents the value vector, and z k Dimensions represented as a vector.
4. The intelligent question-answering system based on a large language model and a knowledge base according to claim 1, characterized in that: The knowledge base module, the method of constructing a knowledge base includes preparing knowledge base content, designing knowledge base structure, uploading to the knowledge base management platform, testing the knowledge base, and knowledge base deployment and maintenance; The specific methods for preparing knowledge base content are: The first step in building a knowledge base is to clarify its scope and content. The core content of the knowledge base should be determined based on the company's industry background and business needs for overseas expansion. Data sources include internal company documents, market research reports, industry white papers, and legal and regulatory documents. Subsequently, the data is cleaned and pre-processed to remove duplicate, invalid, and outdated data, and the data is classified and labeled. Documents in different formats, such as PDF, Word, and Excel, are uniformly converted into text format. Typical cases of companies going global are collected to form a case library. The specific method for designing the knowledge base structure is: The knowledge base is classified according to business needs. Each category is further divided into subcategories. Each subcategory contains specific knowledge items. The relationship between knowledge items is designed, and a knowledge graph is constructed to intuitively display the relationship between knowledge in a graph structure.
5. The intelligent question-answering system based on a large language model and a knowledge base according to claim 4, characterized in that: The specific method of uploading to the knowledge base management platform is: Select the FastGPT knowledge base management platform and configure the platform's categories, tags, and permissions based on the knowledge base structure; import cleaned and pre-processed data into the platform in batches, and manually enter and proofread small amounts of data or data in special formats; configure the platform's search algorithms, keyword search, and category browsing search methods, and design the user interface; The specific method of testing the knowledge base is: Before the knowledge base is officially put into use, comprehensive testing is carried out; functional testing includes verification of retrieval functions, associations, and multi-language support to ensure that users can quickly and accurately find the information they need; user experience testing is carried out by inviting internal employees or external users to try out the system, collecting feedback and fixing problems; performance testing focuses on the response speed and stability of the knowledge base to ensure that it can still quickly respond to user requests under high concurrency conditions and remain stable during long-term operation.
6. The intelligent question-answering system based on a large language model and a knowledge base according to claim 1, characterized in that: In the retrieval and matching module, the user question is converted into a high-dimensional semantic vector, and the vector is generated through the encoder model. The specific method for calculating the semantic vector is: q=Encoder query (Q), where q represents a semantic vector, Encoder represents a neural network module, and Q represents user input text; Then, the inverted index is used to quickly locate the knowledge items containing the core entities, and the cosine similarity between the user question vector and the knowledge base items is calculated using a vector database (such as FAISS or Milvus). The specific method for calculating the cosine similarity between the user question vector and the knowledge base items is as follows: Among them, Score(Q,D i ) is represented by the cosine similarity between the user question and the knowledge base entry, q is represented by the semantic vector, and d i Represented as a knowledge item vector; The top k pieces of knowledge with similarity higher than a threshold are retained; for graph structure retrieval, multi-hop reasoning is performed using the Cypher query language.
7. The intelligent question-answering system based on a large language model and a knowledge base according to claim 1, characterized in that: In the answer generation module, after retrieving relevant knowledge, the module semantically aligns the preliminary answer generated by the large language model with the retrieved knowledge base entries and assigns weights through the attention mechanism; α i =softmax(a T ·[q;d i ]), where α i It is represented as a scalar value, which represents the normalized weight or probability among all knowledge items; a is represented as a learnable parameter, q is represented as a semantic vector, and d i is represented as a knowledge entry vector and T is represented as its transpose.
8. The intelligent question-answering system based on a large language model and a knowledge base according to claim 1, characterized in that: In the user interaction module, the generated answers are output in a multimodal form: the text content is displayed in logical segments, and supports embedding flowcharts, data charts or hyperlinks, while providing voice broadcast function; The retrieval and fusion strategies are dynamically optimized using user feedback data. If the user marks an inaccurate answer, the question-answer pair is added to the reinforcement learning buffer, and the retrieval and fusion strategies are optimized using policy gradients. The gradient calculation method is as follows: in, Expressed as the gradient of the objective function j, It is expressed as the expected value, R(f) is expressed as the reward function based on user feedback; P(f|Q) is expressed as the probability of behavior f given the query Q; is expressed as the partial derivative of the parameter θ.
Citation Information
Cited By
Content closed-loop interaction system based on large language model
CN120851150A
Content closed-loop interaction system based on large language model
CN120851150B
Question and answer method and device, equipment, medium and program product
CN121456083A
Voice large model question answering method based on retrieval enhancement generation
CN121483257A
Large model optimization method and system based on context engineering in futures field
CN121937227A