Policy question and answer processing method and system based on agent

By employing an agent-based question-answering method, utilizing a vector database and an agent execution engine to process questions related to housing provident fund policies, the system solves the challenge of distinguishing between factual and computational questions in existing systems. This generates high-quality answers that include numerical data and policy basis, thereby improving the efficiency and accuracy of the question-answering system.

CN122064779APending Publication Date: 2026-05-19CAPINFO CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CAPINFO CO LTD
Filing Date
2026-01-14
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing intelligent question-answering systems cannot effectively distinguish between factual and calculation-based questions when processing policy-related questions such as those concerning housing provident funds. This results in low response efficiency, logical biases in calculation-based questions, and a lack of dedicated calculation modules, leading to numerical errors and omissions of key points in the answers.

Method used

We employ an agent-based question-answering approach, which retrieves factual questions from a vector database and calls an agent execution engine to compute computational questions. We then combine this with a large model to generate answers and improve the quality of our answers through iterative optimization of prompts.

Benefits of technology

It enables efficient and accurate processing of Q&A regarding housing provident fund policies, generating high-quality answers that include precise figures and policy basis, thereby improving response efficiency and accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122064779A_ABST
    Figure CN122064779A_ABST
Patent Text Reader

Abstract

The invention discloses a policy question and answer processing method and system based on an agent, and relates to the technical field of artificial intelligence, and the method comprises the steps: if a query question is a factual question, generating a final answer based on a related policy text and the query question; if the query problem is a computational problem, driving the target processing agent to execute calculation to obtain a calculation result, and generating an initial cue word based on the associated policy original text and the query problem; using the initial cue word to drive the large model to generate a preliminary answer, performing difference analysis on the preliminary answer and a preset artificial standard answer to obtain a difference analysis result, generating a new cue word based on the difference analysis result, and using the new cue word to drive the large model again to generate a new answer; and when the quality of the new answer reaches a preset convergence threshold value, a final answer is generated based on the new prompt word, the calculation result and the associated policy original text, so that the problem that high-quality policy question answering cannot be realized in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a policy question-answering method and system based on intelligent agents. Background Technology

[0002] In the area of ​​policy Q&A related to housing provident funds, existing intelligent Q&A systems have significant shortcomings. Traditional systems mostly adopt a single search or generation mode, which cannot distinguish between factual questions (such as "conditions for housing provident fund withdrawal") and calculation questions (such as "calculation of housing provident fund loan amount"), resulting in low response efficiency for factual questions and logical errors that are prone to occur in calculation questions.

[0003] Furthermore, existing computational problem-solving methods lack dedicated computational modules based on policy rules, often relying on large models to directly generate results, which is prone to numerical errors. Simultaneously, the lack of an iterative optimization mechanism for prompts leads to omissions of key points and non-standard expressions in answers, failing to meet the requirement of "accurate numerical values ​​+ policy basis." In addition, while some systems have introduced search functions, these are not integrated with the computational logic and answer optimization, failing to balance accuracy, relevance, and efficiency in providing answers.

[0004] Therefore, there is an urgent need for a method that can achieve classification processing, accurate calculation, and optimized answer quality. Summary of the Invention

[0005] In view of this, the present invention proposes a policy question-answering method and system based on intelligent agents, which can achieve high-quality policy question answering.

[0006] To achieve the above objectives, the present invention provides the following technical solution: A policy question-answering method based on intelligent agents includes: In response to a user's query request, obtain the query question entered by the user and determine the question type of the query question; If the query question is a factual question, relevant policy texts corresponding to the factual question are retrieved from a pre-built vector database, and a final answer is generated based on the relevant policy texts and the query question. If the query question is a computational question, a target processing agent matching the computational question is called from the pre-built agent execution engine, and the target processing agent is driven to perform calculations to obtain the calculation results. At the same time, the relevant policy text corresponding to the target computational agent is retrieved from the vector database, and initial prompt words are generated based on the relevant policy text and the query question. The initial prompt words are used to drive the large model to generate preliminary answers. The preliminary answers are then compared with pre-set human standard answers to obtain the difference analysis results. New prompt words are generated based on the difference analysis results, and the new prompt words are used to drive the large model to generate new answers again. When the quality of the new answer reaches a preset convergence threshold, the final answer is generated based on the new prompt words, the calculation results, and the original text of the associated policy.

[0007] Based on the above technical solution, the present invention can be further improved as follows: Optionally, before the steps of obtaining the query question input by the user in response to the user's query request and determining the question type of the query question, the method further includes: Obtain the housing provident fund policy documents and convert them into high-dimensional vectors, storing them in a vector database.

[0008] Optionally, before the steps of obtaining the query question input by the user in response to the user's query request and determining the question type of the query question, the method further includes: Extract the structured rules from the housing provident fund policy documents. The structured rules include calculation expressions, parameters, and conditional logic.

[0009] Optionally, before the steps of obtaining the query question input by the user in response to the user's query request and determining the question type of the query question, the method further includes: Extract the unstructured rules from the housing provident fund policy documents, encapsulate the unstructured rules into callable intelligent agents, and store them in an independent intelligent agent execution engine.

[0010] Optionally, the step of calling a target processing agent matching the computational problem from a pre-built agent execution engine, and driving the target processing agent to perform computation to obtain the computation result, includes: Check if the target computational agent is missing any necessary parameters. If so, ask the user follow-up questions until all parameters are present. The target processing agent is driven to perform calculations to obtain the calculation results.

[0011] Optionally, the step of "when the quality of the new answer reaches a preset convergence threshold" includes: The convergence threshold is quantified by using bilingual evaluation of substitute indicators and recall-oriented text overlap evaluation indicators. When the quality improvement of the new answer generated in two consecutive iterations is less than the convergence threshold, the new answer is determined to have reached the preset convergence threshold.

[0012] Optionally, the agent-based policy question-answering processing method further includes: A two-layer caching strategy is adopted, with the first layer storing the user's query request and the final answer, and the second layer storing the calculation results of the target processing agent. When the housing provident fund policy documents are updated, the corresponding stored content in the first and second layers will be automatically updated.

[0013] An agent-based policy question-answering system includes: The judgment module is used to respond to the user's query request, obtain the query question input by the user, and determine the question type of the query question; The factual question processing module is used to retrieve relevant policy texts corresponding to the factual question from a pre-built vector database if the query question is a factual question, and generate a final answer based on the relevant policy texts and the query question; The computational problem processing module is used to, if the query problem is a computational problem, call the target processing agent matching the computational problem from the pre-built agent execution engine, drive the target processing agent to perform calculations to obtain the calculation results, and at the same time retrieve the relevant policy text corresponding to the target computational agent from the vector database, and generate initial prompt words based on the relevant policy text and the query problem; The answer optimization iteration module is used to drive the large model to generate a preliminary answer using initial prompt words, perform a difference analysis between the preliminary answer and a pre-set human standard answer to obtain the difference analysis results, generate new prompt words based on the difference analysis results, and use the new prompt words to drive the large model to generate a new answer again. The answer generation module is used to generate a final answer based on the new prompt words, the calculation results, and the original text of the associated policy when the quality of the new answer reaches a preset convergence threshold.

[0014] An electronic device includes a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the computer program to implement the steps of the method described herein.

[0015] A non-transitory computer-readable storage medium having a computer program stored thereon, the computer program implementing the steps of the method when executed by a processor.

[0016] The present invention has the following advantages: This invention presents an agent-based policy question-answering method. For factual questions, it utilizes semantic retrieval from a vector database to quickly locate relevant policy texts, avoiding information redundancy in traditional retrieval methods and generating answers with clear policy basis, thus improving response efficiency and information accuracy. For computational questions, it employs a dedicated objective processing agent to perform calculations, effectively avoiding numerical errors in results directly generated by large models. Simultaneously, it retrieves related policy texts to provide compliance support for the answer. Furthermore, an iterative optimization mechanism for prompt words uses human-generated standard answers as a benchmark to continuously correct biases in large model generation, ensuring the generation of high-quality final answers. Attached Figure Description

[0017] For illustrative and not limiting purposes, the present invention will now be described in conjunction with embodiments and accompanying drawings, wherein: Figure 1 This is a flowchart illustrating the policy question-answering method based on intelligent agents in an embodiment of the present invention. Figure 2 This is a schematic diagram of the main components of the agent-based policy question-answering processing system in an embodiment of the present invention; Figure 3 This is a schematic diagram of the knowledge storage and processing process in an embodiment of the present invention; Figure 4 This is a schematic diagram of the user query and decision-making process in an embodiment of the present invention; Figure 5 This is a flowchart illustrating the intelligent multi-turn interaction, calculation, and prompt word optimization in an embodiment of the present invention; Figure 6 This is a schematic diagram illustrating the caching mechanism and efficiency optimization process in an embodiment of the present invention; Figure 7 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation

[0018] To enable those skilled in the art to better understand the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of them. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0019] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be used interchangeably where appropriate for the embodiments of the invention described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0020] It should be noted that, where there is no conflict, the embodiments and features of the present invention can be combined with each other. The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0021] Figure 1 This is a flowchart illustrating the agent-based policy question-answering processing method according to an embodiment of the present invention, as shown below. Figure 1 As shown, the policy question-answering processing method based on intelligent agents provided in this embodiment of the invention includes the following steps S101 to S105.

[0022] S101, in response to the user's query request, obtain the query question entered by the user and determine the question type.

[0023] Before the steps of responding to a user's query request, obtaining the query question input by the user, and determining the question type of the query question, the method further includes: Receive housing provident fund policy documents, format and clean them using natural language processing (NLP) technology, and convert them into plain text.

[0024] The cleaned policy text is segmented using a pre-trained text embedding model and transformed into high-dimensional vectors, which are then stored in a vector database.

[0025] While the text is vectorized, the system invokes a specially fine-tuned rule extraction model. The rule extraction model is able to identify computational expressions (e.g., "not exceeding 15 times the account balance"), parameters (e.g., "contribution base", "contribution period"), and conditional logic (e.g., "applicable to first-time home loans") in the text.

[0026] The extracted unstructured rules are transformed into a unified structured rule format (e.g., JSON or XML) and encapsulated into callable agents or functions, stored in a separate agent computing engine. For example, a "loan limit calculation" agent is created, whose internal logic includes the identified calculation formula and all relevant parameters.

[0027] like Figure 3 As shown, Start: The process initiation node marks the official start of preprocessing.

[0028] Receiving Housing Provident Fund Policy Documents: Obtaining original policy documents (such as Housing Provident Fund Management Measures, Detailed Rules, etc. in PDF or Word format) is the data input source for the process.

[0029] Document parsing and cleaning: Using NLP (Natural Language Processing) technology, documents of different formats are converted into unified text, while irrelevant content (such as headers, footers, and duplicate paragraphs) is cleaned up, making the text standardized and easy to process.

[0030] Vectorized embedding: First, the text is split into paragraphs / sentences, and then a model (such as BERT) is used to convert it into high-dimensional vectors, which are then stored in a vector database. The goal is to enable rapid retrieval of policy content based on semantic similarity.

[0031] Automated rule extraction: Relying on NLP technology to identify rules in policies, such as "you can apply for a loan after 6 consecutive months of contributions" (a "micro-type identification"), "loan amount = contribution base × coefficient + account balance × ratio" (calculation rule), and "you need to provide a purchase contract and proof of income" (condition and requirement rule), the text rules are extracted into logic that machines can understand.

[0032] Rule structuring and Agent transformation: The extracted rules are converted into structured formats such as JSON / XML, and then encapsulated into a "computation agent". For example, the rules for calculating housing provident fund loan amounts are packaged into an intelligent agent module that can be independently invoked and automatically calculated, making it convenient to directly trigger the calculation during subsequent question answering.

[0033] The first step is completed, marking the end of policy document preprocessing. This prepares the "vectorized knowledge base" and "structured rule agent" for subsequent functions such as knowledge retrieval, intelligent question answering, and automated calculation.

[0034] The user enters a question on the interface. The question-and-answer and interaction module first parses the user's query to determine whether it is a factual question or a calculation question.

[0035] like Figure 4 As shown, the user input question is the starting point of the process. Users submit policy-related questions (such as housing provident fund withdrawal conditions, loan amount calculation, etc.) through interactive interfaces (such as web pages, APP).

[0036] The question-answering and interaction module analyzes question types: With the help of NLP technology, it performs semantic understanding and keyword extraction on user questions to determine whether they are "factual questions" (asking about static information such as policy regulations and conditions, such as "What materials are needed to withdraw housing provident fund") or "calculation questions" (involving numerical calculations and rule applications, such as "How much can I borrow with my housing provident fund?").

[0037] Problem type determination: For branch nodes, based on the parsing results, follow either the "factual" or "computational" processing path.

[0038] Branching for factual questions: Routing to the question and answer and retrieval module: The system calls a dedicated retrieval module, which, based on the question keywords, searches for matching policy text fragments in the "vector database" (which stores policy text vectors and supports semantic retrieval).

[0039] Vector similarity retrieval → Retrieving relevant policy texts: By calculating vector similarity, the policy content that best fits the problem is located, and key information is extracted.

[0040] Step 2 concludes → Factual Path: Integrate the retrieved policy texts, generate concise and clear answers with supporting evidence, provide feedback to the user, and complete the factual question processing.

[0041] Branches for computational problems: Perform the following operations simultaneously: Two sub-processes run in parallel to improve processing efficiency.

[0042] Call the Agent calculation engine → Agent corresponding to the question, check if any parameters are missing: Start the matching calculation Agent (such as the housing provident fund loan calculation Agent), first verify the parameters required for calculation (such as contribution base, years, account balance, etc.), and if missing, may ask the user to supplement them.

[0043] Knowledge retrieval → Retrieve relevant policies as context: Find the original text and applicable conditions of the calculation rules in the policy knowledge base (vector library / structured rule base) to provide policy support for the subsequent answer.

[0044] Proceed to the third step → Calculation-based path: Combining the Agent's calculation results and policy basis, and integrating them through the large model / rule engine, an answer with calculation process and policy explanation is generated (e.g., "According to policy XX, your loan amount = ..., calculated to be XX yuan"), thus completing the calculation-based problem processing.

[0045] S102, if the query question is a factual question, retrieve the relevant policy text corresponding to the factual question from the pre-built vector database, and generate the final answer based on the relevant policy text and the query question.

[0046] S103, if the query question is a computational question, the target processing agent matching the computational question is called from the pre-built agent execution engine, and the target processing agent is driven to perform calculations to obtain the calculation results. At the same time, the relevant policy text corresponding to the target computational agent is retrieved from the vector database, and initial prompt words are generated based on the relevant policy text and the query question.

[0047] Check if the target computational agent is missing any necessary parameters. If so, ask the user follow-up questions until all parameters are present. The target processing agent is driven to perform calculations to obtain the calculation results.

[0048] S104: Use the initial prompt words to drive the large model to generate a preliminary answer, perform a difference analysis between the preliminary answer and the pre-set human standard answer, obtain the difference analysis results, generate new prompt words based on the difference analysis results, and use the new prompt words to drive the large model to generate a new answer again.

[0049] Identify shortcomings in the initial answer in terms of style, key points, or structure, and new prompts (e.g., "Please add key points about the loan term," "Please make your answer more formal").

[0050] S105. When the quality of the new answer reaches the preset convergence threshold, the final answer is generated based on the new prompt words, calculation results, and the original text of the relevant policy.

[0051] like Figure 5 As shown, the third step begins: following the previous process (e.g., the problem is classified as computational), initiating in-depth processing.

[0052] Is the Agent missing any parameters? First, check if the matching calculation Agent (such as the housing provident fund loan calculation Agent) is missing any necessary calculation information (contribution base, account balance, etc.).

[0053] Yes, parameters are missing: Precisely ask users to obtain missing parameters: Through the interaction module, ask users in natural language (such as "What is your monthly housing provident fund contribution base?").

[0054] Check if all parameters are complete: After receiving user feedback, verify the completeness of the parameters. If any are still missing, continue to inquire until all parameters are complete.

[0055] No, all parameters are complete: Proceed to the next step.

[0056] Generate initial prompts: Integrate parameters, calculation scenarios, and policy-related requirements to generate initial instructions that allow the large model to understand the task (such as "Based on the housing provident fund contribution data provided by the user, combined with policy XX, calculate the loan amount, and output the calculation process and basis").

[0057] Using prompt words to drive the large model to generate preliminary answers: Based on the prompt words, the large model invokes knowledge and computational logic to produce preliminary answers containing computational / policy references.

[0058] Prompt word optimization module: Compare with the standard answer → Difference analysis (style / key points / structure): Compare the preliminary answer with the manually annotated standard answer to find differences in style (too colloquial / too obscure), key points (omitted policy clauses, calculation steps), and structure (confusing logic).

[0059] Automatic revision and iteration of prompt words → Generation of new prompt word instructions: Based on the differences, optimize the prompt words (such as adding "policy terms need to be listed in detail" or "present the calculation steps in a structured table") to form new instructions.

[0060] Regenerate answers with new prompts: The large model uses the optimized prompts to generate answers again, correcting previous issues.

[0061] Assess answer quality (using metrics such as BLEU / ROUGE): Use text similarity metrics (BLEU for word matching, ROUGE for content coverage) to quantify the fit between the answer and the standard answer.

[0062] Whether the convergence threshold has been reached: Determine whether the quality assessment results meet the preset standards (e.g., BLEU≥0.8, ROUGE≥0.85).

[0063] No: Return to the "Automatic Prompt Revision..." step and continue iterative optimization.

[0064] Yes: Proceed to the next step.

[0065] Final answer generation and fusion: Combination: Optimize prompt words + calculation results + original policy text: Integrate the iterated prompt word logic, the Agent's accurate calculation value, and the original policy text clauses.

[0066] The large-scale model integrates information from multiple sources to output a final answer that is clearly structured (including calculation process, policy basis, and conclusions) and expressed in a standardized manner.

[0067] Step 3 complete: The calculation problem is now resolved, and the answer can be provided to the user.

[0068] The final answer is generated by a comprehensive large language model, which contains both precise numerical values ​​and policy basis, and is highly optimized in terms of style and quality.

[0069] The convergence threshold is quantified by using bilingual evaluation of substitute indicators and recall-oriented text overlap evaluation indicators. When the quality improvement of the new answer generated in two consecutive iterations is less than the convergence threshold, the new answer is determined to have reached the preset convergence threshold.

[0070] The agent-based policy question-answering method further includes: A two-layer caching strategy is adopted. The first layer stores the user's query request and final answer, and the second layer stores the calculation results of the target processing agent. When a new policy document is added to the database and the Agent rules are automatically updated, all cached content related to that Agent will be automatically cleared.

[0071] When the housing provident fund policy documents are updated, the corresponding stored content in the first and second layers will be automatically updated.

[0072] like Figure 6 As shown, step 1: Start Cache Management (left-hand flow) Start Cache Management: Initiate the cache initialization / initial configuration process to pre-store high-frequency data for system operation.

[0073] Tiered caching strategy: Divide the cache into "Tier 1" and "Tier 2" and store content differently. The first layer of caching stores "user query text + final answer". For example, if a user asks "conditions for withdrawing housing provident fund" and the system-generated answer containing policy basis is cached as a key-value pair, it can be directly retrieved the next time the same question is asked, skipping complex retrieval / calculation.

[0074] The second layer of cache stores the "execution results of the calculation agent." This includes the results calculated by the housing provident fund loan amount calculation agent, as well as the "old version of related agents cached during policy updates" (stores historical rule agents for comparison / rollback to ensure compatibility during policy iterations).

[0075] II. Dynamic Cache Management (Flowchart on the right) Dynamic cache management: During system operation, the cache is dynamically maintained based on policy updates and query behavior. When a cached value is added, it is overwritten to the first-level cache: If a new query generates "user text + answer" that has not been cached, or if the cached value is updated (such as a change in the answer due to a policy adjustment), the new content is written to the first-level cache to replace the old value, ensuring that the next query retrieves the latest result.

[0076] When policies are updated, old cache sequences become invalid / updated: When housing provident fund policy documents are updated (such as adjustments to withdrawal limits or changes in loan rules), the associated old caches (especially the calculation agent results and old agent caches in the second layer) are marked as invalid, or an update process is triggered to recalculate / generate new cache content.

[0077] Reduce large model calls and improve response efficiency: By caching and reusing historical results, there is no need to call the large model to regenerate the answer and trigger the Agent calculation every time, which reduces system resource consumption and allows users to get a response faster after asking a question.

[0078] Conclusion: Dynamic caching is now complete, ensuring that cached data is "accurate, up-to-date, and efficient".

[0079] Traditional RAG systems can only perform factual question-and-answer based on text and cannot handle complex calculations. This invention, through automated formula extraction and agent encapsulation, transforms unstructured policy text into an executable computational model, which can directly provide precise numerical results such as "loanable amount," solving the problem that existing technologies cannot perform deep logical reasoning and calculations.

[0080] Existing multi-round interactions are typically passive and rely on preset rules. This invention combines the interaction with parameters required by the backend agent to achieve intelligent follow-up questions. This proactive and precise interaction method not only significantly improves the user experience but also ensures the accuracy of the final answer.

[0081] Existing systems often require frequent calls to expensive, large models when faced with repetitive or similar questions. This invention addresses this by employing intelligent hierarchical caching to minimize the number of calls to large models. This not only significantly reduces system operating costs but also dramatically improves the response speed for high-frequency question answering, making it more competitive in large-scale application scenarios.

[0082] Existing technologies rely on costly and time-consuming model fine-tuning to improve the output quality of small models. This invention, through an automated, iterative prompt word optimization mechanism, can continuously improve the response quality of small models without changing model parameters, bringing them closer to human standards in style, content coverage, and structure. This fundamentally solves the problems of high cost and low efficiency in small model performance optimization, making the solution more versatile and scalable.

[0083] Figure 2 This is a schematic diagram illustrating the main components of the agent-based policy question-answering processing system according to an embodiment of the present invention. Figure 2 As shown, the agent-based policy question-answering system 1 provided in this embodiment of the invention includes a judgment module 10, a factual question processing module 20, a computational question processing module 30, an answer optimization and iteration module 40, and an answer generation module 50. The judgment module 10 is used to respond to the user's query request, obtain the query question input by the user, and determine the question type of the query question; The factual question processing module 20 is used to retrieve relevant policy texts corresponding to the factual question from a pre-built vector database if the query question is a factual question, and generate a final answer based on the relevant policy texts and the query question; The computational problem processing module 30 is used to, if the query problem is a computational problem, call the target processing agent matching the computational problem from the pre-built agent execution engine, drive the target processing agent to perform calculations to obtain calculation results, and at the same time retrieve the relevant policy text corresponding to the target computational agent from the vector database, and generate initial prompt words based on the relevant policy text and the query problem; The answer optimization iteration module 40 is used to drive the large model to generate a preliminary answer using initial prompt words, perform a difference analysis between the preliminary answer and a pre-set human standard answer to obtain the difference analysis results, generate new prompt words based on the difference analysis results, and use the new prompt words to drive the large model to generate a new answer again. The answer generation module 50 is used to generate a final answer based on the new prompt words, the calculation results, and the original text of the associated policy when the quality of the new answer reaches a preset convergence threshold.

[0084] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 7 As shown, the electronic device 60 includes: a processor 601, a memory 602, and a bus 603; The processor 601 and the memory 602 communicate with each other via the bus 603. The processor 601 is used to call program instructions in the memory 602 to execute the methods provided in the above-described method embodiments, and to execute the methods provided in the embodiments of the present invention.

[0085] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions, which cause a computer to execute the method provided in this embodiment of the invention.

[0086] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various storage media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.

[0087] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A policy question-answering method based on intelligent agents, characterized in that, include: In response to a user's query request, obtain the query question entered by the user and determine the question type of the query question; If the query question is a factual question, relevant policy texts corresponding to the factual question are retrieved from a pre-built vector database, and a final answer is generated based on the relevant policy texts and the query question. If the query question is a computational question, a target processing agent matching the computational question is called from the pre-built agent execution engine, and the target processing agent is driven to perform calculations to obtain the calculation results. At the same time, the relevant policy text corresponding to the target computational agent is retrieved from the vector database, and initial prompt words are generated based on the relevant policy text and the query question. The initial prompt words are used to drive the large model to generate preliminary answers. The preliminary answers are then compared with pre-set human standard answers to obtain the difference analysis results. New prompt words are generated based on the difference analysis results, and the new prompt words are used to drive the large model to generate new answers again. When the quality of the new answer reaches a preset convergence threshold, the final answer is generated based on the new prompt words, the calculation results, and the original text of the associated policy.

2. The policy question-answering method based on intelligent agents according to claim 1, characterized in that, Before the steps of responding to a user's query request, obtaining the query question input by the user, and determining the question type of the query question, the method further includes: Obtain the housing provident fund policy documents and convert them into high-dimensional vectors, storing them in a vector database.

3. The policy question-answering method based on intelligent agents according to claim 2, characterized in that, Before the steps of responding to a user's query request, obtaining the query question input by the user, and determining the question type of the query question, the method further includes: Extract the structured rules from the housing provident fund policy documents. The structured rules include calculation expressions, parameters, and conditional logic.

4. The policy question-answering method based on intelligent agents according to claim 2, characterized in that, Before the steps of responding to a user's query request, obtaining the query question input by the user, and determining the question type of the query question, the method further includes: Extract the unstructured rules from the housing provident fund policy documents, encapsulate the unstructured rules into callable intelligent agents, and store them in an independent intelligent agent execution engine.

5. The policy question-answering method based on intelligent agents according to claim 1, characterized in that, The step of calling a target processing agent matching the computational problem from a pre-built agent execution engine and driving the target processing agent to perform computation to obtain the computation result includes: Check if the target computational agent is missing any necessary parameters. If so, ask the user follow-up questions until all parameters are present. The target processing agent is driven to perform calculations to obtain the calculation results.

6. The policy question-answering method based on intelligent agents according to claim 1, characterized in that, The condition that the quality of the new answer reaches a preset convergence threshold includes: The convergence threshold is quantified by using bilingual evaluation of substitute indicators and recall-oriented text overlap evaluation indicators. When the quality improvement of the new answer generated in two consecutive iterations is less than the convergence threshold, the new answer is determined to have reached the preset convergence threshold.

7. The policy question-answering method based on intelligent agents according to claim 1, characterized in that, The agent-based policy question-answering method further includes: A two-layer caching strategy is adopted, with the first layer storing the user's query request and the final answer, and the second layer storing the calculation results of the target processing agent. When the housing provident fund policy documents are updated, the corresponding stored content in the first and second layers will be automatically updated.

8. A system for policy question-answering processing based on intelligent agents, characterized in that, include: The judgment module is used to respond to the user's query request, obtain the query question input by the user, and determine the question type of the query question; The factual question processing module is used to retrieve relevant policy texts corresponding to the factual question from a pre-built vector database if the query question is a factual question, and generate a final answer based on the relevant policy texts and the query question; The computational problem processing module is used to, if the query problem is a computational problem, call the target processing agent matching the computational problem from the pre-built agent execution engine, drive the target processing agent to perform calculations to obtain the calculation results, and at the same time retrieve the relevant policy text corresponding to the target computational agent from the vector database, and generate initial prompt words based on the relevant policy text and the query problem; The answer optimization iteration module is used to drive the large model to generate a preliminary answer using initial prompt words, perform a difference analysis between the preliminary answer and a pre-set human standard answer to obtain the difference analysis results, generate new prompt words based on the difference analysis results, and use the new prompt words to drive the large model to generate a new answer again. The answer generation module is used to generate a final answer based on the new prompt words, the calculation results, and the original text of the associated policy when the quality of the new answer reaches a preset convergence threshold.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method as described in any one of claims 1 to 7.

10. A non-transitory computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7.