Multi-agent driven ChatBI data analysis agile construction and intelligent interaction system and method
The multi-agent-driven ChatBI system solves the problems of high threshold, limited semantic understanding and single display of traditional data analysis tools through memory retrieval, task decomposition and multiple display methods, and realizes efficient and flexible data analysis and interaction.
Patent Information
- Application Number
- CN202510927490.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-21
AI Technical Summary
Traditional data analysis tools have high barriers to entry, limited semantic understanding, single functions, and single result presentation, making it difficult to meet the diverse needs of users.
The ChatBI system is driven by multiple agents, including Chat agent, task planning agent, NL2SQL agent, PythonUse agent and data analysis agent. It realizes user-friendly data analysis and interaction through memory retrieval, rhetorical clarification, task decomposition, semantic conversion, code generation and various display methods.
It improves the accuracy and flexibility of data analysis, supports multiple query tasks and display forms, meets the diverse needs of different users, and improves data readability and value transfer efficiency.
Smart Images

Figure CN120821737A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and specifically to a multi-agent driven ChatBI data analysis agile construction and intelligent interaction system and method. Background Art
[0002] In the current data analysis field, users face many challenges when performing data query, analysis, and visualization:
[0003] High technical threshold: Traditional data analysis tools rely on professional SQL knowledge for data query, which makes it difficult for ordinary business personnel to operate directly.
[0004] Limitations of semantic understanding: Some natural language processing technologies lack accuracy when understanding users' complex and ambiguous data analysis needs, resulting in analysis results that deviate significantly from expectations.
[0005] Single function: Most existing systems only support SQL queries and cannot effectively execute complex non-SQL query tasks (such as complex data processing involving specific algorithms).
[0006] Single result display: In terms of displaying data analysis results, there is a lack of diversified presentation forms, which makes it difficult to meet the diverse needs of different users for data visualization. Summary of the Invention
[0007] The purpose of the present invention is to provide a multi-agent driven ChatBI data analysis agile construction and intelligent interaction system and method to solve the problems raised in the above background technology.
[0008] To achieve the above-mentioned objectives, the present invention provides the following technical solutions: a multi-agent driven ChatBI data analysis agile construction and intelligent interaction system, comprising: a Chat agent, which is used to retrieve historical conversations, data processing experience, and user preference information related to the question in the memory bank after the user inputs a question to assist in understanding the user's question background and potential needs; guide and supplement key information for vague or incomplete user questions through rhetorical questions; use natural language processing technology to identify the analysis intention in the user's questions and plan the preliminary analysis path; and convert the user's natural language expression of the question into a standardized expression.
[0009] Preferably, it also includes: a task planning agent, which is used to decompose the data analysis task into multiple subtasks according to the preliminary analysis path planned by the Chat agent, and determine the execution order and dependency relationship of each subtask; in the subtask execution stage, the corresponding agent is scheduled to execute each subtask, and the execution result of each subtask is checked for data format, data range rationality, and logical correctness; the verified subtask results are integrated, and the results can be displayed together or separately according to user needs.
[0010] Preferably, it also includes: an NL2SQL agent, which is used to convert the user's questions processed by the Chat agent into semantic SQL based on the data structure information and semantic model in the knowledge base, thereby realizing the initial conversion from natural language to database query language; according to the specific database type used, the semantic SQL is further converted into the corresponding physical SQL, so that the database can directly execute the query operation to obtain the required data.
[0011] Preferably, it also includes: PythonUse intelligent agent, which is used to generate corresponding Python code for non-SQL query tasks; manage required third-party libraries to ensure the integrity of the code running environment; execute Python code and summarize the running results to supplement functional scenarios that traditional SQL queries cannot cover.
[0012] Preferably, it also includes: a data analysis agent, which is used to integrate and summarize the query results of the NL2SQL agent and the processing results of the PythonUse agent to form a complete data set; use data analysis algorithms and models to deeply analyze and interpret the summarized data, and explore the patterns and value behind the data; generate a variety of display results such as bar charts, line charts, pie charts, and reports based on the analysis results and user needs; and a result display module, which is used to display the visualization results generated by the data analysis agent in a suitable format to facilitate users to view and understand the analysis results.
[0013] A method for agile construction and intelligent interaction system of ChatBI data analysis driven by multiple agents, including the following steps: after the user inputs a question, the Chat agent retrieves historical conversations, data processing experience, and user preference information related to the question in the memory bank, and uses the retrieved information to assist in understanding the background and potential needs of the user's current question; for user questions that are vague or incomplete, the user is guided to supplement key information by asking questions in a counter-questioning manner; natural language processing technology is used to identify the analytical intent in the user's question and plan a preliminary analysis path; and the question expressed in the user's natural language is converted into a standardized expression.
[0014] Preferably, the method further comprises the following steps:
[0015] The task planning agent breaks down the data analysis task into multiple subtasks based on the preliminary analysis path planned by the Chat agent, and determines the execution order and dependencies of each subtask; in the subtask execution phase, it schedules the corresponding agent to execute each subtask, and verifies the execution results of each subtask by checking the data format, data range rationality, and logical correctness; it integrates the verified subtask results, and displays the results together or separately according to user needs.
[0016] Preferably, the method further comprises the following steps:
[0017] Based on the data structure information and semantic model in the knowledge base, the NL2SQL agent converts the user's questions processed by the Chat agent into semantic SQL, realizing the initial conversion from natural language to database query language; according to the specific database type used, the semantic SQL is further converted into the corresponding physical SQL so that the database can directly execute query operations to obtain the required data.
[0018] Preferably, the following steps are also included: the PythonUse agent generates corresponding Python code for non-SQL query tasks; manages the required third-party libraries to ensure the integrity of the code running environment; executes the Python code and summarizes the running results to supplement the functional scenarios that traditional SQL queries cannot cover.
[0019] Preferably, the following steps are also included: the data analysis agent integrates and summarizes the query results of the NL2SQL agent and the processing results of the PythonUse agent to form a complete data set; uses data analysis algorithms and models to deeply analyze and interpret the summarized data to explore the patterns and value behind the data; generates a variety of display results such as bar charts, line charts, pie charts, and reports based on the analysis results and user needs; and displays the generated visualization results in a suitable format to facilitate users to view and understand the analysis results.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] The multi-agent-driven ChatBI data analysis agile construction and intelligent interaction system and method proposed in this paper ensures the scientific nature of the data analysis process through the rational decomposition and sequencing of tasks by the task planning agent. Memory retrieval provides rich background information for understanding user questions, and a counter-question clarification mechanism accurately identifies user needs. The combination of these three effectively improves the accuracy of the entire process, from understanding user questions to outputting analysis results. Furthermore, the task planning agent verifies the execution results of each subtask, further ensuring the accuracy of the final integrated results.
[0022] The introduction of the Python Use agent breaks through the limitations of traditional reliance on SQL queries and can execute various non-SQL query tasks, greatly expanding the system's data processing capabilities and application scenarios.
[0023] The data analysis agent not only aggregates results but also generates multiple display options to meet the data visualization needs of different users in different scenarios, improving data readability and value delivery. The task planning agent supports both combined and separate display of results, providing users with more flexible viewing options based on their specific needs and usage scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 Flow chart of the method of the present invention. DETAILED DESCRIPTION
[0025] In order to clearly and completely describe the objectives and technical solutions of the present invention and make the advantages more clearly understood, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are part of the embodiments of the present invention, not all of them, and are only used to explain the embodiments of the present invention, not to limit the embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.
[0026] In the first embodiment, the present invention provides a technical solution: a multi-agent driven ChatBI data analysis agile construction and intelligent interaction system, comprising:
[0027] 1. Chat Agent
[0028] Memory Retrieval: When a user enters a question, the Chat agent first searches its memory bank for relevant information, including past conversations, data processing experience, and user preferences. This historical information helps the agent understand the context and potential needs of the user's current question. For example, if a user has previously focused on a certain data metric, the agent can prioritize relevant dimensions when asking the question again.
[0029] Clarification: For ambiguous or incomplete user questions, the Chat agent uses counter-questions to guide users to provide key information. For example, when a user asks, "What are the sales figures?", the agent responds with, "For which time period, region, or product line do you want to know?" This accurately identifies the user's needs.
[0030] Identify analytical intent and plan a path: Leverage natural language processing technology to identify analytical intent within user questions, such as statistics, comparisons, and trend analysis. Based on the identification results, plan a preliminary analytical path to provide guidance for subsequent tasks.
[0031] Question rewriting: Convert the user's natural language questions into standardized expressions that are more consistent with the subsequent intelligent agent processing logic, facilitating accurate processing.
[0032] 2. Task Planning Agent
[0033] Based on the preliminary analysis path planned by the Chat agent, the task is further refined. The entire data analysis task is broken down into multiple subtasks, and the execution order and dependencies of each subtask are determined, such as performing data query first, then data cleaning, and finally data analysis. During the subtask execution phase, the task planning agent schedules the corresponding agents to execute each subtask and verifies the execution results of each subtask. Verification methods include data format checking, data range rationality checking, logical correctness checking, etc. For example, for data query subtasks, check whether the returned data fields are complete and whether the data type is correct; for data analysis subtasks, check whether the calculation results are within a reasonable numerical range, etc. Finally, the task planning agent integrates the verified subtask results and supports combining or displaying the results separately according to user needs.
[0034] 3.NL2SQL Agent
[0035] Semantic SQL generation: Based on the data structure information (such as table structure, field meaning, etc.) and semantic model in the knowledge base, the user's questions processed by the Chat agent are converted into semantic SQL, realizing the initial conversion from natural language to database query language.
[0036] Physical SQL conversion: Depending on the specific database type used (such as MySQL, Postgres, etc.), semantic SQL is further converted into corresponding physical SQL, allowing the database to directly execute query operations and obtain the required data.
[0037] 4. Python Use Agent
[0038] Generate Python code for non-SQL query tasks (such as complex numerical calculations, text processing, and machine learning model applications). Manage required third-party libraries to ensure the integrity of the code runtime environment. Execute Python code and summarize the results, supplementing functional scenarios that traditional SQL queries cannot cover.
[0039] 5. Data Analysis Agent
[0040] Result aggregation: The query results of the NL2SQL agent and the processing results of the Python Use agent are aggregated and summarized, and data from different sources and formats are processed uniformly to form a complete dataset.
[0041] Data interpretation and presentation generation: Utilizing data analysis algorithms and models, we conduct in-depth analysis and interpretation of aggregated data, uncovering the patterns and value underlying the data. Based on the analysis results and user needs, we generate a variety of presentations, such as bar charts, line charts, pie charts, and reports, to meet diverse user visualization needs.
[0042] 6. Results presentation
[0043] The visualization results generated by the data analysis agent are displayed in a suitable format (such as HTML, PPT, etc.) to facilitate users to view and understand the analysis results.
[0044] Example 2, based on Example 1, proposes a method for agile construction of ChatBI data analysis and intelligent interaction system driven by multiple agents, including the following steps:
[0045] (1) System construction environment
[0046] Hardware environment: It is recommended to use a high-performance server with sufficient computing resources (such as multi-core CPU, large-capacity memory, etc.) and storage resources to support parallel computing of multiple agents and storage and processing of large amounts of data.
[0047] Software Environment: The operating system can be a mainstream server operating system such as Linux or Windows Server. The database management system can be selected based on needs, such as MySQL or Postgres. Python is the primary programming language, leveraging its rich third-party library support to implement various agent functions. Natural language processing frameworks (such as NLTK and spaCy) and data analysis and visualization libraries (such as Pandas, Matplotlib, and Seaborn) are also utilized to assist in development.
[0048] (2) Running process instance
[0049] Suppose the user asks the question: "Analyze the sales profit trends of different product lines in the past year, and compare the profit share of each product line in each quarter."
[0050] 1. Chat Agent Processing
[0051] Memory retrieval: Search the memory database to see if the user has had any previous questions or processing records regarding sales data, product lines, etc. If so, extract relevant information for reference.
[0052] Counter-question clarification: Confirm the specific starting time of the "past year" mentioned by the user, and whether there are special requirements for the calculation method of "sales profit", etc.
[0053] Identify analysis intentions and plan paths: Identify the user's intention to perform trend analysis (sales profit trends over the past year) and comparative analysis (comparison of quarterly profit share of each product line), and plan a preliminary analysis path that first obtains sales data and then performs trend calculations and share calculations respectively.
[0054] Rewrite the question: Rewrite the user's question into a more standardized statement, such as "Obtain the sales data of each product line in the past year ([specific start time] - [specific end time]), analyze the changing trends of its sales profits over time, and calculate the proportion of each product line's profit to the total profit in each quarter and compare them."
[0055] 2. Task Planning Agent Processing
[0056] The task is broken down into the following steps: acquiring sales data (performed by the NL2SQL agent executing SQL queries), calculating sales profit (which may involve specific computational logic processing by the Python Use agent), calculating profit trends (which can be implemented by the Data Analysis agent using mathematical algorithms), calculating quarterly profit share (performed by the Data Analysis agent), and performing comparative analysis (performed by the Data Analysis agent). The order of task execution is determined as follows: first acquiring sales data, then calculating sales profit, then calculating profit trends and quarterly profit share, and finally performing comparative analysis.
[0057] 3. Subtask execution and verification:
[0058] Schedule the NL2SQL agent to execute the task of obtaining sales data. After the execution is completed, check the field integrity and data type correctness of the returned data. If it does not meet the requirements, return and re-query.
[0059] If the sales profit calculation requires the participation of the Python Use agent, schedule it to generate and execute code to verify whether the calculation results conform to the expected logic and numerical range. If there are any errors, troubleshoot the code problems and recalculate.
[0060] The data analysis agent is scheduled to perform profit trend calculations and quarterly profit ratio calculations and comparative analysis to verify the rationality of each analysis result, such as whether the trend line conforms to the business logic and whether the ratio calculation is accurate.
[0061] Result integration: Integrate the verified subtask results and decide whether to combine them for presentation (such as presenting all analysis results in a comprehensive report) or present them separately (such as displaying trend charts and percentage comparison charts separately) based on whether the user has special display requirements.
[0062] 4.NL2SQL Agent Processing
[0063] Based on the task plan and the rewritten problem statement, combined with the sales data table structure information in the knowledge base, semantic SQL is generated, such as "SELECT product line, time, sales, cost FROM sales table WHERE time BETWEEN [specific start time] AND [specific end time]". This is then converted into physical SQL in the corresponding database and executed to obtain sales data.
[0064] 5. Python Use Agent Processing
[0065] If the calculation of sales profit involves complex algorithms (such as a custom cost allocation algorithm), generate the corresponding Python code, call the relevant third-party library for calculation, obtain the sales profit corresponding to each data record, and summarize the results.
[0066] 6. Data Analysis Agent Processing
[0067] Result summary: Integrate the sales data obtained by the NL2SQL agent and the sales profit data calculated by the Python Use agent.
[0068] Data interpretation and presentation: Based on the integrated data, calculate the sales profit trends for each product line (e.g., by fitting trend lines using algorithms like linear regression), calculate the profit share of each product line for each quarter, and conduct comparative analysis. Based on the analysis results, generate various visualizations, such as line charts to display sales profit trends and pie charts to compare quarterly profit shares.
[0069] 7. Results presentation
[0070] The generated visualization results are displayed in the form of HTML web pages, which users can access and view through a browser, or generate PPT files for users to download, which is convenient for use in reporting scenarios.
[0071] While embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions, and variations may be made to these embodiments without departing from the principles and spirit of the invention, and that the scope of the invention is defined by the appended claims and their equivalents.
Claims
1. A multi-agent driven ChatBI data analysis agile construction and intelligent interaction system, characterized by: It includes: Chat agent, which is used to retrieve historical conversations, data processing experience, and user preference information related to the question in the memory bank after the user enters the question to assist in understanding the user's question background and potential needs; guide and supplement key information for vague or incomplete user questions through counter-questions; use natural language processing technology to identify the analytical intent in user questions and plan the preliminary analysis path; and convert the user's natural language expression of the question into a standardized expression.
2. The multi-agent driven ChatBI data analysis agile construction and intelligent interaction system according to claim 1, characterized in that: It also includes: a task planning agent, which is used to break down the data analysis task into multiple subtasks based on the preliminary analysis path planned by the Chat agent, and determine the execution order and dependencies of each subtask; During the subtask execution phase, the corresponding agent is scheduled to execute each subtask, and the execution results of each subtask are checked for data format, data range rationality, and logical correctness. Integrate the verified subtask results and support combining or separately displaying the results according to user needs.
3. The multi-agent driven ChatBI data analysis agile construction and intelligent interaction system according to claim 2, characterized in that: It also includes: NL2SQL agent, which is used to convert user questions processed by Chat agent into semantic SQL based on the data structure information and semantic model in the knowledge base, realizing the initial conversion from natural language to database query language; according to the specific database type used, the semantic SQL is further converted into the corresponding physical SQL, so that the database can directly execute query operations to obtain the required data.
4. The multi-agent driven ChatBI data analysis agile construction and intelligent interaction system according to claim 3, characterized in that: It also includes: PythonUse intelligent agent, which is used to generate corresponding Python code for non-SQL query tasks; manage required third-party libraries to ensure the integrity of the code running environment; execute Python code and summarize the running results to supplement functional scenarios that traditional SQL queries cannot cover.
5. The multi-agent driven ChatBI data analysis agile construction and intelligent interaction system according to claim 4, characterized in that: It also includes: a data analysis agent, which integrates and summarizes the query results of the NL2SQL agent and the processing results of the PythonUse agent to form a complete data set; uses data analysis algorithms and models to conduct in-depth analysis and interpretation of the summarized data to explore the patterns and value behind the data; and generates bar charts, line charts, pie charts, and reports based on the analysis results and user needs. And the result display module is used to display the visual results generated by the data analysis agent in a suitable format to facilitate users to view and understand the analysis results.
6. A method for agile construction and intelligent interaction system of ChatBI data analysis driven by multiple agents according to claim 5, characterized in that: The following steps are involved: After the user inputs a question, the Chat agent retrieves historical conversations, data processing experience, and user preference information related to the question from the memory bank, and uses the retrieved information to help understand the background and potential needs of the user's current question; for user questions that are vague or incomplete, the Chat agent guides the user to supplement key information through counter-questions; uses natural language processing technology to identify the analytical intent in the user's question and plan a preliminary analysis path; and converts the user's natural language expression of the question into a standardized expression.
7. A method according to claim 6, characterized in that: The following steps are also included: The task planning agent breaks down the data analysis task into multiple subtasks based on the preliminary analysis path planned by the Chat agent, and determines the execution order and dependencies of each subtask. During the subtask execution phase, the corresponding agent is scheduled to execute each subtask, and the execution results of each subtask are checked for data format, data range rationality, and logical correctness. Integrate the verified subtask results and display them together or separately according to user needs.
8. A method according to claim 7, characterized in that: The following steps are also included: Based on the data structure information and semantic model in the knowledge base, the NL2SQL agent converts the user's questions processed by the Chat agent into semantic SQL, realizing the initial conversion from natural language to database query language; according to the specific database type used, the semantic SQL is further converted into the corresponding physical SQL so that the database can directly execute query operations to obtain the required data.
9. A method according to claim 8, characterized in that: The following steps are also included: The PythonUse agent generates corresponding Python code for non-SQL query tasks; Manage required third-party libraries to ensure the integrity of the code execution environment; execute Python code and summarize the results to supplement functional scenarios that traditional SQL queries cannot cover.
10. A method according to claim 9, characterized in that: The following steps are also included: The data analysis agent integrates and summarizes the query results of the NL2SQL agent and the processing results of the PythonUse agent to form a complete data set. It uses data analysis algorithms and models to conduct in-depth analysis and interpretation of the summarized data to explore the patterns and value behind the data. Based on the analysis results and user needs, it generates bar charts, line charts, pie charts, and reports to display the results. And the generated visualization results are displayed in a suitable format to facilitate users to view and understand the analysis results.
Citation Information
Patent Citations
Multi-agent interactive efficient data analysis system
CN119988421A
Method and architecture for data transformation, normalization, profiling, cleansing and validation
US20040083199A1
Creating coordinated multi-chatbots using natural dialogues by means of knowledge base
US20180025726A1
Cited By
Multi-agent data query method and device, electronic equipment and storage medium
CN121434260A