Intelligent question answering method, system and device based on retrieval enhancement generation

By combining graph databases and pre-trained large models in an intelligent question-answering system to enhance retrieval and generation methods, the problem of inaccurate answers is solved, resulting in more accurate and interpretable answer generation and improved user experience.

CN121833893APending Publication Date: 2026-04-10ULTRAPOWER SOFTWARE
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems suffer from inaccurate answers and failure to meet user needs. In particular, retrieval-based systems cannot provide innovative or inductive answers, while generation-based systems suffer from the illusion problem of generating answers that do not conform to the facts.

Method used

A retrieval-enhanced generation method is adopted. By receiving and parsing user questions, sub-questions and retrieval elements are determined. Triple retrieval is performed using a graph database, and a structured knowledge list is input into a pre-trained large model to generate answers. A distributed file storage system is combined to improve the accuracy and fluency of the answers.

Benefits of technology

It significantly improves the accuracy of answers and user experience, reduces the illusion of large model generation, and ensures the reliability and interpretability of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121833893A_ABST
    Figure CN121833893A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent question answering method, system and device based on retrieval enhancement generation, and the method comprises the steps: receiving and analyzing a natural language question proposed by a user, and determining at least one sub-question covered by the natural language question and a corresponding retrieval element; generating a retrieval statement corresponding to the at least one sub-question based on the retrieval element corresponding to the at least one sub-question; the retrieval statement is used for performing single-hop retrieval, multi-hop retrieval and / or multi-condition composite retrieval in the graph database; performing triple retrieval in the target graph database by utilizing the retrieval statement corresponding to the at least one sub-question to obtain a structured knowledge list; wherein the target graph database is one of a plurality of graph databases; and inputting the at least one sub-question and the corresponding structured knowledge list into a pre-trained large model to obtain an answer corresponding to the natural language question. Based on the method, the graph database triple can be injected into the large model in real time, large model illusion is reduced, and the accuracy and user experience are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of natural language processing, artificial intelligence, knowledge graphs and intelligent question answering systems, and in particular to an intelligent question answering method, system and device based on retrieval enhancement generation. Background Technology

[0002] With the rapid development of artificial intelligence and big data technologies, intelligent question-answering systems have been widely applied in various fields such as customer service, personalized assistants, online education, and medical consultation. Traditional intelligent question-answering technologies can generate answers based on two methods: retrieval-based and generation-based.

[0003] Currently, retrieval-based intelligent question-answering systems can efficiently return highly relevant existing answers, but they can only return answers directly based on existing knowledge and cannot provide innovative or inductive answers. Generative intelligent question-answering systems can dynamically generate answers based on the input question, but they often suffer from the "illusion problem" where the generated answers do not match the facts. It is clear that existing intelligent question-answering systems suffer from inaccurate answers and fail to meet user needs. Summary of the Invention

[0004] This application provides a method, system, and apparatus for intelligent question answering based on retrieval enhancement, in order to solve the problems of inaccurate answers and inability to meet user needs in existing intelligent question answering systems.

[0005] In a first aspect, embodiments of this application provide an intelligent question-answering method based on retrieval enhancement, applied to electronic devices. The method includes: receiving and parsing a natural language question raised by a user; determining at least one sub-question covered by the natural language question and its corresponding retrieval elements; the retrieval elements include one or more combinations of entity information, attribute information, and relation information corresponding to the sub-question; generating a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to the at least one sub-question; the retrieval statement is used to perform single-hop retrieval, multi-hop retrieval, and / or multi-condition compound retrieval in a graph database; performing triplet retrieval in a target graph database using the retrieval statement corresponding to the at least one sub-question to obtain a structured knowledge list; wherein the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; and inputting the at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer corresponding to the natural language question.

[0006] In one possible implementation, generating a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to at least one sub-question includes: mapping entity information to vertex labels of a graph database, mapping attribute information to attribute keys of a graph database, and / or mapping relation information to edge labels of a graph database; determining the retrieval intent based on vertex labels, attribute keys, and / or edge labels; planning a retrieval path based on the retrieval intent; and generating a retrieval statement corresponding to the retrieval path.

[0007] In one possible implementation, planning the retrieval path based on the retrieval intent includes: when the retrieval intent is a single-hop relation retrieval, the retrieval path is determined as follows: starting from the starting vertex corresponding to the vertex label, a single-step traversal is performed along the association relationship determined by the edge label to determine the destination vertex; when the retrieval intent is a single-hop attribute retrieval, the retrieval path is determined as follows: performing an attribute query on the starting vertex based on the attribute key to determine the attribute value of the starting vertex.

[0008] In one possible implementation, planning the retrieval path based on the retrieval intent further includes: when the retrieval intent is a multi-hop retrieval, using a preset graph algorithm to determine the retrieval path as follows: starting from the starting vertex corresponding to the vertex label, traversing along the specific relationship determined by the edge label until the termination condition is met; the termination condition includes reaching a specified number of hops or reaching a destination vertex of a specific type; when the retrieval intent is a multi-condition composite retrieval, using a preset graph algorithm and logical operation functions to determine the retrieval path as follows: starting from the starting vertex corresponding to the vertex label, traversing along the specific relationship determined by the edge label and the target filtering condition until the termination condition is met; the target filtering condition is generated by combining the attribute values ​​corresponding to the attribute keys using logical operation functions, which include one or more of the following: AND function, OR function, and NOT function.

[0009] In one possible implementation, inputting at least one sub-problem and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language question includes: for each sub-problem, concatenating the sub-problem and its corresponding structured knowledge list according to a preset template to form the first input data for each sub-problem; when there is only one sub-problem, inputting the first input data for that sub-problem into the pre-trained large model to obtain an answer fragment; wherein the pre-trained large model is used to generate output results based on a knowledge base, which includes a graph database and / or a distributed file storage system; when there are multiple sub-problems, inputting the first input data for each sub-problem into the pre-trained large model in rounds to obtain the answer fragment for each sub-problem; wherein each round inputs the first input data for the current sub-problem and the generated results of all previous rounds.

[0010] In one possible implementation, when there are multiple sub-questions, after the step of inputting the first input data corresponding to each sub-question into the pre-trained large model in rounds to obtain the answer fragment corresponding to each sub-question, the method further includes: generating target prompt words based on a preset prompt word template; wherein, the target prompt words are used to guide the pre-trained large model to concatenate the answer fragments, and / or to guide the pre-trained large model to add source information to the generated answers; the source information includes at least entity relationship data involved in the generated answers, and the entity relationship data is source graph data generated by entity information, relationship information and / or attribute information involved in the generated answers; the target prompt words, each sub-question and its corresponding answer fragment are input into the pre-trained large model to obtain the answer corresponding to the natural language question.

[0011] In one possible implementation, receiving and parsing a natural language question submitted by a user, and determining at least one sub-question and corresponding retrieval elements covered by the natural language question, includes: receiving the natural language question and inputting it into a semantic understanding big model to obtain at least one sub-question covered by the natural language question; wherein the semantic understanding big model is used to perform semantic understanding and question decomposition on the natural language question; and determining the retrieval elements corresponding to at least one sub-question.

[0012] In one possible implementation, a triplet retrieval is performed in the target graph database using retrieval statements corresponding to at least one sub-problem to obtain a structured knowledge list. This includes: sending a retrieval communication command to the gateway device so that the gateway device allocates the target graph database based on a round-robin, preset weight, or load balancing strategy; calling the retrieval interface of the target graph database through the gateway device, passing the retrieval statement to the retrieval interface to perform triplet retrieval, thereby obtaining multiple triplet knowledge items; and integrating the triplet knowledge into a structured knowledge list.

[0013] Secondly, embodiments of this application provide an intelligent question-answering system based on retrieval enhancement generation. The intelligent question-answering system includes at least a pre-trained large model and a controller; the controller is communicatively connected to the pre-trained large model; the controller is configured to execute the intelligent question-answering method based on retrieval enhancement generation in the aforementioned first aspect and its various implementations.

[0014] Thirdly, embodiments of this application provide an intelligent question-answering device based on retrieval enhancement generation. The device includes: a parsing module configured to: receive and parse a natural language question raised by a user, and determine at least one sub-question covered by the natural language question and its corresponding retrieval elements; the retrieval elements include one or more combinations of entity information, attribute information, and relation information corresponding to the sub-question; a statement generation module configured to: generate a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to at least one sub-question; the retrieval statement is used for single-hop retrieval, multi-hop retrieval, and / or multi-condition compound retrieval in a graph database; an enhanced retrieval module configured to: perform triplet retrieval in a target graph database using the retrieval statement corresponding to at least one sub-question to obtain a structured knowledge list; wherein, the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; and an answer generation module configured to: input at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer corresponding to the natural language question.

[0015] As described above, this application provides an intelligent question-answering method, system, and apparatus based on retrieval enhancement. The method includes: receiving and parsing a natural language question from a user; determining at least one sub-question covered by the natural language question and its corresponding retrieval elements; the retrieval elements include one or more combinations of entity information, attribute information, and relational information corresponding to the sub-question; generating a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to the at least one sub-question; the retrieval statement is used for single-hop retrieval, multi-hop retrieval, and / or multi-condition composite retrieval in a graph database; performing triple retrieval in a target graph database using the retrieval statement corresponding to the at least one sub-question to obtain a structured knowledge list; wherein the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; and inputting the at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language question. Based on this method, graph database triples can be injected into a large model in real time, reducing the illusion of a large model and significantly improving accuracy and user experience. Attached Figure Description

[0016] Figure 1 This is a schematic diagram of a first structure of an intelligent question-answering system based on retrieval enhancement provided in an embodiment of this application; Figure 2 A flowchart illustrating the intelligent question-answering method based on retrieval enhancement provided in this application embodiment; Figure 3 A schematic diagram of the knowledge graph provided in the embodiments of this application; Figure 4 for Figure 3 Corresponding source map data; Figure 5 A schematic diagram of a user interface provided in an embodiment of this application; Figure 6 This is a schematic diagram of a second structure of an intelligent question-answering system based on retrieval enhancement provided in an embodiment of this application; Figure 7 This is a schematic diagram of the structure of an intelligent question-answering device based on retrieval enhancement provided in an embodiment of this application. Detailed Implementation

[0017] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of this application.

[0018] Before introducing the technical solutions of the embodiments of this application, the terminology involved in the embodiments of this application will be introduced by way of example.

[0019] 1. Retrieval-Augmented Generation (RAG): An artificial intelligence technology that integrates "external knowledge retrieval" and "large model generation".

[0020] 2. Graph Database: A database that stores and manages graph structure data of "entity-relationship-entity triples". It uses vertices (representing entities), edges (representing relations) and attributes (describing the characteristics of entities / relationships) as core storage units and can be used to handle complex relationship scenarios such as multi-hop association queries and path analysis.

[0021] To address the issues of inaccurate answers and inability to meet user needs in existing intelligent question-answering systems, this application provides an intelligent question-answering method and apparatus based on retrieval enhancement. This method can retrieve structured knowledge from graph databases, fuse the obtained entity-relationship-attribute triples with the user's question, and input them into a pre-trained large model. This allows the generated answer to retain the accuracy of the graph structure while possessing the fluency of natural language, significantly reducing illusions and improving user satisfaction.

[0022] Figure 1 This is a schematic diagram of the first structure of an intelligent question-answering system based on retrieval enhancement provided in an embodiment of this application.

[0023] like Figure 1As shown, the intelligent question-answering system provided in this application embodiment may include a user interaction module 1001, a knowledge graph storage and management module 1002, a structured retrieval module 1003, an information enhancement generation module 1004, and an answer output module 1005. The user interaction module 1001 can provide a user interface, which may include interactive elements such as text input boxes, dialogue display areas, and function selection areas. The user interaction module 1001 can receive natural language questions from users, enabling user interaction. The structured retrieval module 1003 can use the HugeGraph graph database to store various domain knowledge, managing data in the form of "vertex (entity)-edge (relationship)-attribute (feature)" triples. It also supports distributed cluster deployment and JuiceFS object storage collaboration to ensure high-concurrency retrieval and dynamic knowledge maintenance. The information enhancement generation module 1004 can map the entities, relationships, and attributes parsed from user questions to vertex labels, edge labels, and attribute keys in the graph database, then determine the retrieval intent, plan the retrieval path, and finally generate a retrieval statement to execute the triple retrieval and obtain a structured knowledge list. The information enhancement generation module 1004 integrates the knowledge list obtained by the structured retrieval module with the user's question. The input is based on a pre-trained large model, and through knowledge embedding encoding, the model generates answers based on real knowledge, avoiding "illusions" in the large model. The answer output module 1005 is used to return the generated answer to the user, and supports multi-turn dialogue context association. It can also be used to display answer tracing information.

[0024] Furthermore, the intelligent question-answering system can be deployed on electronic devices, which can be servers, edge computing nodes, or cloud-based GPU clusters. This application embodiment does not specifically limit this.

[0025] Figure 2 This is a flowchart illustrating the intelligent question-answering method based on retrieval enhancement provided in an embodiment of this application.

[0026] like Figure 2 As shown, this application provides an intelligent question-answering method based on retrieval enhancement, which can be applied to electronic devices and may specifically include the following steps S100-S400.

[0027] S100: Receive and parse the natural language question submitted by the user, and determine at least one sub-question covered by the natural language question and the corresponding search elements; the search elements include one or more combinations of entity information, attribute information and relation information corresponding to the sub-question.

[0028] This step receives natural language questions from users, performs deep analysis using Natural Language Processing (NLP), identifies at least one sub-question within the question, and extracts key retrieval elements for each sub-question. It's worth noting that these retrieval elements are used for searching within a structured knowledge base and include, but are not limited to: entity information (such as specific people, objects, or organizations), attribute information (such as specific characteristics or parameters of an entity), and relationship information (such as the ways entities are related).

[0029] It should also be noted that a natural language problem may consist of only one subproblem, which can be determined by parsing, cleaning, and extracting the natural language problem. A natural language problem can also be parsed into multiple interrelated subproblems.

[0030] For example, a natural language question like "Which departments involved in Contract A had employees who joined in 2023?" can be broken down into sub-questions such as "Which departments are involved in Contract A?" and "Which departments had employees who joined in 2023?", ensuring that each sub-question focuses on a single search objective.

[0031] Furthermore, through extraction operations, entity information such as contract A, department, and employee can be identified; attribute information such as joining in 2023; and relationship information such as involving or belonging to can be identified.

[0032] S200: Generate a search statement corresponding to at least one sub-question based on the search elements corresponding to at least one sub-question; the search statement is used to perform single-hop search, multi-hop search and / or multi-condition compound search in the graph database.

[0033] It is worth noting that the embodiments of this application can construct a knowledge base, which includes at least multiple graph databases. Each graph database is deployed on different servers, forming a homogeneous cluster node, and the storage structure remains the same (such as unified vertex labels, edge labels, and attribute key schema definitions). Furthermore, the graph databases can store knowledge graphs from multiple domains or scenarios.

[0034] It should also be noted that the retrieval statements generated in this step should be fully compatible with the query syntax supported by the graph database (such as the Gremlin syntax adapted by HugeGraph) to ensure that the retrieval statements can be legally executed in the target graph database and avoid retrieval failures due to syntax incompatibility.

[0035] Furthermore, this step can specifically involve planning the search path by retrieving elements, and then generating the corresponding statement for the path. The specific generation steps will be detailed below and will not be repeated here.

[0036] S300: Use the retrieval statement corresponding to at least one sub-problem to perform a triplet retrieval in the target graph database to obtain a structured knowledge list; wherein, the target graph database is one of multiple graph databases.

[0037] It is worth noting that this application embodiment can deploy a multi-graph database cluster, and distribute query requests to different graph database nodes according to load balancing strategies (such as round-robin, weighted allocation, or real-time load monitoring), significantly reducing single-point latency and improving concurrent retrieval efficiency and horizontal scalability. Therefore, this application embodiment can trigger the graph database allocation step through the retrieval operation, that is, determine a target graph database from multiple graph databases.

[0038] It should also be noted that graph databases can serve as knowledge bases for large models, providing structured "entity-relationship-attribute" triple knowledge for large models.

[0039] In addition, embodiments of this application can also configure a distributed file storage system (such as JuiceFS) to form a collaborative storage architecture with a graph database: the graph database can be used to store the relationships and core attributes between entities, while the distributed file storage system can be used to store unstructured data related to entities (such as product manual PDFs and scanned images of contracts), and achieve linked retrieval of "structured knowledge - unstructured data" through metadata association (such as entity ID and file path mapping). For example, when retrieving "quality inspection report of product A", embodiments of this application can first obtain the triple "product A - associated document - report ID123" from the graph database, which can be used as one of the entries in the structured knowledge list. Alternatively, embodiments of this application can further retrieve the corresponding quality inspection report PDF from the distributed file storage system through the entity "report ID123", thereby providing more comprehensive knowledge input for the large model and further improving the richness and accuracy of the answer.

[0040] As can be seen, for graph-related concurrent retrieval scenarios, the embodiments of this application can significantly improve the high availability, reliability and horizontal elasticity of knowledge question answering services through the collaboration of Gremlin traversal and cloud-native distributed file system (JuiceFS).

[0041] It should also be noted that the structure of each entry in the structured knowledge list can be consistent with the triple storage format of the graph database, that is, each entry contains a triple structure of "head entity-relation-tail entity" or "entity-attribute-attribute value".

[0042] In some implementations, embodiments of this application may also include retrieval source identifiers (such as target graph database node IDs and retrieval timestamps) in the entries of the structured knowledge list, so that large models can quickly parse the logical relationships between knowledge.

[0043] For example, executing a search statement in the target graph database can retrieve multiple triples that match the sub-question, such as (Contract A, Involves, Department B), (Department B, Contains, Employee C), (Employee C, Start Date, 2023), etc.

[0044] It is understood that by using the retrieval statement corresponding to at least one sub-problem to perform a triplet retrieval in the target graph database, a structured knowledge list corresponding to each sub-problem can be obtained separately. Alternatively, in the embodiments of this application, the triplet retrieval results corresponding to each sub-problem can be integrated into the same structured knowledge list.

[0045] S400: Input at least one sub-problem and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language problem.

[0046] In this step, this embodiment of the application can use prompt word engineering to concatenate sub-questions and knowledge fragments according to a preset template and input them into a pre-trained large model. The pre-trained large model can then perform knowledge fusion and logical reasoning based on the input, outputting fluent and accurate answers, and can annotate source information (such as the entities, relationships, and query sources) as required by the prompt words. Furthermore, for multiple sub-questions, this embodiment of the application can ensure coherence by managing the dialogue context. Therefore, this step achieves a deep integration of accurate knowledge retrieval and powerful generation capabilities, ensuring the reliability and interpretability of the answers.

[0047] In this embodiment of the application, the pre-trained large model can be a deep learning generative model, which can be built based on the Transformer architecture.

[0048] As described above, this application provides an intelligent question-answering method based on retrieval enhancement, applied to electronic devices. The method includes: receiving and parsing a natural language question from a user; determining at least one sub-question covered by the natural language question and its corresponding retrieval elements; the retrieval elements include one or more combinations of entity information, attribute information, and relational information corresponding to the sub-question; generating a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to the at least one sub-question; the retrieval statement is used for single-hop retrieval, multi-hop retrieval, and / or multi-condition composite retrieval in a graph database; performing triple retrieval in a target graph database using the retrieval statement corresponding to the at least one sub-question to obtain a structured knowledge list; wherein the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; and inputting the at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language question. Based on this method, graph database triples can be injected into a large model in real time, reducing the illusion of a large model and significantly improving accuracy and user experience.

[0049] Furthermore, the steps for constructing a graph database may include: ① Schema definition: In this application embodiment, vertex labels (entity type), edge labels (relationship type) and attribute keys can be pre-designed according to the business domain, and the naming conventions and data types are unified to provide metadata constraints for subsequent triples.

[0050] ② Data extraction and cleaning: The embodiments of this application can extract entities, relationships and attributes from structured, semi-structured or unstructured sources (databases, Excel, text, APIs, etc.), and perform deduplication, normalization, entity alignment and disambiguation operations to ensure data quality.

[0051] ③ Triple generation: In this embodiment of the application, the cleaned data can be converted into the standard triple form of <head entity, relation, tail entity> or <entity, attribute, value>, and a unique identifier (URI / ID) can be generated.

[0052] ④ Graph data loading: Import triples in batches into various nodes of the distributed graph database cluster through the interface provided by the graph database.

[0053] After the above construction is completed, the graph database can serve as a highly reliable, traceable, and scalable knowledge base to provide knowledge for the pre-trained knowledge base.

[0054] Figure 3 This is a schematic diagram of the knowledge graph provided in an embodiment of this application.

[0055] Each graph database can store a large number of knowledge graphs. Figure 3 The example illustrates a portion of a knowledge graph related to document management, showing the document directory structure and the relationships between entities. Dots represent entities (such as "Solution Suggestion Directory" or "header"), the text corresponding to the entities is attribute information, the connecting lines between entities are "edges", and the text corresponding to the edges (such as "source" or "align-right") indicates the relationship between entities.

[0056] Furthermore, step S100 may include the following steps S101-S102.

[0057] S101: Receive a natural language question and input the natural language question into a semantic understanding big model to obtain at least one sub-question covered by the natural language question; wherein, the semantic understanding big model is used to perform semantic understanding and question decomposition on the natural language question.

[0058] In this embodiment of the application, through training, the semantic understanding big model can perform deep semantic understanding and logical structure analysis, and decompose complex problems in natural language problems that may contain multiple points of doubt or require step-by-step reasoning into a series of logically independent sub-problems that are easier to handle.

[0059] For example, a natural language question could be "Please find the Controller layer code directory based on the 'alarm interface' in the knowledge base," which can be broken down into the following two sub-questions: Sub-problem 1: Query the relevant information of the alarm interface to obtain the module or directory to which it belongs.

[0060] Sub-question 2: Locate the code directory path corresponding to the Controller layer within the module or directory to which the alarm interface belongs.

[0061] In some implementations, the semantic understanding big model can be the same as or different from the pre-trained big model that generates the answer later.

[0062] S102: Determine the retrieval elements corresponding to at least one sub-question.

[0063] In this step, embodiments of this application can construct prompts, input each sub-question sequentially into the semantic understanding model, and use the prompts to guide the semantic understanding model to parse the sub-questions and determine each retrieval element. Alternatively, retrieval elements can be extracted using preset matching rules. By accurately extracting these retrieval elements, it can be ensured that the subsequently generated retrieval statements can accurately match the storage structure of the graph database, improving retrieval efficiency and the accuracy of knowledge acquisition.

[0064] Furthermore, step S200 may include the following steps S201-S204.

[0065] S201: Map entity information to vertex labels of the graph database, map attribute information to attribute keys of the graph database, and / or map relation information to edge labels of the graph database.

[0066] This step is used to accurately map the retrieval elements extracted from the sub-questions to the storage structure of the database. For example, entity information such as "Contract A" is mapped to the predefined vertex label "Contract" in the graph database, and entity information such as "Employee B" is mapped to the predefined vertex label "Employee" in the graph database, ensuring that the entity and vertex type match in the graph database. Attribute information such as "Job Start Date" is mapped to the corresponding vertex attribute key "hire_date", and attribute information such as "Contract Number" is mapped to the corresponding vertex attribute key "doc_id", ensuring the accuracy of attribute queries. Relationship information such as "involved in" is mapped to the graph database edge label "related_to", and relationship information such as "belongs to" is mapped to the graph database edge label "belong_to", clarifying the topological relationships between entities.

[0067] S202: Determine the search intent based on vertex labels, attribute keys, and / or edge labels.

[0068] This step clarifies the retrieval intent corresponding to the sub-problem: single-hop retrieval (or single-hop query), multi-hop retrieval (or multi-hop query), or multi-condition compound retrieval (or multi-condition compound query). Single-hop retrieval refers to a single-step traversal starting from the starting vertex. Specifically, it can include single-hop attribute retrieval (or single-hop attribute query) and single-hop relationship retrieval (or single-hop relationship query). Single-hop attribute retrieval only accesses the starting vertex itself, reading its attribute value once using the attribute key. Single-hop relationship retrieval is used to traverse along an edge label once starting from the starting vertex to reach adjacent vertices. Multi-hop retrieval refers to a loop traversal along a specified edge starting from the starting vertex until a termination condition is met (such as reaching a specified number of hops or encountering a specific type of vertex). Multi-condition compound retrieval refers to combining multiple attribute filtering conditions using logical operators (such as AND and OR) on the traversal path.

[0069] In some implementations, embodiments of this application can directly determine the search intent based on the combination pattern of vertex labels, attribute keys, and edge labels. For example, when only attribute keys exist (such as "employment date") and there is no requirement for associated edge labels, the search intent is determined to be "single-hop attribute search" (such as querying "employee A's employment date"); when only single edge labels exist (such as "involved in") and there are no attribute filtering conditions, the search intent is determined to be "single-hop relationship search" (such as querying "which departments are involved in contract A"); when multiple sets of consecutive edge labels appear (such as "involved in → included in") or when a hop count parameter needs to be specified, the search intent is determined to be "multi-hop search" (such as querying "employees included in the departments involved in contract A"); when multiple edge labels exist simultaneously (such as "involved in" + "approval") or multiple attribute filtering conditions exist (such as "employment date = 2023" + "department = technical department") and logical combination (AND / OR) is required, the search intent is determined to be "multi-condition composite search" (such as querying "employees who joined in 2023, belong to the technical department, and participated in the approval of contract A").

[0070] In other implementations, embodiments of this application may employ an intent classification model to determine the retrieval intent. The intent classification model can output four types of intent: single-hop attributes, single-hop relationships, multi-hop paths, and multi-condition composite intents, and provide confidence scores to provide a decision-making basis for path planning.

[0071] S203: Plan the search path based on the search intent.

[0072] Specifically, step S203 may include the following steps S2031-S2034.

[0073] S2031: When the search intent is a single-hop relation search, the search path is determined as follows: starting from the starting vertex corresponding to the vertex label, traverse step by step along the association relationship determined by the edge label to determine the target vertex.

[0074] For example, in this embodiment of the application, the starting vertex (such as the "Contract" vertex corresponding to "Contract A") can be used as the starting point, and a single-step traversal can be performed along the single association relationship defined by the edge label (such as the "related_to" edge corresponding to "involved") to finally locate the destination vertex directly connected to the starting vertex (such as the "Department" vertex corresponding to "Department B"). The path clearly reflects the direct association logic of "starting vertex → single edge relationship → destination vertex".

[0075] S2032: When the search intent is a single-hop attribute search, the search path is determined as follows: perform attribute query on the starting vertex based on the attribute key to determine the attribute value of the starting vertex.

[0076] For example, in this application embodiment, attribute value extraction can be performed directly on the starting vertex corresponding to the vertex label (such as the "Employee" vertex corresponding to "employment time") based on the attribute key (such as "hire_date" corresponding to "hire date"). There is no need to traverse the edge relationship. The path only contains the query link of "starting vertex → attribute key → attribute value" to obtain the feature information of the entity itself.

[0077] S2033: When the retrieval intent is multi-hop retrieval, the retrieval path is determined by the preset graph algorithm as follows: starting from the starting vertex corresponding to the vertex label, traversing along the specific relationship determined by the edge label until the termination condition is met; the termination condition includes reaching the specified number of hops or reaching the destination vertex of a specific type.

[0078] In this embodiment of the application, the preset graph algorithm may be path search, K-order neighbor, conditional filtering, etc.

[0079] For example, in this embodiment of the application, starting from a starting vertex (such as "Contract A"), the process can traverse along a specific relationship sequentially according to the edge label sequence (such as "involved → included") (first from the contract to the department, then from the department to the employee) until a termination condition is met. The termination condition can be reaching a preset number of hops (such as 2 hops) or traversing to a specific type of destination vertex (such as the "Employee" vertex), ultimately forming a multi-step association path of "starting vertex → edge 1 → intermediate vertex → edge 2 → destination vertex".

[0080] It is understood that the specified number of hops can be adjusted based on actual needs, such as 2 hops, 3 hops or 4 hops, and this application embodiment does not specifically limit this.

[0081] S2034: When the search intent is a multi-condition composite search, the search path is determined by using a preset graph algorithm and logical operation functions as follows: starting from the starting vertex corresponding to the vertex label, the search is iterated along the specific relationship and target filtering conditions determined by the edge label until the termination condition is met; the target filtering conditions are generated by combining the attribute values ​​corresponding to the attribute keys using logical operation functions, which include one or more of the following: AND function, OR function, and NOT function.

[0082] For example, in this embodiment, starting from a primary vertex, the traversal can proceed along the relationship chain determined by the edge labels (e.g., "involved → approval") while dynamically filtering vertices during the traversal process using logical operation functions (AND / OR / NOT) to combine the filtering conditions corresponding to the attribute keys (e.g., "department = technical department" and "approval time > 2023") until the termination condition is met (e.g., finding all vertices that meet the conditions). For example, the path can be represented as "Contract A → involved → department (filter condition: technical department) → approval → employee (filter condition: joined after 2023)", balancing relationship traversal with precise filtering based on multiple conditions.

[0083] S204: Generate the search statement corresponding to the search path.

[0084] Understandably, the syntax of the search statements is adapted to graph databases. For example, the search statement corresponding to a single-hop attribute search can be "gV().hasLabel('Person').has('name','Alice').values('age')", the search statement corresponding to a single-hop relation search can be "gV().has('Person','name','Alice').out('worksFor').hasLabel('Company')", the search statement corresponding to a multi-hop search can be "gV().has('Company','name','ABC').repeat(out('supplier')).times(3).hasLabel('Factory')", and the search statement corresponding to a multi-condition compound search can be "gV().and(has('age',gt(30)),out('worksFor').has('region','EU'))".

[0085] In this way, the search query can be determined and the search operation can be performed in the target graph database.

[0086] Furthermore, step S300 may specifically include the following steps S301-S303.

[0087] S301: Send a retrieval communication command to the gateway device so that the gateway device can allocate the target graph database based on polling, preset weights, or load balancing strategies.

[0088] Specifically, when calling a graph database to perform a retrieval operation, the electronic device can send a retrieval communication command to the gateway device. After receiving the command, the gateway device can allocate the target graph database node based on a preset resource allocation strategy. Then, the gateway device can generate response information and send it back to the electronic device. The response information may include the node identifier of the target graph database (such as a unique node ID), the network address (such as an IP address and port number), and the retrieval interface path (such as the Gremlin query interface URL adapted to the graph database).

[0089] For example, when the preset allocation strategy is round-robin, the gateway device can dispatch retrieval communication commands to the next graph database node in a fixed order. When the preset allocation strategy is based on preset weights, the gateway device performs weighted round-robin based on the pre-configured weight ratios of each node (such as the number of CPU cores, memory size, or business priority). In this case, nodes with higher weights will be allocated more requests. When the preset allocation strategy is load balancing, the gateway device can collect the current load metrics of each graph database node in real time (queries per second, CPU, memory, network latency, etc.) and dynamically allocate requests to the node with the lightest load.

[0090] In some implementations, the retrieval communication command can carry basic information about the retrieval statement, such as the statement type (single-hop / multi-hop / multi-condition composite retrieval).

[0091] S302: The gateway device calls the retrieval interface of the target graph database, passes the retrieval statement to the retrieval interface to perform triple retrieval, and then obtains multiple triple knowledge.

[0092] In this step, the graph database node can parse the vertex labels, edge labels, and attribute key constraints in the search statement, and then traverse the "entity-relationship-attribute" triple data it stores to filter out multiple triple knowledge that completely match the statement logic. For example, for the search for "departments involved in contract A", it returns triples such as (contract A, involved, department B) and (contract A, involved, department C), and returns the search results to the electronic device in a structured format (such as JSON).

[0093] S303: Integrate triplet knowledge into a structured knowledge list.

[0094] In this embodiment of the application, the structured knowledge list can be in JSON format, and the structured knowledge list includes multiple entries, each entry corresponding to a triplet.

[0095] Furthermore, step S400 may include the following steps S401-S403.

[0096] S401: For each sub-problem, the sub-problem and its corresponding structured knowledge list are concatenated according to a preset template to form the first input data corresponding to each sub-problem.

[0097] For example, a preset template could be: "Question: {Sub-question content}; Known knowledge: {Structured knowledge list, listed in 'entity-relationship-attribute' format}; Please generate an accurate answer based on the above knowledge, and do not cite any unmentioned information." Take the sub-question "What module or directory does the alarm interface belong to?" as an example.

[0098] The first input data after concatenation can be: "Question: What module or directory does the alarm interface belong to?; Known knowledge: 1. (Alarm interface, belongs to, monitoring module); 2. (Monitoring module, parent directory, / src / main / java / com / system); Please generate an accurate answer based on the above knowledge...".

[0099] S402: When there is only one sub-problem, the first input data corresponding to the sub-problem is input into the pre-trained large model to obtain the answer fragment; wherein, the pre-trained large model is used to generate output results based on a knowledge base, which includes a graph database and / or a distributed file storage system.

[0100] Understandably, the first input data can be in JSON format. The pre-trained large model can then use this first input data to retrieve information from the knowledge base based on the structured knowledge within the input, thereby generating answer fragments.

[0101] In some implementations, besides graph databases, embodiments of this application can also deploy document-oriented databases, relational databases, etc., on the database nodes. Specifically, embodiments of this application can split the questions, answers, category tags, etc., corresponding to a large number of question-answer pairs (QA pairs) into independent fields to form a relational database. Furthermore, embodiments of this application can also store question-answer pairs in JSON or BSON format to form a document-oriented database for rapid matching of related question-answer pairs.

[0102] S403: When there are multiple sub-problems, the first input data corresponding to each sub-problem is input into the pre-trained large model in rounds to obtain the answer fragment corresponding to each sub-problem; wherein, each round inputs the first input data corresponding to the current sub-problem and the generated results of all previous rounds.

[0103] For the case of a multi-subject problem, the embodiments of this application can adopt a sequential processing strategy: First round of processing: The first input data of the first sub-problem is fed into the model to generate answer fragment 1; Multi-round iterative processing: The first input data corresponding to the subsequent sub-questions and the historical dialogue context (including the inputs and generated answer fragments of all previous sub-questions) are input into the model to ensure that the model performs reasoning based on understanding the complete question chain; Output management: Ultimately, multiple answer fragments corresponding to the order of the sub-problems are obtained.

[0104] For example, the first round of input is: sub-question 1 + knowledge list 1 → answer fragment 1; the second round of input is: sub-question 2 + knowledge list 2 + (sub-question 1 + answer fragment 1) → answer fragment 2.

[0105] In this way, the pre-trained large model can retrieve knowledge bases based on the structured knowledge in the first input data, and then generate answer fragments.

[0106] As can be seen, the embodiments of this application can improve the accuracy of answers by fusing multi-source knowledge with context.

[0107] Furthermore, after step S403, the following steps S404-S405 may also be included.

[0108] S404: Generate target prompt words based on preset prompt word templates; wherein, the target prompt words are used to guide the pre-trained large model to splice answer fragments, and / or to guide the pre-trained large model to add source information to the generated answer; the source information includes at least entity relationship data involved in the generated answer, and the entity relationship data is source graph data generated by entity information, relationship information and / or attribute information involved in the generated answer.

[0109] It is worth noting that, in order to guide the large model to complete different task objectives, different prompt word templates can be pre-built in this application embodiment. For example, when it is necessary to integrate multiple answer fragments, the prompt word template can instruct the model: "Please construct a coherent and complete final answer based on the following scattered answer fragments: {list of answer fragments}", or, "Please integrate the following answer fragments into a coherent statement in the order of sub-questions, retaining key information and avoiding repetition: {answer fragment 1}; {answer fragment 2}...".

[0110] Furthermore, target prompts can also be used to guide large models to add source information to the generated answers. Source information can include not only entity relationship data, but also Gremlin query logs, triple knowledge sources, etc., so that users can verify the knowledge source of the conclusions in reverse.

[0111] In this embodiment, the target prompt words can specifically be used to guide the large model to add source graph data to the generated answer, and can be applied to the "deep reasoning" mode of an intelligent question-answering system. In this mode, this embodiment can guide the large model to generate source graph data based on entity information, relationship information, and / or attribute information. Figure 4 As shown, Figure 4 for Figure 3 The corresponding source map data. Users can then click the "Source Information" interactive button to query the source map data, allowing them to gain a comprehensive understanding of the answer.

[0112] S405: Input the target prompt, each sub-question and its corresponding answer fragment into the pre-trained large model to obtain the answer to the natural language question.

[0113] In this step, the pre-trained large model can logically connect answer fragments based on the guidance of target prompts (such as reorganizing them according to the progressive relationship of "conclusion of sub-problem 1 → conclusion of sub-problem 2"), insert source information as support, and finally output a complete answer that conforms to the expression habits of natural language.

[0114] Furthermore, after step S400, this embodiment of the application also includes the following step S500.

[0115] S500: Displays the answers to natural language questions on the answer display interface.

[0116] The answer display interface includes at least a reasoning process display interface and an answer display interface.

[0117] The answer display interface shows the final answer text, allowing users to quickly access information. The reasoning process display interface shows the breakdown of the original question (each sub-question), the knowledge retrieval process for each sub-question, and the logic behind the generation of the answer fragment. More importantly, the reasoning process display interface can display source information. Users can query source graph data by clicking the "Source Information" interactive button on the reasoning process display interface.

[0118] Figure 5 This is a schematic diagram of the user interface provided in an embodiment of this application.

[0119] like Figure 5 As shown in (a), the user asks the question "What is RAG?". Part of the reasoning process display interface can be shown as follows: Figure 5 As shown in (a), the source graph data corresponding to the problem can be displayed by clicking the interactive button "Click to view graph data".

[0120] like Figure 5As shown in (b) of [Figure ID], when the user asks the question "Please find the Controller layer code directory for me based on the 'Alarm Interface' in the knowledge base", the answer display interface can be as Figure 5 shown in (b) of [Figure ID].

[0121] In some implementation manners, the answer display interface may further include a knowledge reference display interface, which can be used to display the question-answer pairs used when the pre-trained large model generates answers.

[0122] As Figure 5 shown in (c) of [Figure ID], when the user asks the question "What should I do if the selected content does not match the content I see when I select an element?", the answer "It may be a problem with the web page zoom. Try zooming to 100%" is displayed in the answer display interface, and the knowledge reference display interface can display multiple preset question-answer pairs. By clicking the "View" button, it can jump to Figure 5 (d) of [Figure ID].

[0123] From the above content, it can be seen that the present application provides an intelligent question-answering method based on retrieval-enhanced generation. This method analyzes the user's question, extracts elements such as entities, attributes, and relationships, and automatically generates a graph database query statement. It retrieves and obtains structured knowledge in a distributed graph database cluster, and finally guides the large language model to generate credible answers based on the accurate retrieval results. This method effectively combines the accuracy of structured retrieval with the powerful generation ability of the large model, significantly improves the answer quality, traceability, and system anti-hallucination ability, and is applicable to professional fields with high reliability requirements.

[0124] Figure 6 This is the second structural schematic diagram of the intelligent question-answering system based on retrieval-enhanced generation provided by the embodiment of the present application.

[0125] As Figure 6 shown, the embodiment of the present application provides an intelligent question-answering system based on retrieval-enhanced generation. This intelligent question-answering system at least includes a pre-trained large model 2001 and a controller 2002; the controller 2002 is communicatively connected to the pre-trained large model 2001; the controller 2002 is used to control the user interaction module 1001, the knowledge graph storage and management module 1002, the structured retrieval module 1003, the information enhancement generation module 100 and the answer output module 1005 to execute the intelligent question-answering method based on retrieval-enhanced generation in the foregoing embodiment.

[0126] Further, the user interaction module is configured to: receive and parse the natural language question proposed by the user, and determine at least one retrieval element covered by the natural language question; the retrieval element includes one or more combinations of entity information, attribute information, and relationship information corresponding to the sub-question; The knowledge graph storage and management module 1002 is configured to: generate a search statement corresponding to the sub-question based on the search elements; the search statement is used to perform single-hop search, multi-hop search, and / or multi-condition compound search in the graph database; The structured retrieval module 1003 is configured to: perform triple retrieval in the target graph database using the retrieval statement to obtain a structured knowledge list; wherein, the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; The information enhancement generation module 1004 is configured to input at least one of the sub-problems and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language problem.

[0127] The answer output module 1005 is configured to display the answer to the natural language question on the answer display interface.

[0128] Figure 7 This is a schematic diagram of the structure of an intelligent question-answering device based on retrieval enhancement provided in an embodiment of this application.

[0129] like Figure 7 As shown in the figure, this application provides an intelligent question-answering device based on retrieval enhancement generation. The device may include: The parsing module 3001 is configured to: receive and parse the natural language question submitted by the user, and determine at least one sub-question covered by the natural language question and the corresponding retrieval elements; the retrieval elements include one or more combinations of entity information, attribute information and relation information corresponding to the sub-question; The statement generation module 3002 is configured to generate a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to at least one sub-question; the retrieval statement is used to perform single-hop retrieval, multi-hop retrieval, and / or multi-condition compound retrieval in the graph database. The enhanced retrieval module 3003 is configured to: perform triplet retrieval in the target graph database using retrieval statements corresponding to at least one sub-question to obtain a structured knowledge list; wherein, the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; The answer generation module 3004 is configured to input at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language question.

[0130] In one possible implementation, the statement generation module 3002 is specifically configured to: map entity information to vertex labels of a graph database, map attribute information to attribute keys of a graph database, and / or map relation information to edge labels of a graph database; determine the retrieval intent based on vertex labels, attribute keys, and / or edge labels; plan the retrieval path based on the retrieval intent; and generate the retrieval statement corresponding to the retrieval path.

[0131] In one possible implementation, the statement generation module 3002 is further configured to: when the retrieval intent is a single-hop relation retrieval, determine the retrieval path as follows: starting from the starting vertex corresponding to the vertex label, perform a single-step traversal along the association determined by the edge label to determine the destination vertex; when the retrieval intent is a single-hop attribute retrieval, determine the retrieval path as follows: perform an attribute query on the starting vertex based on the attribute key to determine the attribute value of the starting vertex.

[0132] In one possible implementation, the statement generation module 3002 is further configured to: when the retrieval intent is a multi-hop retrieval, determine the retrieval path using a preset graph algorithm as follows: starting from the starting vertex corresponding to the vertex label, traversing along the specific relationship determined by the edge label until the termination condition is met; the termination condition includes reaching a specified number of hops or reaching a destination vertex of a specific type; when the retrieval intent is a multi-condition composite retrieval, determine the retrieval path using a preset graph algorithm and logical operation functions as follows: starting from the starting vertex corresponding to the vertex label, traversing along the specific relationship determined by the edge label and the target filtering condition until the termination condition is met; the target filtering condition is generated by combining the attribute values ​​corresponding to the attribute keys using logical operation functions, which include one or more of the following: AND function, OR function, and NOT function.

[0133] In one possible implementation, the answer generation module 3004 is specifically configured as follows: for each sub-question, the sub-question and its corresponding structured knowledge list are concatenated into the first input data corresponding to each sub-question according to a preset template; when there is only one sub-question, the first input data corresponding to the sub-question is input into a pre-trained large model to obtain an answer fragment; wherein, the pre-trained large model is used to generate output results based on a knowledge base, which includes a graph database and / or a distributed file storage system; when there are multiple sub-questions, the first input data corresponding to each sub-question is input into the pre-trained large model in rounds to obtain the answer fragment corresponding to each sub-question; wherein, each round inputs the first input data corresponding to the current sub-question and the generation results of all previous rounds.

[0134] In one possible implementation, the answer generation module 3004 is further configured to: generate target prompt words based on a preset prompt word template; wherein the target prompt words are used to guide the pre-trained large model to concatenate answer fragments, and / or to guide the pre-trained large model to add source information to the generated answer; the source information includes at least entity relationship data involved in the generated answer, the entity relationship data being source graph data generated from entity information, relationship information and / or attribute information involved in the generated answer; the target prompt words, each sub-question and its corresponding answer fragment are input into the pre-trained large model to obtain the answer corresponding to the natural language question.

[0135] In one possible implementation, the parsing module 3001 is specifically configured to: receive a natural language question and input the natural language question into a semantic understanding big model to obtain at least one sub-question covered by the natural language question; wherein, the semantic understanding big model is used to perform semantic understanding and question decomposition on the natural language question; and determine the retrieval elements corresponding to at least one sub-question.

[0136] In one possible implementation, the enhanced retrieval module 3003 is specifically configured to: send a retrieval communication command to the gateway device so that the gateway device allocates the target graph database based on a polling, preset weight, or load balancing strategy; call the retrieval interface of the target graph database through the gateway device, pass the retrieval statement into the retrieval interface to perform triple retrieval, and then obtain multiple triple knowledge; and integrate the triple knowledge into a structured knowledge list.

[0137] In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, may include some or all of the steps of the intelligent question-answering method based on retrieval enhancement provided by the present invention. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.

[0138] It is readily understood that, based on the several embodiments provided in this application, those skilled in the art can combine, split, or reorganize the embodiments of this application to obtain other embodiments, none of which exceed the protection scope of this application.

[0139] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. An intelligent question-answering method based on retrieval enhancement generation, characterized in that, Applied to electronic devices, the method includes: The system receives and parses a natural language question submitted by a user, and determines at least one sub-question and its corresponding search elements. The search elements include one or more combinations of entity information, attribute information, and relation information corresponding to the sub-question. Generate a search statement corresponding to at least one sub-question based on the search elements corresponding to at least one sub-question; the search statement is used to perform single-hop search, multi-hop search and / or multi-condition compound search in the graph database; A structured knowledge list is obtained by performing a triplet retrieval in the target graph database using the retrieval statement corresponding to at least one sub-question; wherein, the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; By inputting at least one sub-problem and its corresponding structured knowledge list into a pre-trained large model, the answer to the natural language problem can be obtained.

2. The intelligent question-answering method based on retrieval enhancement generation according to claim 1, characterized in that, The step of generating a search statement corresponding to at least one sub-question based on the search elements corresponding to at least one sub-question includes: The entity information is mapped to vertex labels of the graph database, the attribute information is mapped to attribute keys of the graph database, and / or the relationship information is mapped to edge labels of the graph database; The retrieval intent is determined based on the vertex labels, the attribute keys, and / or the edge labels; Plan the search path based on the search intent; Generate the search statement corresponding to the search path.

3. The intelligent question-answering method based on retrieval enhancement generation according to claim 2, characterized in that, The process of planning the retrieval path based on the retrieval intent includes: When the search intent is a single-hop relationship search, the search path is determined as follows: starting from the starting vertex corresponding to the vertex label, traversing step by step along the association relationship determined by the edge label to determine the destination vertex; When the search intent is a single-hop attribute search, the search path is determined as follows: perform an attribute query on the starting vertex based on the attribute key to determine the attribute value of the starting vertex.

4. The intelligent question-answering method based on retrieval enhancement generation according to claim 2 or 3, characterized in that, The process of planning the retrieval path based on the retrieval intent also includes: When the search intent is a multi-hop search, the search path is determined using a preset graph algorithm as follows: starting from the starting vertex corresponding to the vertex label, traversing along the specific relationship determined by the edge label until the termination condition is met; the termination condition includes reaching a specified number of hops or reaching a specific type of destination vertex. When the search intent is a multi-condition composite search, the search path is determined by the preset graph algorithm and logical operation function as follows: starting from the starting vertex corresponding to the vertex label, the search is iterated along the specific relationship and target filtering conditions determined by the edge label until the termination condition is met; the target filtering conditions are generated by combining the attribute values ​​corresponding to the attribute keys using the logical operation function, and the logical operation function includes one or more of the following: AND function, OR function, and NOT function.

5. The intelligent question-answering method based on retrieval enhancement generation according to claim 1, characterized in that, The step of inputting at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language question includes: For each sub-problem, the sub-problem and its corresponding structured knowledge list are concatenated according to a preset template to form the first input data for each sub-problem; When there is only one sub-problem, the first input data corresponding to the sub-problem is input into the pre-trained large model to obtain the answer fragment; wherein, the pre-trained large model is used to generate output results based on a knowledge base, the knowledge base including a graph database and / or a distributed file storage system; When there are multiple sub-problems, the first input data corresponding to each sub-problem is input into the pre-trained large model in rounds to obtain the answer fragment corresponding to each sub-problem; wherein, each round inputs the first input data corresponding to the current sub-problem and the generation results of all previous rounds.

6. The intelligent question-answering method based on retrieval enhancement generation according to claim 5, characterized in that, After the step of inputting the first input data corresponding to each sub-problem into the pre-trained large model in turn to obtain the answer fragment corresponding to each sub-problem when there are multiple sub-problems, the method further includes: Target prompts are generated based on preset prompt templates; wherein, the target prompts are used to guide the pre-trained large model to splice answer fragments, and / or to guide the pre-trained large model to add source information to the generated answer; the source information includes at least entity relationship data involved in the generated answer, and the entity relationship data is source graph data generated by entity information, relationship information and / or attribute information involved in the generated answer; The target prompt, each sub-question, and its corresponding answer fragment are input into the pre-trained large model to obtain the answer to the natural language question.

7. The intelligent question-answering method based on retrieval enhancement generation according to claim 1, characterized in that, The process of receiving and parsing a natural language question submitted by a user, and determining at least one sub-question and corresponding search elements covered by the natural language question, includes: The system receives the natural language question and inputs it into a semantic understanding model to obtain at least one sub-question covered by the natural language question; wherein, the semantic understanding model is used to perform semantic understanding and question decomposition on the natural language question. Identify the search elements corresponding to at least one subquestion.

8. The intelligent question-answering method based on retrieval enhancement generation according to claim 1, characterized in that, The method involves using retrieval statements corresponding to at least one sub-problem to perform triplet retrieval in the target graph database, resulting in a structured knowledge list, including: Send a retrieval communication command to the gateway device so that the gateway device allocates the target graph database based on round-robin, preset weight or load balancing strategy; The gateway device calls the retrieval interface of the target graph database, passes the retrieval statement to the retrieval interface to execute the triple retrieval, and then obtains multiple triple knowledge; The triple knowledge is integrated into the structured knowledge list.

9. An intelligent question-answering system based on retrieval enhancement generation, characterized in that, The intelligent question answering system includes at least a pre-trained large model and a controller; the controller is communicatively connected to the pre-trained large model; the controller is configured to execute the intelligent question answering method based on retrieval enhancement generation as described in any one of claims 1-8.

10. An intelligent question-answering device based on retrieval enhancement generation, characterized in that, The device includes: The parsing module is configured to: receive and parse a natural language question submitted by a user, and determine at least one sub-question covered by the natural language question and the corresponding search elements; the search elements include one or more combinations of entity information, attribute information and relation information corresponding to the sub-question; The statement generation module is configured to generate a retrieval statement corresponding to at least one sub-question based on the retrieval elements corresponding to at least one sub-question; the retrieval statement is used to perform single-hop retrieval, multi-hop retrieval, and / or multi-condition composite retrieval in the graph database. The enhanced retrieval module is configured to: perform triplet retrieval in the target graph database using retrieval statements corresponding to at least one sub-question to obtain a structured knowledge list; wherein, the target graph database is one of multiple graph databases, and the multiple graph databases are graph database cluster nodes deployed on different servers; The answer generation module is configured to input at least one sub-question and its corresponding structured knowledge list into a pre-trained large model to obtain the answer to the natural language question.