Modularized intelligent number asking method and system and computer readable storage medium

By using a modular task orchestration framework and a dynamic context injection mechanism, the problems of inaccurate data table filtering and poor system flexibility in existing technologies are solved, enabling efficient data analysis and self-correction in specific domains and improving the accuracy and flexibility of data query.

CN121979975APending Publication Date: 2026-05-05SHANGHAI BAOSIGHT SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI BAOSIGHT SOFTWARE CO LTD
Filing Date
2025-12-23
Publication Date
2026-05-05

AI Technical Summary

Technical Problem

In enterprise-level big data environments, existing technologies often result in a large number of data tables with complex relationships, making it difficult to dynamically select the target table most relevant to the user's intent. This leads to frequent table join errors in queries, poor system flexibility, high migration costs, and a decline in semantic understanding capabilities of general-purpose large language models when dealing with industry-specific terminology. Furthermore, data analysis tools produce incomplete outputs, failing to fully unlock the value of the data.

Method used

A modular task orchestration framework is adopted to decompose natural language problems into configurable task nodes. Combined with dynamic determination of data entity scope, dynamic context injection and closed-loop correction mechanism, a structured query language is generated through domain knowledge base and large language model to achieve white-box design and self-correction.

Benefits of technology

It enhances the system's flexibility and reusability, reduces customization and maintenance costs, improves the understanding of technical terms and query accuracy, and forms a complete closed-loop data service from problem identification to insight output, maximizing data value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121979975A_ABST
    Figure CN121979975A_ABST
Patent Text Reader

Abstract

The invention provides a modular intelligent number asking method and system and a computer readable storage medium, and belongs to the technical field of computer data processing. The method comprises the following steps: decomposing a natural language problem into a plurality of configurable task nodes based on a modular task arrangement framework, and cooperatively executing the task nodes; in the execution process, dynamically determining a data entity required by query based on the problem and the domain knowledge base; retrieving context information from the domain knowledge base, and injecting the context information into a code generation model to generate a code; and executing the code, and based on an execution result, operating a closed-loop correction mechanism to correct the code generation process. According to the method, the system flexibility is improved through modular design, the query accuracy and robustness are improved through dynamic context injection and closed-loop correction, an end-to-end intelligent data service is formed, the application threshold is effectively reduced, and the data value is maximized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer data processing technology, and more specifically, to a modular intelligent query method, system, and computer-readable storage medium. Background Technology

[0002] Currently, intelligent data analysis technologies based on large language models, especially the conversion technology from natural language to structured query language, have become an important means for enterprises to empower business personnel to directly gain insights from data. To improve query accuracy, existing technologies have proposed several solutions, such as building a data knowledge base and retrieving it upon receiving user questions to help determine the required database tables; or correcting and regenerating the structured query language based on error messages after execution failure.

[0003] However, existing technical solutions still generally suffer from several shortcomings. First, the core workflows of many systems are fixed and hard-coded, presenting a "black box" model, resulting in poor system flexibility. When business requirements change or migration to new business scenarios is necessary, significant development resources are often required for modification and adaptation, leading to high migration costs. Furthermore, business experts without technical backgrounds cannot participate in the customization and optimization of data analysis processes. Second, in enterprise-level big data environments, the number of data tables is enormous and their relationships are complex. When processing users' natural language queries, existing technologies still struggle to accurately and dynamically select the target table most relevant to the user's intent from numerous data tables. This results in frequent table join errors or queries on incorrect tables in subsequent generated queries, severely impacting the accuracy of analysis results. In addition, general-purpose big language models suffer from a lack of domain knowledge when dealing with industry-specific terminology or complex data indicators, leading to a significant decline in semantic understanding and query generation quality. Finally, the final output of most data analysis tools is limited to data tables or visualizations, failing to form a complete and automated data service loop from problem identification and data querying to insight output, thus failing to fully unlock the value of data.

[0004] Chinese patent document CN120540747A discloses an intelligent data analysis workflow system and method based on ChatBI. This document divides the workflow into stages, presets standardized prompts for each stage, and adjusts the final analysis report based on user feedback. However, it lacks the ability to dynamically filter target tables, resulting in a high error rate in table joins during SQL generation. Furthermore, the workflow is a black-box operation implemented through code, requiring significant migration costs for new business scenarios. Non-developers cannot intervene, and to cope with the data growth characteristics of big data scenarios, users need to maintain a long-term presence of maintenance personnel for this product.

[0005] Chinese patent document CN120012760A discloses a question-answering method and ChatBI system based on thought chain and intelligent agent. The document proposes a ChatBI question-answering method based on thought chain, which improves the accuracy and efficiency of data analysis through task decomposition, dynamic adjustment and intelligent agent collaboration. However, it does not solve the problem of dynamic filtering of table range, which affects the accuracy of complex queries. The thought chain is implemented based on code and cannot be flexibly configured through component operation. Summary of the Invention

[0006] To address the shortcomings of existing technologies, the purpose of this invention is to provide a modular intelligent questioning method, system, and computer-readable storage medium.

[0007] A modular intelligent question-answering method provided by the present invention includes: Based on a modular task orchestration framework, the processing tasks corresponding to the received natural language questions are decomposed into multiple configurable task nodes, and the task nodes are executed collaboratively according to the preset task flow definition. During the execution of the task flow, a mechanism for dynamically determining the scope of data entities is run. This mechanism determines one or more target data entities required for this query based on the natural language question and knowledge retrieved from the domain knowledge base. A dynamic context injection mechanism is implemented to retrieve context information related to the current task from the domain knowledge base and provide the context information to the code generation model to generate code; The SQL code is executed, and based on the execution result of the SQL code, a closed-loop correction mechanism is run to correct the SQL code when preset correction conditions are met.

[0008] Preferably, the modular task orchestration framework orchestrates the task nodes based on a directed acyclic graph, and the task nodes are multiple dedicated artificial intelligence agents.

[0009] Preferably, the domain knowledge base includes: a table name knowledge base for storing table names and descriptions, a table field knowledge base for storing field information, a business knowledge base for storing industry terminology, and an evaluation knowledge base for storing user feedback.

[0010] Preferably, the dynamic context injection mechanism is implemented based on retrieval enhancement generation technology and is used to retrieve the context information from the domain knowledge base.

[0011] Preferably, the closed-loop correction mechanism specifically includes: when the SQL execution failure is detected, merging the original problem and failure information into a prompt word, and calling the correction module to generate the correct SQL.

[0012] Preferred options also include: After the code is successfully executed and the query results are obtained, the large language model is invoked to analyze the query results and automatically generate a structured data analysis report.

[0013] Preferably, the artificial intelligence agent includes: a question completion agent for optimizing the natural language problem, a table selection agent for executing the dynamic determination of data entity range mechanism, an SQL generation agent for calling the code generation model to generate code, and an SQL execution agent for executing the code.

[0014] Preferably, the preset correction condition includes receiving negative user feedback regarding the query result; The closed-loop correction mechanism includes: upon receiving negative feedback from the user, merging new prompt words based on the user's original question and negative feedback, and invoking the correction agent to execute the correction task flow.

[0015] A modular intelligent question-and-answer system provided by the present invention includes: The task orchestration module is used to decompose the processing tasks corresponding to the received natural language questions into multiple configurable task nodes, and to collaboratively execute the task nodes according to the preset task flow definition. The data entity determination module is used to determine one or more target data entities required for this query based on the natural language question and the knowledge retrieved from the domain knowledge base during the execution of the task flow. The context generation and injection module is used to retrieve context information related to the current task from the domain knowledge base and provide the context information to the SQL generation model to generate SQL code; The closed-loop correction module is used to execute the SQL code and, based on the execution result of the SQL code, correct the SQL code when a preset correction condition is met.

[0016] According to the present invention, a computer-readable storage medium is provided thereon storing a computer program, which, when executed by a processor, implements the modular intelligent questioning method described above.

[0017] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention uses a modular task orchestration framework to decompose the complex conversion process from natural language to structured query language into configurable and orchestratable nodes, achieving a "white-box" design. This allows non-developers to participate in building and adjusting data analysis processes, greatly improving flexibility and reusability, and reducing customization and maintenance costs for different business scenarios.

[0018] 2. This invention provides accurate domain knowledge for general-purpose large language models by constructing a multi-dimensional domain knowledge base and adopting a dynamic context injection mechanism, which significantly improves the ability to understand professional terms and the accuracy of code generation in specific vertical domains.

[0019] 3. The present invention is based on a closed-loop correction mechanism for SQL execution results, which enables the system to automatically correct itself from the results of execution failures, thereby enhancing the robustness of the system and improving the correctness of natural language to SQL conversion.

[0020] 4. This invention, through a mechanism of pre-selecting the range of data entities, accurately defines the target range for large models in massive data sources, effectively reducing association errors caused by incorrect table selection, and ensuring query quality from the source.

[0021] 5. This invention extends the data analysis process from simple chart output to automatic generation of in-depth analysis reports, forming a complete, closed-loop intelligent data service from problem identification and data query to insight output, maximizing the value of data. Attached Figure Description

[0022] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 A schematic diagram of the architecture of a modular intelligent question-and-answer system provided in this application embodiment; Figure 2 A flowchart illustrating a modular intelligent question-answering method provided in one embodiment of this application; Figure 3 A flowchart of the modular intelligent question-answering core method provided in this application; Figure 4 This is a schematic diagram of the task chain process developed based on the intelligent agent platform provided by the present invention.

[0023] Explanation of reference numerals in the attached figures: Detailed Implementation

[0024] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.

[0025] Example 1 This embodiment provides a modular intelligent query method and system based on a dedicated artificial intelligence agent and a directed acyclic graph. Specifically, this embodiment aims to illustrate a "white-box" end-to-end data analysis solution, which decomposes the complex task of converting natural language to structured query language into a series of independently configurable and freely orchestratable task nodes. By dynamically injecting domain knowledge and a closed-loop correction mechanism, it aims to significantly improve the accuracy, flexibility, and robustness of data querying in professional business scenarios.

[0026] Please see Figure 1 The diagram illustrates the architecture of a modular intelligent question-and-answer system provided in this application embodiment. The system can be physically deployed on a single server, a server cluster, or in a cloud environment. Its core logical components include: a task orchestration engine 10, a task node library 20, a multi-dimensional knowledge base 30, a code generation model interface 40, and a data source interface 50.

[0027] The task orchestration engine 10, as the core scheduling component of the system, functions to schedule and manage the entire data query and analysis process according to a preset task flow definition. It can be understood that the task flow definition can be a structure based on a directed acyclic graph, where each node represents a specific processing task, and the edges between nodes represent the execution order and data dependencies between tasks. This design allows business analysts or domain experts to build or modify data analysis processes using the functional modules in the task node library 20 through a visual interface by dragging and dropping, without writing underlying code.

[0028] The task node library 20 is a collection storing multiple reusable task nodes. In one embodiment of this application, these task nodes are implemented as a series of dedicated artificial intelligence agents, each with specific responsibilities, such as problem completion, data entity identification, code generation, code execution, chart analysis, or report generation. This design decomposes large tasks into a series of focused sub-tasks, thereby facilitating independent development, testing, optimization, and reuse.

[0029] The multi-dimensional knowledge base 30 is a core component providing domain-specific expertise for SQL generation models. It is not a single database, but rather a collection of multiple specialized knowledge bases used to store metadata, business rules, terminology, and historical experience relevant to specific business domains. By providing accurate and timely contextual information to general-purpose language models, it significantly enhances their understanding and reasoning capabilities within specific domains.

[0030] The SQL generation model interface 40 serves as a bridge for communication between the system and the underlying large language model. It is responsible for sending the rich contextual prompts constructed by the upstream task nodes to the large language model in a specific format (e.g., through application programming interface calls), and receiving the generated results returned by the model, such as structured query language code or analysis report text.

[0031] Data source interface 50 is responsible for connecting to and operating various data sources in the enterprise's backend, including but not limited to data warehouses, databases, or data lakes. It receives SQL code generated by task nodes, executes queries against the target data source after authorization, and returns the data results to the upstream task nodes for further processing.

[0032] The following will combine Figure 2 The specific process of the modular intelligent question-answering method provided in this embodiment will be described in detail. Figure 2 This is a detailed flowchart of the method in Embodiment 1 of this application.

[0033] The entire process begins in step S101, where the user inputs a natural language question through the user interface of their user terminal (e.g., a web browser or desktop application). As an optional implementation, the user can pre-select from a range of tables before asking the question. For example, if the user knows their question is related to sales and regions, they can pre-select the "Sales Fact Table" and the "Regional Dimension Table" to initially narrow down the data entities, providing guidance for subsequent precise determination. In this embodiment, the user inputs the question: "Query the top sales performer and sales amount in the East China region last quarter." The user terminal encapsulates this question into a query request and sends it to the system's task orchestration engine.

[0034] Upon receiving the request, the task orchestration engine, based on the preset task flow definition, initiates the first task node, the question completion agent, to execute step S102: question completion. The role of the question completion agent is to clarify and optimize the user's original question, making it more explicit and unambiguous. This agent can combine the contextual history of the conversation (e.g., the user has defined a specific time range for "last quarter" in previous conversations) or call internal date and time processing functions to convert the vague "last quarter" into the precise "fourth quarter of 2023," and clarify the implicit intent of "sales champion." The optimized question might become: "Query the name of the salesperson with the highest sales volume in the East China region and their total sales amount in the fourth quarter of 2023." This step ensures that all subsequent processing is based on a clear and accurate input.

[0035] Subsequently, the task orchestration engine passes the optimized question to the table selection agent to initiate steps S103 and S104, namely, knowledge base retrieval and determination of table entities. This process is the core embodiment of the mechanism for dynamically determining the scope of data entities. After receiving the task execution instruction, the table selection agent performs the following operations: First, it uses retrieval-enhanced generation technology to convert key concepts in the optimized question, such as "sales region," "East China region," "sales amount," and "salesperson name," into high-dimensional vectors through a text embedding model. Then, it performs vector similarity retrieval in parallel in the multi-dimensional knowledge base 30. In this embodiment, the multi-dimensional knowledge base 30 specifically includes four categories: 1. Table name knowledge base: stores the table names, natural language descriptions, business meanings, and possible aliases of all tables in the database. For example, a record can be {"table_name": "sales_fact", "description":"Sales fact table, recording detailed information of each sales order"}. 2. Table field knowledge base: used to store the field names, natural language descriptions, data types, comments, and meanings of enumerated values ​​for each table. For example, {"table_name": "sales_fact", "column_name": "amount", "description": "sales amount", "data_type": "DECIMAL(18,2)"}. 3. Business Knowledge Base: This stores industry-specific terminology, business jargon, indicator definitions, and calculation logic. For example, {"term": "sales champion", "definition": "the salesperson with the highest total sales within a specified time and region"}. 4. Evaluation Knowledge Base: This stores successful and unsuccessful cases from historical queries, including user questions, generated code, execution results, and user feedback. It retrieves evaluation knowledge base information based on user questions, and the retrieved question-and-answer pairs are used to supplement system prompts (e.g., likes or dislikes).

[0036] By searching these knowledge bases, the table selection agent can find the most relevant information fragments to the question. For example, it will find that "sales revenue" is highly correlated with the amount field of the sales_fact table, "sales region" is related to the region_name field of the dim_region table, and "salesperson name" is related to the employee_name field of the dim_employee table. Finally, in step S104, the table selection agent integrates all the retrieved information and, through a sorting and filtering algorithm, ultimately determines that the data entities required for this query are the three tables: sales_fact, dim_region, and dim_employee. It then returns this determined table entity information to the task orchestration engine.

[0037] The task orchestration engine passes the optimized question, the determined table entity information, and relevant knowledge fragments retrieved from the knowledge base to the structured query language (SCL) generation agent to execute steps S105 and S106, namely, generating prompt terms and generating SCL code. This is the core manifestation of the dynamic context injection mechanism. In step S105, the core task of the SCL generation agent is to construct a high-quality, information-rich prompt term. This prompt term typically includes the following parts: The instruction section explicitly indicates the tasks that the large language model needs to complete, such as "Please generate a piece of structured query language code that can be executed on the target database based on the following information".

[0038] The data table structure section provides the precise definition of the tables required for this query, including the table name information and the names, types, and comments of all relevant fields.

[0039] Domain knowledge section: Inject key information retrieved from the business knowledge base, such as "Business rule: Sales champion refers to the salesperson with the highest total sales."

[0040] Evaluation feedback section: Inject like and dislike information retrieved from the evaluation knowledge base, and provide it to the large model as an example reference in JSON format {"Question", "Likes and Dislikes", "Original Answer", "Modified Answer (if it is a Dislike)"}.

[0041] Issues section: Provides completed and optimized user issues.

[0042] Formatting Requirements: Specifies the output format, such as outputting only the query SQL itself without any explanatory text.

[0043] In step S106, the structured query language generating agent sends the carefully crafted prompt words to a pre-configured large language model via the code generation model interface 40. After understanding the complete context, the large language model generates the corresponding structured query language code.

[0044] The generated code is returned to the task orchestration engine.

[0045] Next, the task orchestration engine delivers the generated SQL code to the data source interface for query execution, step S107: Execution of Structured Query Language (SCL) code. This interface first performs a series of security checks, such as verifying whether the code contains high-risk operations (e.g., deleting tables, updating data), and determining whether the current user has query permissions for the data tables involved in the code based on their authentication information. After confirming that security and permissions are correct, the SQL code is executed in the target database.

[0046] Subsequently, the process enters step S108 to judge the execution result. Here, a closed-loop correction mechanism based on the code execution result is reflected. If the code execution fails (for example, due to a syntax error caused by inconsistent table names or field names in the database with those generated by the model), the database will return an error message, which is captured by the Structured Query Language (SQL) execution agent. At this time, the preset correction condition is met, and the system triggers the closed-loop correction process, that is, step S109. The SQL execution agent repackages the original question, the failed code, and the error message returned by the database into a new prompt, and then calls the large language model through the SQL generation agent again, requesting it to correct according to the error message and generate new code. It should be noted that a maximum number of retries (for example, 3 times) can be set for this process to avoid infinite loops. Thus, the self-correction ability for code execution failures is achieved. If the code execution is successful, the database will return a query result set, such as [{"employee_name": "Zhang San", "total_sales": 5000000}]. At this time, the process enters the success branch. As an optimal solution, the system will asynchronously record the successful "question-code-result" triple, along with a "success" label, into the evaluation knowledge base for future model fine-tuning or as a reference case for subsequent queries.

[0047] After the code is successfully executed, the task flow continues. The task orchestration engine can pass the query result to the chart analysis agent. This agent can analyze the structure of the returned data (for example, containing one dimension and one metric), and determine the most suitable visualization method. In this example, it may recommend using a metric card to display the name and sales amount of the sales champion, or using a bar chart to display the top salespersons ranked by sales amount.

[0048] Finally, the task orchestration engine calls the intelligent report generation agent to execute step S110: generate an intelligent report. This agent receives the original question and the final query data result, and uses a preset report template prompt, combines this information, and calls the large language model again to generate a text of an easy-to-understand and conclusive analysis report, such as: "According to the data, the sales champion in the East China region in the fourth quarter of 2023 is Zhang San, and his total sales reached 5 million yuan, with outstanding performance." Finally, the system presents the generated analysis report, data table, and recommended visualization charts to the user terminal, thus completing an end-to-end intelligent data query service from natural language questions to in-depth insight outputs.

[0049] Embodiment 2 This embodiment, based on Embodiment 1, deepens and expands the "closed-loop correction mechanism based on code execution results," demonstrating a more intelligent and deeper adaptive correction loop based on explicit user feedback. This mechanism can not only handle technical code execution failures but also learn and correct deviations in understanding the user's business intent.

[0050] In this embodiment, both the system's user interface and backend logic have been enhanced accordingly. After step S110 generates the final chart and presents it to the user, clear feedback controls, such as "Satisfied" (like) and "Dissatisfied" (dislike), will be attached next to the questions and answers. The structure of the evaluation knowledge base has also been expanded. In addition to recording successful or failed executions, it can also record in detail the user's evaluation of each successful query result, including the question, code, result data, and whether the user "liked" or "disliked".

[0051] Imagine a new scenario: the system-generated Structured Query Language (SCL) code is technically correct, executes successfully in the database, and returns data. However, this result is not what the user actually wants. For example, a user asks, "Query churned customers from last quarter." The system might interpret this as "customers who did not make any purchases last quarter," but the user's definition of "churned customer" is actually "customers who have not made any purchases for two consecutive quarters." The code generated by the system based on the former interpretation executes successfully and returns a result, but the user finds the result unsatisfactory and clicks the "Dissatisfied" button.

[0052] At this point, a new preset correction condition is met: "Negative user feedback on the query results is received." The closed-loop correction mechanism is then triggered, but its execution logic is completely different from the failure retry in Example 1: 1. Trigger Signal: The user's "dislike" behavior is recorded in the evaluation knowledge base, triggering a correction event. 2. Root Cause Judgment: The closed-loop correction module analyzes the event and finds that the code execution status is "successful," but the user feedback is "negative." Based on this, it can be determined that the root cause of the deviation is not in the technical aspects of code generation, but more likely in the upstream understanding of user intent, especially in the selection of data entities or the interpretation of business rules. 3. Upstream Correction: Accordingly, the correction module will not simply have the structured query language generation agent regenerate the code with the input unchanged. Instead, it will send a "correction request" signal to the upstream node of the task flow, such as the table selection agent or a dedicated business rule understanding agent. This signal includes key negative feedback information, including the user's original question, the version of the query code rejected by the user, and the query results. 4. Parameter Adjustment and Re-execution: Upon receiving a correction request, the table selection agent utilizes this negative feedback to adjust its internal parameters. For example, during its knowledge base retrieval process, it might dynamically reduce the weight of business rules strongly correlated with the rejected result (such as "Definition of Churned Customer 1") while increasing the weight of other candidate rules (such as "Definition of Churned Customer 2"). Alternatively, if the problem lies in table selection, it will lower the priority of the currently used table and attempt to select a suboptimal combination of candidate tables. 5. Restarting Downstream Processes: After parameter adjustment, the table selection agent outputs a new set of more probable data entities or business rules. Then, the task orchestration engine restarts from this node, re-executing all subsequent downstream tasks, including generating new prompts, generating new code, executing the code, and presenting it to the user.

[0053] In this way, the system achieves a deeper, more interactive learning cycle. It no longer merely fixes technical errors, but gradually learns and approximates the user's true business intent through interaction. When dealing with complex and ambiguous query scenarios, even if the user does not get a satisfactory result the first time, the system can self-optimize based on user feedback and ultimately provide an accurate answer, thereby improving the user experience and system adaptability in complex query scenarios.

[0054] Example 3 This embodiment demonstrates an implementation method for a "custom intelligent data retrieval system based on a white-box mechanism," where users can autonomously orchestrate task chains through a visual interface, including: Node parameter adjustment: Supports dynamic configuration of parameters for nodes such as data query, model call, and knowledge base retrieval, such as setting knowledge base retrieval mode, historical session range, and model temperature parameters.

[0055] Agent Insertion and Association: Users can add custom agents (such as data comparison agents), specify their functions by editing prompts (e.g., "Please compare the following two sets of data to calculate year-on-year and month-on-month indicators"), and establish associations with historical session rounds. The system uses the intent recognition module to determine the current question type and automatically triggers the corresponding agent to perform the task. In this embodiment, users can modify the task chain to meet specific needs. For example, a user might want to perform data comparison after multiple conversations. The first question could be: "Query last year's air conditioner sales data in Beijing." The second question could be: "Query this year's air conditioner sales data in Beijing." After completing these two rounds of tasks, the user could ask again: "Please compare the two sets of sales data." The user can add a data comparison agent, editing the user prompt within it: "Please help me compare the following two sets of data to obtain year-on-year and month-on-month results." By associating the agent with historical conversation rounds, and determining that the current question's intent is comparison, the data comparison agent can retrieve historical question-and-answer results and generate the comparison results.

[0056] In this embodiment, building upon the multi-turn dialogue, after obtaining the comparison results of the multi-turn dialogue, the user wants to generate a decision report based on the comparison results. In step S110, generating the intelligent report, the user can arrange the task themselves, such as adding a decision knowledge base search, and then modifying the intelligent report prompt: "I need to generate a decision report based on the above data and decision-making solutions." The final step, generating the intelligent report in S110, will produce a report that is more applicable to the current business and more readily adoptable.

[0057] In this embodiment, the user completes the data comparison and intelligent decision-making requirements by adding data comparison agents, editing agent prompts, and linking to the decision knowledge base. All operations (task orchestration, parameter adjustment, agent insertion) are completed through a visual interface, requiring no coding and lowering the technical threshold.

[0058] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.

Claims

1. A modular intelligent question-answering method, characterized in that, include: Based on a modular task orchestration framework, the processing tasks corresponding to the received natural language questions are decomposed into multiple configurable task nodes, and the task nodes are executed collaboratively according to the preset task flow definition. During the execution of the task flow, a mechanism for dynamically determining the scope of data entities is run. This mechanism determines one or more target data entities required for this query based on the natural language question and knowledge retrieved from the domain knowledge base. A dynamic context injection mechanism is implemented to retrieve context information related to the current task from the domain knowledge base and provide the context information to the code generation model to generate code; The SQL code is executed, and based on the execution result of the SQL code, a closed-loop correction mechanism is run to correct the SQL code when preset correction conditions are met.

2. The modular intelligent question-answering method according to claim 1, characterized in that, The modular task orchestration framework orchestrates the task nodes based on a directed acyclic graph, and each task node is a dedicated artificial intelligence agent.

3. The modular intelligent question-answering method according to claim 1, characterized in that, The domain knowledge base includes: a table name knowledge base for storing table names and descriptions, a table field knowledge base for storing field information, a business knowledge base for storing industry terminology, and an evaluation knowledge base for storing user feedback.

4. The modular intelligent question-answering method according to claim 1, characterized in that, The dynamic context injection mechanism is implemented based on retrieval enhancement generation technology and is used to retrieve the context information from the domain knowledge base.

5. The modular intelligent question-answering method according to claim 1, characterized in that, The closed-loop correction mechanism specifically includes: when the SQL execution failure is detected, merging the original problem and failure information into a prompt word, and calling the correction module to generate the correct SQL.

6. The modular intelligent question-answering method according to claim 1, characterized in that, Also includes: After the code is successfully executed and the query results are obtained, the large language model is invoked to analyze the query results and automatically generate a structured data analysis report.

7. The modular intelligent question-answering method according to claim 2, characterized in that, The artificial intelligence agent includes: a question completion agent for optimizing the natural language problem, a table selection agent for executing the dynamic determination of data entity range mechanism, an SQL generation agent for calling the code generation model to generate code, and an SQL execution agent for executing the code.

8. The modular intelligent question-answering method according to claim 1, characterized in that, The preset correction conditions include receiving negative user feedback regarding the query results; The closed-loop correction mechanism includes: upon receiving negative feedback from the user, merging new prompt words based on the user's original question and negative feedback, and invoking the correction agent to execute the correction task flow.

9. A modular intelligent questioning system, characterized in that, include: The task orchestration module is used to decompose the processing tasks corresponding to the received natural language questions into multiple configurable task nodes, and to collaboratively execute the task nodes according to the preset task flow definition. The data entity determination module is used to determine one or more target data entities required for this query based on the natural language question and the knowledge retrieved from the domain knowledge base during the execution of the task flow. The context generation and injection module is used to retrieve context information related to the current task from the domain knowledge base and provide the context information to the SQL generation model to generate SQL code; The closed-loop correction module is used to execute the SQL code and, based on the execution result of the SQL code, correct the SQL code when a preset correction condition is met.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the modular intelligent questioning method as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Question and answer method based on thinking chain and intelligent agent and ChatBI system

    CN120012760A

  • Intelligent data analysis workflow system and method based on ChatBI

    CN120540747A