Question and answer method, device and equipment based on search enhancement generation and storage medium
By leveraging personal and community knowledge subgraphs of a pre-defined knowledge graph in the fintech and healthcare sectors, and combining them with user preference data, personalized question-and-answer results are generated. This addresses the issues of generalized content and poor interpretability in existing technologies, resulting in a more accurate and interpretable question-and-answer service.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PING AN TECH (SHENZHEN) CO LTD
- Filing Date
- 2026-01-14
- Publication Date
- 2026-05-29
AI Technical Summary
Existing search-enhanced generation technologies fail to capture user similarities and group behavior patterns in the fintech and healthcare sectors, resulting in overly generalized and uninterpretable content that negatively impacts user decision-making.
By acquiring the target input question and user identifier, the system searches for personal and community knowledge subgraphs in a pre-defined knowledge graph, determines the set of prompt nodes, and combines user preference data to generate a target prompt information input language model, thereby achieving personalized answers.
It improves the accuracy and interpretability of Q&A results, meets users' personalized needs, and provides personalized financial and medical diagnostic advice.
Smart Images

Figure CN122114140A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and more particularly to a method, apparatus, device, and storage medium for question answering based on retrieval enhancement in the fields of fintech and healthcare. Background Technology
[0002] Large language models have wide applications in fintech and healthcare, such as personalized investment advice, insurance product recommendations, health consultations, and disease-aided diagnosis. In the financial and insurance industry, by analyzing user health data (such as medical examination reports) and behavioral data (such as credit scores), large language models can recommend insurance products. In the healthcare industry, by inputting patient symptoms, genetic testing data, and medical history, large language models can compare with a case database to provide differentiated diagnostic suggestions and treatment plans. Retrieval Augmented Generation (RAG) technology can mitigate the illusion problem that large language models encounter when generating answers. Existing RAG technologies typically search static document databases, failing to capture user similarities and group behavioral patterns, resulting in overly generalized content that fails to meet specific user preferences. Furthermore, the answers generated by existing RAG technologies lack interpretability, making it difficult for users to understand the basis for the answers, thus impacting user decision-making in fintech and healthcare. Summary of the Invention
[0003] Therefore, it is necessary to provide a method, apparatus, device, and storage medium for question answering based on retrieval enhancement to address the aforementioned technical problems, thereby solving the issues of low accuracy and poor interpretability of existing retrieval enhancement-generated question answering results.
[0004] A question-answering method based on retrieval enhancement includes: Obtain the target input question and the target user identifier associated with the target input question; Find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first set of prompt nodes based on the target input question and the personal knowledge subgraph; Find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second set of prompt nodes based on the target input question and the community knowledge subgraph; User preference data is determined based on the personal knowledge subgraph, and target prompt information is determined based on the user preference data, the first prompt node set, and the second prompt node set. The target input question and the target prompt information are input into a preset large language model to obtain the target answer information corresponding to the target input question.
[0005] A question-answering device based on retrieval enhancement includes: The information acquisition module is used to acquire the target input question and the target user identifier associated with the target input question; The personal knowledge analysis module is used to find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first prompt node set based on the target input question and the personal knowledge subgraph; The community knowledge analysis module is used to find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second prompt node set based on the target input question and the community knowledge subgraph. The prompt information determination module is used to determine user preference data based on the personal knowledge subgraph, and determine target prompt information based on the user preference data, the first prompt node set, and the second prompt node set; The answer information generation module is used to input the target input question and the target prompt information into a preset large language model to obtain target answer information corresponding to the target input question.
[0006] A computer device includes a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor, when executing the computer-readable instructions, implements the above-described question-answering method based on retrieval enhancement generation.
[0007] A computer-readable storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the question-answering method based on retrieval enhancement as described above.
[0008] In the aforementioned question-answering method, apparatus, device, and storage medium based on retrieval enhancement, the method obtains the target input question and the target user identifier associated with it; it retrieves the personal knowledge subgraph corresponding to the target user identifier from a preset knowledge graph, and determines a first set of prompt nodes based on the target input question and the personal knowledge subgraph; it retrieves the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determines a second set of prompt nodes based on the target input question and the community knowledge subgraph; it determines user preference data based on the personal knowledge subgraph, and determines target prompt information based on the user preference data, the first set of prompt nodes, and the second set of prompt nodes; it inputs the target input question and the target prompt information into a preset large language model to obtain target answer information corresponding to the target input question. This invention, based on the long-term memory of user historical behavior in a preset knowledge graph, utilizes the personal knowledge subgraph and community knowledge subgraph in the preset knowledge graph to achieve dual-source retrieval during question-answering interaction, deeply integrating personal characteristics and group knowledge as prompt information for the large language model, while also considering user preference data to meet users' personalized needs and improve the accuracy and interpretability of personalized answers. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 This is a schematic diagram of an application environment for a question-answering method based on retrieval enhancement in one embodiment of the present invention; Figure 2 This is a flowchart illustrating a question-answering method based on retrieval enhancement in one embodiment of the present invention; Figure 3 This is a schematic diagram of a question-answering device based on retrieval enhancement in one embodiment of the present invention; Figure 4 This is a schematic diagram of a computer device according to an embodiment of the present invention. Detailed Implementation
[0011] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0012] The question-answering method based on retrieval enhancement provided in this embodiment can be applied to, for example... Figure 1 In this application environment, the client communicates with the server. Clients include, but are not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices. The server can be implemented using a standalone server or a server cluster consisting of multiple servers.
[0013] The search-enhanced question-answering method described in this embodiment can be applied to the financial and insurance industry. Users input inquiries about insurance products with investment features on the client side. The server retrieves information on insurance products with investment attributes, such as participating insurance, universal life insurance, and unit-linked insurance, from the financial and insurance product database, along with their historical data and market performance. Then, a large language model is used to conduct in-depth analysis of the retrieved product information, assessing and predicting the risks and returns of each type of product, ultimately generating an answer that helps users gain a comprehensive understanding and make informed investment decisions.
[0014] The search-enhanced question-answering method in this embodiment can also be applied to the healthcare industry. In an intelligent consultation system, users can describe their symptoms by voice or text and input them into the client. The server can then quickly retrieve relevant medical literature, clinical guidelines, and historical case data to provide auxiliary diagnostic suggestions.
[0015] In one embodiment, such as Figure 2 As shown, a question-answering method based on retrieval enhancement is provided, which is applied in... Figure 1 The server shown includes the following steps S10-S50.
[0016] S10. Obtain the target input question and the target user identifier associated with the target input question.
[0017] Understandably, users can input information through the client's display interface. The client generates a target input question based on the user's input and sends it to the server. When sending the target input question to the server, the client also sends the currently logged-in user's ID as a user identifier. The target input question refers to the question text entered by the user using natural language. The user identifier is a unique identifier used to characterize a user's identity; the target user identifier is the user identifier of the user currently entering the question.
[0018] S20. Find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first prompt node set based on the target input question and the personal knowledge subgraph.
[0019] Understandably, the pre-built knowledge graph is a graph network constructed based on a graph structure to describe the key information and relationships in all users' past questions and answers. In the pre-built knowledge graph, different user identifiers correspond to their respective personal knowledge subgraphs. A personal knowledge subgraph is a graph network used to describe the key information and relationships in a single user's past questions and answers. As a structured semantic network, the knowledge graph describes entities and their relationships through nodes and edges. The server analyzes nodes based on the target input question and the personal knowledge subgraph, selecting multiple nodes from the personal knowledge subgraph to obtain a first set of prompt nodes. The first set of prompt nodes refers to the set of nodes in the personal knowledge subgraph that can provide direct or indirect guidance or reference for answering the target input question.
[0020] In one embodiment, step S20, that is, before finding the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, includes: S201. Obtain multiple historical question and answer records, wherein the historical question and answer records include historical user identifiers; S202. Desensitize the historical question-and-answer records to obtain desensitized question-and-answer records; S203. Obtain all de-identified Q&A records corresponding to the same historical user identifier, create an interaction node, a concept node, and a category node based on each de-identified Q&A record, establish connection edges between the interaction node and the concept node, between the interaction node and the category node, and between the concept nodes, and obtain the personal knowledge subgraph corresponding to the historical user identifier. S204. Cluster analysis is performed on the concept nodes of all the personal knowledge subgraphs using a preset community discovery algorithm to obtain several community knowledge subgraphs. S205. Merge all the community knowledge subgraphs to generate a preset knowledge graph.
[0021] Understandably, when constructing a pre-defined knowledge graph, the server first obtains multiple historical Q&A records, each corresponding to a specific historical user identifier. Historical Q&A records refer to the information recorded when a user interacted with the server via the client within a specific time period (e.g., six months). A historical user identifier is the user identifier of a historical user. Then, the server performs data anonymization processing on each historical Q&A record, resulting in anonymized Q&A records. Anonymized Q&A records are text records generated after data anonymization of the original historical Q&A records, meeting security and privacy protection requirements. Anonymization can eliminate the risk of sensitive information leakage while preserving data usability. Next, for all anonymized Q&A records corresponding to the same historical user identifier, the server creates interaction nodes, concept nodes, and category nodes for each anonymized Q&A record, establishing connections between interaction nodes and concept nodes, interaction nodes and category nodes, and concept nodes, thus obtaining the personal knowledge subgraph corresponding to that historical user identifier. In this system, concept nodes correspond to entities in the anonymized question-and-answer records. Based on the co-occurrence frequency of these entities across different records, connection edges can be established between concept nodes. For example, a threshold can be set based on the co-occurrence frequency between entity pairs formed by different entity combinations to determine which entity pairs should be connected. The threshold can be adjusted according to actual needs and data characteristics. Next, the server performs cluster analysis on the concept nodes in all individual knowledge subgraphs using a pre-defined community discovery algorithm, resulting in several community knowledge subgraphs. The pre-defined community discovery algorithm can employ either the Louvain algorithm or the Leiden algorithm. The Louvain algorithm is an efficient community partitioning method based on modularity optimization, gradually merging nodes in a greedy manner to maximize the network's modularity, thereby discovering the community structure graph. The Leiden algorithm is an improved community partitioning method based on the Louvain algorithm, effectively avoiding isolated nodes and disconnected communities, and exhibiting higher separability and stability. Finally, the server merges all community knowledge subgraphs to generate the pre-defined knowledge graph. A historical user identifier corresponds to a personal knowledge subgraph. A community knowledge subgraph contains one or more personal knowledge subgraphs. All community knowledge subgraphs are combined to form a preset knowledge graph.
[0022] Before executing the preset community discovery algorithm, the server converts the initial knowledge graph into an undirected weighted graph, where interaction nodes, concept nodes, and category nodes are all treated as nodes. The weights of interaction-concept edges and interaction-category edges are set to 1 by default, and the weights of concept-concept edges are obtained by normalizing co-occurrence frequencies. Then, the Louvain algorithm is run for community discovery, ultimately assigning interaction nodes to different community knowledge subgraphs. A community knowledge subgraph is a subgraph extracted from the entire knowledge graph that contains only nodes and edges within a specific community. It describes a graph network where key information from past questions and answers by multiple specific users shares common attributes. The result of community discovery is that each interaction node is assigned a community identifier. Each interaction node in the preset knowledge graph corresponds to a historical user identifier and a community identifier, facilitating subsequent retrieval of the corresponding personal and community knowledge subgraphs based on the user identifier.
[0023] In addition, for the pre-generated knowledge graph, the server periodically (e.g., every week) collects newly added historical question-and-answer records and runs a community discovery algorithm to update the personal knowledge subgraph and community knowledge subgraph in the pre-generated knowledge graph. That is, whenever a new user question-and-answer record is added, the server creates a corresponding interaction node, extracts the concept node and links it to existing concept nodes (or creates a new one if none exist), links it to category nodes, and updates the co-occurrence relationships between concept nodes.
[0024] In one specific embodiment, the server establishes a pre-defined knowledge graph for the fintech field. First, the server accesses user behavior data from a bank's wealth management app (one user transaction corresponds to one piece of user behavior data), including transaction records, browsing logs, and risk assessment results. All user behavior data needs to undergo data anonymization processing; for example, user IDs are replaced with anonymous identifiers, and product names are mapped to generic names using internal codes. Next, when creating interaction nodes, each piece of anonymized user behavior data (such as a transaction or browsing record) is treated as an interaction node, with the node content being "time + action + product name + amount (if any)," for example, "Purchased 10,000 yuan of stable value-added bond fund on 2025-03-01." When creating concept nodes, entities are extracted from the anonymized user behavior data, such as product name, product type (e.g., "bond fund"), risk level (e.g., "R2"), and operation type ("purchase", "browse"), etc. When creating category nodes, the category of the anonymized user behavior data is determined based on a predefined category tree, such as "fund / bond fund," "wealth management / principal-protected," etc. Next, interaction-concept edges, interaction-category edges, and concept-concept edges based on co-occurrence relationships (e.g., "bond fund" often co-occurs with "R2") are established to obtain an initial knowledge graph. Then, the server runs the Louvain algorithm to cluster the initial knowledge graph, forming several community knowledge graphs, such as "high-risk preference community", "moderate community", and "conservative community".
[0025] In another specific embodiment, the server establishes a pre-defined knowledge graph for the healthcare field. First, the server accesses anonymized electronic medical record data from a hospital (one anonymized electronic medical record corresponds to one user visit), including patient complaints, diagnostic records, medication records, etc. Next, when creating interaction nodes, each anonymized electronic medical record is treated as an interaction node, with content including "time + complaint + diagnosis + medication," for example, "2025-02-20 Complaint: dizziness, blood pressure 150 / 95, Diagnosis: hypertension, Prescription: amlodipine 5mg qd." When creating concept nodes, entities are extracted from each anonymized electronic medical record, including symptoms (dizziness), disease (hypertension), medication (amlodipine), and examination items (blood pressure), etc. When creating category nodes, the category of the anonymized electronic medical record data is determined based on a predefined category tree, including departmental classification (cardiovascular medicine, endocrinology, etc.) and disease category (chronic disease, acute disease, etc.), resulting in an initial knowledge graph. Next, the server runs the Louvain algorithm to cluster the initial knowledge graph, forming several community knowledge graphs, such as "community with well-controlled hypertension" and "community with diabetes and hypertension".
[0026] This embodiment, through data anonymization, provides a rich and compliant data source for the construction of the knowledge graph. By creating a corresponding personal knowledge subgraph for each historical user identifier, this embodiment can deeply explore and present each user's unique knowledge system, interests, and interaction patterns. Using a pre-defined community discovery algorithm for cluster analysis, concept nodes with similar characteristics or connections can be grouped into the same community knowledge subgraph, helping to discover the inherent connections and potential structures between knowledge. The division into personal and community knowledge subgraphs gives the pre-defined knowledge graph more comprehensive and diverse information, thereby improving its coverage and practicality.
[0027] In one embodiment, step S203, namely creating an interaction node, concept node, and category node based on each of the de-identified question-and-answer records, includes: S2031. Create an interactive node based on the desensitized question and answer record, wherein the interactive node includes a timestamp and desensitized text; S2032. Extract question and answer entities from the desensitized text of the desensitized question and answer records using the named entity recognition method, and create at least one concept node based on all the question and answer entities; S2033. Create a category node based on the scenario category information of the de-identified question and answer record.
[0028] Understandably, the pre-defined knowledge graph consists of interaction nodes, concept nodes, and category nodes. Each interaction node corresponds to a specific user's de-identified question-and-answer record; each concept node corresponds to an entity extracted from a de-identified question-and-answer record; and each category node corresponds to the category to which a de-identified question-and-answer record belongs. Scenario category information is pre-defined to distinguish the applicable scenarios for different question-and-answer knowledge.
[0029] In one specific embodiment, the preset knowledge graph is defined as graph G=(V,E), where the node set V includes interaction nodes vi, concept nodes vc, and category nodes vt. Interaction node vi corresponds to a user question-and-answer record, each record containing a timestamp and anonymized text content (e.g., "Purchased Fund A for 1000 yuan on March 10, 2025"). Each interaction node also corresponds to a unique historical user identifier. Concept node vc corresponds to key entities extracted from the anonymized text. In the financial field, concept nodes can be financial product names, industry terms, risk levels, etc.; in the medical field, they can be disease names, drug names, symptoms, etc. Entity extraction is implemented using a Named Entity Recognition (NER) model. Category node vt corresponds to the category to which the user question-and-answer record belongs. For example, in a financial scenario, it can be divided into "stocks," "bonds," "insurance," etc.; in a medical scenario, it can be divided into "cardiovascular medicine," "endocrinology," etc. Categories can be predefined or automatically obtained through a text classification model. The edge set E includes interaction-concept edges, interaction-category edges, and concept-concept edges. Interaction-concept edges connect interaction nodes to concept nodes extracted from those interaction nodes. Interaction-category edges connect interaction nodes to their respective category nodes. If two concept nodes frequently co-occur in the same user question-and-answer record, a concept-concept edge is established between them, with the weight determined by the co-occurrence frequency.
[0030] This embodiment uses interactive nodes to record specific question and answer records, concept nodes to extract the core entities in the questions and answers, and category nodes to classify the scenarios of the questions and answers. Through the close relationship between interactive nodes, concept nodes, and category nodes, anonymized question and answer records from different sources can be integrated to form a unified knowledge system, providing a data foundation for subsequent queries and calls.
[0031] In one embodiment, the personal knowledge subgraph includes several interconnected interaction nodes, concept nodes, and category nodes; step S20, namely determining the first set of prompt nodes based on the target input question and the personal knowledge subgraph, includes: S206. Perform text conversion processing on the target input question to obtain the target question vector, and perform text conversion processing on the desensitized text of each person interaction node in the personal knowledge subgraph to obtain the personal interaction node vector of each person interaction node. S207. Calculate the similarity between the target question vector and each of the individual interaction node vectors to obtain the similarity value of each individual interaction node. S208. Select the first preset number of personal interaction nodes with the highest similarity values from all personal interaction nodes in the personal knowledge subgraph, and determine them as the first relevant interaction nodes. S209. Generate a first related node set based on all the first related interaction nodes and the concept nodes and category nodes connected to the first related interaction nodes.
[0032] Understandably, the server performs text conversion on the natural language description text by calling a pre-trained text embedding model in real time, resulting in a vector of high-dimensional floating-point arrays. The target question vector is the vector representation of the target input question after conversion. The personal interaction node vector is the vector representation of the anonymized text of the personal interaction node. A personal interaction node is an interaction node in the personal knowledge subgraph. The server calculates the similarity between the target question vector and the vectors of each personal interaction node, obtaining the similarity value for each node. Similarity calculation can be implemented using cosine similarity, or other methods such as Euclidean distance and Manhattan distance. The server selects the K most relevant interaction nodes with the highest similarity scores, along with their associated concept and category nodes, to form the first relevant node set. The first relevant interaction nodes refer to the first preset number of personal interaction nodes with the highest similarity values selected from the personal knowledge subgraph. The first preset number is a pre-set value used to limit the number of first relevant interaction nodes; it can be set to a default value or adjusted as needed, denoted by K, for example, K defaults to 3.
[0033] In one specific embodiment, the target user inputs a target input question (denoted by q) in natural language via a client, and the target user identifier is denoted by u. The server retrieves the personal knowledge subgraph (denoted by Hu) corresponding to the target user identifier u from a preset knowledge graph. The server performs text conversion processing on the anonymized text of the target input question q and the personal knowledge subgraph Hu for each user interaction node, obtaining a target question vector and multiple personal interaction node vectors. The server calculates the similarity between the target question vector and each personal interaction node vector, selects the K personal interaction nodes with the highest similarity (e.g., K=3), and includes these personal interaction nodes and their directly connected concept nodes and category nodes as the first relevant node set, denoted by Iuser.
[0034] This embodiment achieves rapid retrieval of large-scale knowledge graphs through vector transformation and similarity calculation. At the same time, by analyzing the interaction history between user input questions and personal knowledge subgraphs, a personalized set of relevant nodes can be selected, which helps to more accurately understand the user's personalized question needs.
[0035] S30. Find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second prompt node set based on the target input question and the community knowledge subgraph.
[0036] Understandably, while analyzing the target input question and the community knowledge subgraph, the server searches for the community knowledge subgraph corresponding to the target user identifier from the pre-defined knowledge graph, and determines the second set of prompt nodes based on the target input question and the community knowledge subgraph. The second set of prompt nodes refers to the set of nodes in the community knowledge subgraph that can provide direct or indirect guidance or reference for answering the target input question.
[0037] In one embodiment, the community knowledge subgraph includes at least one personal knowledge subgraph, each of which includes several interconnected interaction nodes, concept nodes, and category nodes; step S30, namely determining the second set of prompt nodes based on the target input question and the community knowledge subgraph, includes: S301. Remove the personal knowledge subgraph corresponding to the target user identifier from the community knowledge subgraph and determine it as a candidate node set. S302. Perform text conversion processing on the target input question to obtain the target question vector, and perform text conversion processing on the desensitized text of each community interaction node in the candidate node set to obtain the community interaction node vector of each community interaction node. S303. Calculate the similarity between the target question vector and each community interaction node vector to obtain the similarity value of each community interaction node. S304. Select the second preset number of community interaction nodes with the highest similarity values from all community interaction nodes in the community knowledge subgraph, and determine them as the second related interaction nodes; S305. Based on all the second related interaction nodes and the concept nodes and category nodes connected to the second related interaction nodes, generate a second related node set.
[0038] Understandably, the community interaction node vector refers to the vector representation of the community interaction node after its anonymized text has been converted. A community interaction node is an interaction node in the community knowledge subgraph. The second relevant interaction node refers to the second preset number of community interaction nodes with the highest similarity values selected from the community knowledge subgraph. The second preset number is a pre-set value used to limit the number of second relevant interaction nodes; it can be set to a default value or adjusted as needed, denoted by M, for example, M's default value is 5.
[0039] In one specific embodiment, the target user inputs a target input question (denoted by q) in natural language via a client, and the target user identifier is denoted by u. The server searches for the community knowledge subgraph corresponding to the target user identifier u from a preset knowledge graph, denoted by HC(u). The server excludes nodes from u's own personal knowledge subgraph Hu from the community knowledge subgraph HC(u), obtaining a candidate node set, i.e., HC(u)\Hu. The server performs text conversion processing on the target input question q and the desensitized text of each community interaction node in the candidate node set, obtaining a target question vector and multiple community interaction node vectors. The server calculates the similarity between the target question vector and each community interaction node vector, selects the M community interaction nodes with the highest similarity (e.g., M=5), and includes these community interaction nodes and their directly connected concept nodes and category nodes as a second related node set, denoted by Icommunity.
[0040] In one specific embodiment, the server queries a pre-defined knowledge graph for the fintech field. User u (belonging to the "Stable Community") has the following input question: "I have 50,000 yuan of spare cash and hope for a higher return than fixed deposits, with minimal risk. Please recommend some products." On one hand, the server calculates the similarity between the target input question and u's interaction nodes, finding that u has previously purchased "Money Market Fund A" and "Short-Term Bond Fund B," and browsed information about "Reverse Repurchase Agreements," selecting the three most relevant records as Iuser. On the other hand, the server excludes u's own node from the "Stable Community," and through similarity analysis, finds that other users in this community often choose "Interbank Certificate of Deposit Index Funds," "Pure Bond Funds," etc., for similar needs, and that the average annualized return of related products is 3.2%, selecting the five most relevant records as Icommunity.
[0041] In another specific embodiment, the server queries a pre-defined knowledge graph in the healthcare field. Patient u (belonging to a "well-controlled hypertension community") has the target input question: "I often feel dizzy in the afternoons lately; should I increase my medication dosage?" On one hand, the server calculates the similarity between the target input question and u's interaction nodes, retrieves past missed dose records for u, and data on blood pressure fluctuations, selecting the three most relevant records as Iusers. On the other hand, the server excludes u itself from the "well-controlled hypertension community," and through similarity analysis of other patients' data in this community, discovers that afternoon dizziness is often related to the diurnal rhythm of blood pressure; blindly increasing medication dosage may cause hypotension, while adjusting medication time to the morning is often effective; selecting the five most relevant records as Icommunity.
[0042] This embodiment excludes the target user's own nodes when searching the community knowledge graph. It discovers and mines the collective experiences of similar users through the community, making up for the lack of personal historical data, and providing reference suggestions based on similar groups for question-and-answer services. Moreover, the community data has been anonymized and aggregated, achieving group knowledge sharing without disclosing personal privacy.
[0043] S40. Determine user preference data based on the personal knowledge subgraph, and determine target prompt information based on the user preference data, the first prompt node set, and the second prompt node set.
[0044] In essence, user preference data refers to characteristic information used to represent a user's knowledge needs and concerns in a specific scenario. Target cue information refers to reference information used to guide the large language model to accurately understand the user's question and generate a satisfactory answer.
[0045] In one embodiment, step S40, namely determining user preference data based on the personal knowledge subgraph, includes: S401. Obtain the anonymized question and answer records corresponding to the target user identifier based on the personal knowledge subgraph; S402. Perform frequency analysis on the question and answer entities extracted from the desensitized question and answer records to obtain the entity frequency value of each question and answer entity; S403. Determine user preference data based on all question-and-answer entities whose frequency values reach a preset frequency threshold.
[0046] Intuitively, in the personal knowledge subgraph, the anonymized Q&A records corresponding to the target user identifier represent interaction nodes, and the Q&A entities extracted from these records represent concept nodes in the personal knowledge subgraph. The frequency analysis method is the Term Frequency-Inverse Document Frequency (TF-IDF) method. Entity frequency value refers to the TF-IDF value of each concept node in the personal knowledge subgraph across all historical Q&A records. The preset frequency threshold is a pre-defined TF-IDF value threshold used to filter out Q&A entities for evaluating user interests and preferences. It can be set to a default value or adjusted as needed; for example, the default value for the preset frequency threshold is 0.5. Here, TF represents Term Frequency, used to measure the frequency of a word appearing in the current text; IDF represents Inverse Document Frequency, used to measure the rarity of a word across all historical Q&A records. The higher the TF-IDF value of a word, the higher the probability that the user prefers that word; such a word is called a key entity.
[0047] This embodiment uses a personal knowledge subgraph as a data source for analysis, which can more accurately capture users' true preferences, resulting in more targeted and reliable user preference data. Simultaneously, frequency analysis of question-and-answer entities is performed, using entities whose frequency values reach a preset threshold to determine user preference data, which can intuitively reflect the content that users frequently pay attention to and mention.
[0048] In one embodiment, step S40, namely determining the target prompt information based on the user preference data, the first prompt node set, and the second prompt node set, includes: S404. Obtain the model prompt template of the preset large language model. The model prompt template includes a task instruction area, an individual reference area, a community reference area, a user preference area, and an output constraint area. S405. Determine the content of the task instruction area and the content of the output constraint area based on the template configuration information of the model prompt template; S406. Generate a time-series question-and-answer record based on the first set of related nodes, and determine the time-series question-and-answer record as the content of the individual reference area; S407. Generate similar user question and answer summaries based on the second relevant node set, and determine the similar user question and answer summaries as community reference area content; S408. Determine the content of the user preference area based on the user preference data; S409. Fill the task instruction area content, the individual reference area content, the community reference area content, the user preference area content, and the output constraint area content into the model prompt template to generate the target prompt information.
[0049] Understandably, the model prompt template is a pre-configured format template for generating prompt information, containing a task instruction area, an individual reference area, a community reference area, a user preference area, and an output constraint area. The server determines the content of the task instruction area and the output constraint area based on the template configuration information of the model prompt template. The template configuration information is predefined template content used to characterize the "system prompt" that controls the model's behavior in the current application scenario (finance or healthcare). The task instruction area content characterizes the role the large model needs to play (e.g., "professional investment advisor," "doctor") and the specific requirements of the task. The output constraint area content characterizes the format restrictions (e.g., "concise," "easy to understand") and compliance requirements for the model's generated responses (e.g., "avoid promising returns," "do not make diagnostic assertions"). Next, the server generates time-series question-and-answer records based on the first set of relevant nodes and determines these records as the content of the individual reference area. The server generates similar user question-and-answer summaries based on the second set of relevant nodes and determines these summaries as the content of the community reference area. Time-series question-and-answer records refer to arranging the interaction nodes in the first set of relevant nodes in chronological order and converting the graph structure (nodes and edges) information into natural language descriptions. For example, "Purchased Money Market Fund A on 2025-01-10; Purchased Short-Term Bond Fund B on 2025-02-15". Similar user question-and-answer summaries refer to a general description formed by aggregating and statistically analyzing node information in the second set of relevant nodes. This may include statistically derived "common patterns, proportions, average values," etc. (e.g., "80% of users in this group chose product A, with an average return of 3.2%").
[0050] In one specific embodiment, the server generates the following target prompt information for the fintech field: You are a professional financial advisor. Please provide investment advice based on the following user's personal history and statistical data of similar user groups. Requirements: Use plain language to list 2-3 specific products and briefly explain the reasons. Do not promise returns, and remind users that investment involves risks. The individual reference area content is: "Purchased 20,000 yuan of Money Market Fund A on January 10, 2025; Purchased 15,000 yuan of Short-Term Bond Fund B on February 15, 2025; Browsed the details page of Treasury Bond Reverse Repurchase on March 1, 2025." The community reference area content is: Among users with similar risk appetite and a conservative investment style, the most common investment choices for "idle cash management, higher returns than fixed deposits, and low risk" are: Interbank Certificate of Deposit Index Fund: Average annualized return 3.2%, risk level R1. Pure Bond Fund: Average annualized return 3.5%, risk level R2. Bank Cash Management Products: Average annualized return 2.9%, risk level R1. The user preference section states: Based on historical behavior analysis, you show a high level of interest in concepts such as "low risk," "stable returns," and "good liquidity."
[0051] This embodiment can accurately and quickly generate target prompts using model prompt templates. Based on individual reference area content, community reference area content, and user preference area content, it can provide users with highly personalized question-and-answer services. Furthermore, the generated prompts explicitly include personal history snippets and community reference summaries, and the output of the large language model has traceable information, improving interpretability.
[0052] S50. Input the target input question and the target prompt information into a preset large language model to obtain the target answer information corresponding to the target input question.
[0053] Understandably, the pre-trained large language model is a neural network model used to generate natural language responses based on the provided context, such as DeepSeek-V3.2 and DeepSeek-R1. The target response information is the natural language text used to respond to the target input question. For example, for users in a fintech scenario, the response might suggest considering the following products: 1. Interbank Certificate of Deposit Index Fund: Primarily invests in interbank certificates of deposit, with extremely low risk, good liquidity, and an average return of approximately 3.2% over the past year, suitable for increasing idle funds. 2. Pure Bond Fund: Invests in credit bonds, interest rate bonds, etc., with lower risk and slightly higher returns (approximately 3.5%), but may experience minor fluctuations. 3. Bank Cash Management Products: Low minimum investment amount, redeemable at any time, with a return of approximately 2.9%, and relatively high security. You can choose based on your own liquidity requirements. Investment involves risk; please carefully read the product prospectus before making a decision. As another example, for users in a healthcare scenario, the response might suggest that patients monitor their afternoon blood pressure, avoid self-medicating, and pay attention to medication adherence.
[0054] This embodiment obtains the target input question and the target user identifier associated with it; it then searches a pre-defined knowledge graph for the personal knowledge subgraph corresponding to the target user identifier, and determines a first set of prompt nodes based on the target input question and the personal knowledge subgraph; it also searches a pre-defined knowledge graph for the community knowledge subgraph corresponding to the target user identifier, and determines a second set of prompt nodes based on the target input question and the community knowledge subgraph; it determines user preference data based on the personal knowledge subgraph, and determines target prompt information based on the user preference data, the first set of prompt nodes, and the second set of prompt nodes; finally, it inputs the target input question and target prompt information into a pre-defined large language model to obtain target answer information corresponding to the target input question. This embodiment leverages the long-term memory of user historical behavior in a pre-defined knowledge graph to achieve dual-source retrieval during question-and-answer interaction using the personal and community knowledge subgraphs in the pre-defined knowledge graph. It deeply integrates personal characteristics and group knowledge as prompt information for the large language model, while also considering user preference data to meet users' personalized needs and improve the accuracy and interpretability of personalized answers. The method of this embodiment is highly versatile and can be applied to scenarios requiring personalized question-and-answer services in the fintech and healthcare fields.
[0055] The server-side system architecture in this embodiment includes a data layer, a knowledge graph layer, and an application layer. The data layer is used to access various types of user behavior data, such as transaction records and financial product browsing logs in the financial field, and electronic medical records and wearable device data in the medical field. All raw data undergoes anonymization upon access, and noise is added to sensitive fields. Differential privacy, a mathematically provable privacy protection technique, is used as an example. The knowledge graph layer is used to construct a pre-defined knowledge graph based on the anonymized data and periodically runs a community discovery algorithm to group users with similar behavioral patterns into different communities, forming and updating the community knowledge graph. The application layer receives user input, retrieves relevant information from the personal knowledge subgraph and the community knowledge subgraph through dual-source retrieval, constructs dynamic prompts, and finally generates personalized responses using a large language model and returns them to the user.
[0056] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0057] In one embodiment, a question-answering device based on retrieval enhancement is provided, which corresponds one-to-one with the question-answering method based on retrieval enhancement in the above embodiments. For example... Figure 3As shown, the question-answering device based on retrieval enhancement includes an information acquisition module 10, a personal knowledge analysis module 20, a community knowledge analysis module 30, a prompt information determination module 40, and an answer information generation module 50. Detailed descriptions of each functional module are as follows: Information acquisition module 10 is used to acquire the target input question and the target user identifier associated with the target input question; The personal knowledge analysis module 20 is used to find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first prompt node set based on the target input question and the personal knowledge subgraph. The community knowledge analysis module 30 is used to find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second prompt node set based on the target input question and the community knowledge subgraph. The prompt information determination module 40 is used to determine user preference data based on the personal knowledge subgraph, and determine target prompt information based on the user preference data, the first prompt node set, and the second prompt node set; The answer information generation module 50 is used to input the target input question and the target prompt information into a preset large language model to obtain target answer information corresponding to the target input question.
[0058] In one embodiment, the personal knowledge analysis module 20 includes: The historical data acquisition unit is used to acquire multiple historical question and answer records, wherein the historical question and answer records include historical user identifiers; The desensitization processing unit is used to desensitize the historical question and answer records to obtain desensitized question and answer records; The personal knowledge subgraph generation unit is used to obtain all de-identified Q&A records corresponding to the same historical user identifier, create interaction nodes, concept nodes and category nodes according to each de-identified Q&A record, establish connection edges between the interaction nodes and the concept nodes, between the interaction nodes and the category nodes, and between the concept nodes, to obtain the personal knowledge subgraph corresponding to the historical user identifier. The clustering analysis unit is used to perform clustering analysis on the concept nodes of all the personal knowledge subgraphs using a preset community detection algorithm to obtain several community knowledge subgraphs. A preset knowledge graph generation unit is used to merge all the community knowledge subgraphs to generate a preset knowledge graph.
[0059] In one embodiment, the personal knowledge analysis module 20 further includes: An interactive node creation unit is used to create an interactive node based on the desensitized question and answer record, wherein the interactive node includes a timestamp and desensitized text; The concept node creation unit is used to extract question and answer entities from the desensitized text of the desensitized question and answer records using a named entity recognition method, and to create at least one concept node based on all the question and answer entities; The category node creation unit is used to create a category node based on the scenario category information of the de-identified question and answer record.
[0060] In one embodiment, the personal knowledge analysis module 20 further includes: The text conversion processing unit is used to perform text conversion processing on the target input question to obtain the target question vector, and to perform text conversion processing on the desensitized text of each person interaction node in the personal knowledge subgraph to obtain the personal interaction node vector of each person interaction node. The first similarity calculation unit is used to calculate the similarity between the target question vector and each of the personal interaction node vectors to obtain the similarity value of each of the personal interaction nodes. The first relevant node determination unit is used to select a first preset number of personal interaction nodes with the highest similarity values from all personal interaction nodes in the personal knowledge subgraph and determine them as the first relevant interaction nodes. The first set generation unit is used to generate a first related node set based on all the first related interaction nodes and the concept nodes and category nodes connected to the first related interaction nodes.
[0061] In one embodiment, the community knowledge analysis module 30 includes: The candidate node set determination unit is used to determine the interaction nodes, concept nodes, and category nodes in the community knowledge subgraph after removing the personal knowledge subgraph corresponding to the target user identifier as the candidate node set; The text conversion processing unit is used to perform text conversion processing on the target input question to obtain a target question vector, and to perform text conversion processing on the desensitized text of each community interaction node in the candidate node set to obtain a community interaction node vector for each community interaction node. The second similarity calculation unit is used to calculate the similarity between the target question vector and each of the community interaction node vectors to obtain the similarity value of each of the community interaction nodes. The second related node determination unit is used to select a first preset number of community interaction nodes with the highest similarity values from all community interaction nodes in the community knowledge subgraph and determine them as the second related interaction nodes. The second set generation unit is used to generate a second related node set based on all the second related interaction nodes and the concept nodes and category nodes connected to the second related interaction nodes.
[0062] In one embodiment, the prompt information determination module 40 includes: The question-and-answer record acquisition unit is used to acquire de-identified question-and-answer records corresponding to the target user identifier based on the personal knowledge subgraph. The frequency analysis unit is used to perform frequency analysis on the question and answer entities extracted from the desensitized question and answer records to obtain the entity frequency value of each question and answer entity; The user preference data determination unit is used to determine user preference data based on all question-and-answer entities whose frequency values reach a preset frequency threshold.
[0063] In one embodiment, the prompt information determination module 40 further includes: The prompt template acquisition unit is used to acquire the model prompt template of the preset large language model. The model prompt template includes a task instruction area, an individual reference area, a community reference area, a user preference area, and an output constraint area. The template configuration information parsing unit is used to determine the content of the task instruction area and the content of the output constraint area based on the template configuration information of the model prompt template. The individual content determination unit is used to generate time-series question-and-answer records based on the first set of related nodes, and to determine the time-series question-and-answer records as individual reference area content; The community content determination unit is used to generate similar user question and answer summaries based on the second related node set, and determine the similar user question and answer summaries as community reference area content; A preference content determination unit is used to determine the content of the user preference area based on the user preference data. The content filling unit is used to fill the task instruction area content, the individual reference area content, the community reference area content, the user preference area content, and the output constraint area content into the model prompt template to generate the target prompt information.
[0064] For specific limitations regarding the retrieval-enhanced question-answering device, please refer to the limitations of the retrieval-enhanced question-answering method above, which will not be repeated here. Each module in the aforementioned retrieval-enhanced question-answering device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0065] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 4 As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes a readable storage medium and internal memory. The readable storage medium stores an operating system, computer-readable instructions, and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The database stores data related to a retrieval-enhanced question-answering method. The network interface communicates with external terminals via a network connection. When the computer-readable instructions are executed by the processor, they implement a retrieval-enhanced question-answering method. The readable storage medium provided in this embodiment includes both non-volatile and volatile readable storage media.
[0066] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor performs the following steps when executing the computer-readable instructions: Obtain the target input question and the target user identifier associated with the target input question; Find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first set of prompt nodes based on the target input question and the personal knowledge subgraph; Find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second set of prompt nodes based on the target input question and the community knowledge subgraph; User preference data is determined based on the personal knowledge subgraph, and target prompt information is determined based on the user preference data, the first prompt node set, and the second prompt node set. The target input question and the target prompt information are input into a preset large language model to obtain the target answer information corresponding to the target input question.
[0067] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media stores computer-readable instructions, which, when executed by one or more processors, perform the following steps: Obtain the target input question and the target user identifier associated with the target input question; Find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first set of prompt nodes based on the target input question and the personal knowledge subgraph; Find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second set of prompt nodes based on the target input question and the community knowledge subgraph; User preference data is determined based on the personal knowledge subgraph, and target prompt information is determined based on the user preference data, the first prompt node set, and the second prompt node set. The target input question and the target prompt information are input into a preset large language model to obtain the target answer information corresponding to the target input question.
[0068] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0069] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0070] The software tools or components not belonging to this company that appear in the embodiments of this application are merely illustrative examples and do not represent actual use. The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for generating a question and answer based on search enhancement, characterized in that, include: Obtain the target input question and the target user identifier associated with the target input question; Find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first set of prompt nodes based on the target input question and the personal knowledge subgraph; Find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second set of prompt nodes based on the target input question and the community knowledge subgraph; User preference data is determined based on the personal knowledge subgraph, and target prompt information is determined based on the user preference data, the first prompt node set, and the second prompt node set. The target input question and the target prompt information are input into a preset large language model to obtain the target answer information corresponding to the target input question.
2. The method for generating question and answer based on retrieval enhancement according to claim 1, wherein, Before searching for the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, the process includes: Retrieve multiple historical Q&A records, wherein the historical Q&A records contain historical user identifiers; The historical question-and-answer records are anonymized to obtain anonymized question-and-answer records; Obtain all anonymized Q&A records corresponding to the same historical user identifier, create an interaction node, concept node, and category node based on each anonymized Q&A record, establish connection edges between the interaction node and the concept node, between the interaction node and the category node, and between the concept nodes, and obtain the personal knowledge subgraph corresponding to the historical user identifier; By using a pre-defined community discovery algorithm, cluster analysis is performed on the concept nodes in all the aforementioned personal knowledge subgraphs to obtain several community knowledge subgraphs. All the community knowledge subgraphs are merged to generate a preset knowledge graph.
3. The question-answering method based on retrieval enhancement as described in claim 2, characterized in that, The process of creating interaction nodes, concept nodes, and category nodes based on each of the de-identified question-and-answer records includes: An interactive node is created based on the anonymized Q&A record, and the interactive node includes a timestamp and anonymized text. The named entity recognition method is used to extract question and answer entities from the desensitized text of the desensitized question and answer records, and at least one concept node is created based on all the question and answer entities; A category node is created based on the scenario category information of the anonymized Q&A records.
4. The question-answering method based on retrieval enhancement as described in claim 1, characterized in that, The personal knowledge subgraph includes several interconnected interaction nodes, concept nodes, and category nodes; The step of determining the first set of prompt nodes based on the target input question and the personal knowledge subgraph includes: The target input question is processed by text conversion to obtain the target question vector, and the desensitized text of each person interaction node in the personal knowledge subgraph is processed by text conversion to obtain the personal interaction node vector of each person interaction node. The similarity between the target question vector and each of the individual interaction node vectors is calculated to obtain the similarity value of each individual interaction node. From all personal interaction nodes in the personal knowledge subgraph, select a first preset number of personal interaction nodes with the highest similarity values and determine them as the first relevant interaction nodes; A first related node set is generated based on all the first related interaction nodes and the concept nodes and category nodes connected to the first related interaction nodes.
5. The question-answering method based on retrieval enhancement as described in claim 1, characterized in that, The community knowledge subgraph includes at least one personal knowledge subgraph, and each personal knowledge subgraph includes several interconnected interaction nodes, concept nodes and category nodes; The step of determining the second set of prompt nodes based on the target input question and the community knowledge subgraph includes: The interaction nodes, concept nodes, and category nodes in the community knowledge subgraph after removing the personal knowledge subgraph corresponding to the target user identifier are determined as the candidate node set; The target input question is processed by text conversion to obtain a target question vector, and the desensitized text of each community interaction node in the candidate node set is processed by text conversion to obtain a community interaction node vector for each community interaction node. The similarity between the target question vector and each community interaction node vector is calculated to obtain the similarity value of each community interaction node. From all community interaction nodes in the community knowledge subgraph, select the second preset number of community interaction nodes with the highest similarity values and determine them as the second relevant interaction nodes; A second related node set is generated based on all the second related interaction nodes and the concept nodes and category nodes connected to the second related interaction nodes.
6. The question-answering method based on retrieval enhancement as described in claim 1, characterized in that, The step of determining user preference data based on the personal knowledge subgraph includes: Based on the personal knowledge subgraph, obtain the anonymized Q&A records corresponding to the target user identifier; Frequency analysis is performed on the question and answer entities extracted from the de-identified question and answer records to obtain the entity frequency value of each question and answer entity; User preference data is determined based on all question-and-answer entities whose frequency values reach a preset frequency threshold.
7. The question-answering method based on retrieval enhancement as described in claim 1, characterized in that, The step of determining the target prompt information based on the user preference data, the first prompt node set, and the second prompt node set includes: Obtain the model suggestion template of the preset large language model. The model suggestion template includes a task instruction area, an individual reference area, a community reference area, a user preference area, and an output constraint area. The content of the task instruction area and the content of the output constraint area are determined based on the template configuration information of the model prompt template; A time-series question-and-answer record is generated based on the first set of relevant nodes, and the time-series question-and-answer record is determined as the content of the individual reference area; A similar user Q&A summary is generated based on the second set of related nodes, and the similar user Q&A summary is determined as the content of the community reference area; The content of the user preference area is determined based on the user preference data; The task instruction area content, the individual reference area content, the community reference area content, the user preference area content, and the output constraint area content are filled into the model prompt template to generate the target prompt information.
8. A question-answering device based on retrieval enhancement generation, characterized in that, include: The information acquisition module is used to acquire the target input question and the target user identifier associated with the target input question; The personal knowledge analysis module is used to find the personal knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the first prompt node set based on the target input question and the personal knowledge subgraph; The community knowledge analysis module is used to find the community knowledge subgraph corresponding to the target user identifier from the preset knowledge graph, and determine the second prompt node set based on the target input question and the community knowledge subgraph. The prompt information determination module is used to determine user preference data based on the personal knowledge subgraph, and determine target prompt information based on the user preference data, the first prompt node set, and the second prompt node set; The answer information generation module is used to input the target input question and the target prompt information into a preset large language model to obtain target answer information corresponding to the target input question.
9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that, When the processor executes the computer-readable instructions, it implements the question-answering method based on retrieval enhancement as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing computer-readable instructions, characterized in that, When the computer-readable instructions are executed by one or more processors, the one or more processors cause the one or more processors to perform the question-answering method based on retrieval enhancement as described in any one of claims 1 to 7.