Intelligent agent-based data query method and device, equipment and storage medium
By using a query network that facilitates collaborative work among intelligent agents, the query conditions are understood and analyzed in depth, thus solving the problem of insufficient data query depth in existing technologies and achieving more efficient data retrieval.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BAIRONG ZHIXIN (BEIJING) TECH CO LTD
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-21
AI Technical Summary
Existing enterprise internal data retrieval systems are insufficient in terms of query depth and efficiency, causing users to need to make multiple queries to obtain complete information.
We employ an agent-based data query method, utilizing a query network based on a large language model. Through the collaborative work of thinking agents, knowledge-judgment agents, and tool-selection agents, we gain a deep understanding of the query conditions and perform queries through multiple data sources to generate accurate and comprehensive query results.
It improves the accuracy and comprehensiveness of data queries, reduces the need for users to make multiple queries, and enhances the efficiency of data retrieval.
Smart Images

Figure CN121901288A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a data query method, apparatus, device and storage medium based on intelligent agents. Background Technology
[0002] In the wave of enterprise digital transformation, the efficient use of data has become a focus of industry attention; especially for internal enterprise data, there are many employees who need to retrieve data and the query frequency is high, which puts forward higher requirements for data retrieval efficiency.
[0003] However, in related technologies, most enterprise internal data retrieval question answering systems mainly rely on site search, keyword matching, inverted indexes, and vector matching. Although these methods can achieve basic information retrieval functions, they have obvious limitations. That is, because these methods do not retrieve data in sufficient depth, some relevant data may be missed in the search results, which may cause users to make multiple queries, greatly reducing the efficiency of the query.
[0004] Therefore, how to improve the depth of data queries to enhance retrieval efficiency is an urgent problem to be solved. Summary of the Invention
[0005] Therefore, it is necessary to provide a data query method, apparatus, device, and storage medium based on intelligent agents that can improve the efficiency of retrieval, addressing the aforementioned technical problems.
[0006] Firstly, this application provides a data query method based on intelligent agents, including:
[0007] Receive user-input query criteria and system identifier;
[0008] The target query system is determined from each query system based on the system identifier, and the query is performed on the query conditions using the target query system to obtain the query results;
[0009] The query system is built on at least one query network, which is associated with at least one data source; the query network is built on at least one agent, and one or more of the at least one agent are built on a large language model.
[0010] In one embodiment, determining the target query system from each query system based on the system identifier includes:
[0011] The target query pattern is determined based on the system identifier, and the query system corresponding to the target query pattern is identified as the target query system from each of the query systems.
[0012] The query modes include a first query mode that performs vertical queries and a second query mode that performs horizontal multi-dimensional queries.
[0013] In one embodiment, the query network includes a thinking agent, a knowledge-judging agent, a tool-selecting agent, and multiple query tools, each of which is associated with at least one of the data sources, wherein:
[0014] In each round, the thinking agent processes the context information in the cache chain and / or the input query object to generate research directions for the query object; the cache chain is used to cache the query results of each round.
[0015] The knowledge-judging intelligent agent is used to determine the gap direction based on the research direction and the context information;
[0016] A tool selection agent is used to determine the target query tool from among the query tools based on the direction of the gap.
[0017] The target query tool is used to query the gap direction in at least one associated data source, obtain the query result for the current round, and write the query result for the current round into the cache chain.
[0018] In one embodiment, when the target query mode is a first query mode, the target query system includes a query network, and the step of using the target query system to query the query conditions and obtain query results includes:
[0019] The query conditions are input into the query network as query objects. When any one of the first loop termination conditions is met, the context data in the cache chain is used as the query result corresponding to the query conditions.
[0020] In one embodiment, when the target query mode is a second query mode, the target query system includes multiple sub-query networks, and the step of using the target query system to query the query conditions and obtain query results includes:
[0021] The query conditions are parsed to obtain a structural outline; the structural outline includes branch topics for multiple dimensions of the query conditions;
[0022] The subquery network is matched for each of the branch topics. The branch topic is input as the query object into the matched subquery network for processing. When any of the first loop termination conditions is met, the context data in the cache chain corresponding to the subquery network is used as the branch query result corresponding to the branch topic.
[0023] Based on the query results of each branch and the structural outline, the query results corresponding to the query conditions are generated.
[0024] In one embodiment, the target query system further includes a main query network, wherein parsing the query conditions to obtain a structural outline includes:
[0025] The query conditions are input into the main query network as query objects for processing. If the second loop termination condition is met, the context data in the cache chain corresponding to the main query network is used as the initial query result.
[0026] The initial query results are analyzed to obtain the structural outline.
[0027] In one embodiment, the first loop termination condition includes at least one of the following:
[0028] The cycle repeats M times, where M ≥ 2;
[0029] The direction of the gap indicates the termination of the loop;
[0030] The time taken for the query since the start of the first round has exceeded the preset time threshold.
[0031] In one embodiment, the second loop termination condition includes:
[0032] The cycle repeats N times, where N ≤ 2.
[0033] In one embodiment, the method further includes:
[0034] The output format specification is determined based on the type of the target query system or the query conditions;
[0035] The query results are formatted according to the aforementioned output format specification to obtain the output results.
[0036] Secondly, this application also provides a data query device, the device comprising a receiving module and a query module, wherein:
[0037] The receiving module is used to receive the query conditions and system identifier input by the user;
[0038] The query module is used to determine the target query system based on the system identifier, and to use the target query system to perform query processing on the query conditions to obtain query results;
[0039] The target query system is built on at least one query network, which is associated with at least one data source; the query network is built on at least one agent, and one or more of the at least one agent are built on a large language model.
[0040] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the agent-based data query method as described in any one of the first aspects above.
[0041] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the agent-based data query method as described in any one of the first aspects above.
[0042] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the agent-based data query method as described in any one of the first aspects above.
[0043] The aforementioned agent-based data query method, apparatus, device, and storage medium determine the target query system for querying query conditions from each query system based on the system identifier input by the user. Since each query system is built on at least one query network, and the query network is built on at least one agent based on a large language model, the query network has the ability to deeply understand and analyze query conditions. Based on the query network's in-depth understanding and analysis of the query conditions, it can more comprehensively and accurately retrieve the corresponding data from the relevant data sources. In other words, the accuracy and comprehensiveness of the query results output by the query network for the query conditions are high, and the participation of the large language model in the query task improves the depth of the query. Because of the improved accuracy and comprehensiveness of the query results, the occurrence of multiple queries by the user is reduced, thereby improving the efficiency of data retrieval. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of the application environment of a data query method based on intelligent agents in one embodiment;
[0046] Figure 2 This is a flowchart illustrating a data query method based on an intelligent agent in one embodiment;
[0047] Figure 3 This is a schematic diagram of the query network structure in one embodiment;
[0048] Figure 4 This is a schematic diagram of the structure of a target query system in one embodiment;
[0049] Figure 5 This is a schematic diagram of another structure of the target query system in one embodiment;
[0050] Figure 6 This is a flowchart illustrating the query steps of the second query mode in one embodiment;
[0051] Figure 7 This is a flowchart illustrating the format processing in one embodiment;
[0052] Figure 8 This is a structural block diagram of a data query device in one embodiment;
[0053] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0054] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0055] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0056] The data query method provided in this application is executed by a computer device. This computer device can be, but is not limited to, various personal computers, servers, laptops, smartphones, tablets, drones, low-altitude aircraft, IoT devices, and portable wearable devices. IoT devices can include smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, projection devices, etc. Portable wearable devices can include smartwatches, smart bracelets, head-mounted displays, etc. Head-mounted displays can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0057] The agent-based query method in this application involves at least two query systems, each used to execute a first query mode and a second query mode, respectively. In one possible implementation, each query system involved in this application can be located in the computer device executing the query method. In another possible implementation, each query system involved in this application can be located in a different computer device independent of the computer device executing the query method; of course, each query system can also be located in different computer devices. This application does not specifically limit the setup of each query system or the relationship between the executing entity and the executing entity of the query method.
[0058] like Figure 1 In a typical application scenario shown, the data query method based on intelligent agents provided in this application embodiment is executed by computer device A; while each query system is set in computer devices B and C, which are independent of computer device A; each data source that the query system needs to call can be set in computer device A and / or B, or it can be set in the cloud and called by computer devices A, B and C through API interface communication.
[0059] The user data, data acquisition, and / or use involved in the embodiments of this application strictly comply with the laws, regulations, and industry standards of relevant countries and regions. The collection and acquisition of data involved in the embodiments of this application are all done in advance by actively prompting or prominently displaying information to inform users and obtaining authorization, or by obtaining full authorization from all parties. The processing, manipulation, forwarding, and use of data involved in the embodiments of this application are all carried out on the premise that the user or relevant party is fully informed and authorized. In implementing the various embodiments of this application, the types of data or information, scope of use, and usage scenarios that may be involved are informed to users or relevant parties and authorization is obtained through appropriate means. The specific methods of notification and authorization may vary according to actual circumstances, and this application is not limited in this regard. The processing of personal information involved in the embodiments of this application is carried out under the premise of having a legal basis (such as obtaining the consent of the personal information subject or being necessary for the performance of a contract), and is only processed within the prescribed or agreed scope. Sensitive personal information such as biometric information, medical and health information, financial account information, and precise location information involved in the embodiments of this application are all processed under the premise of having a specific purpose and sufficient necessity, and with the separate authorization and consent of the user or relevant party. In some embodiments of this application, if the user or related party refuses to process personal information other than the information necessary for the basic functions, it will not affect the use of the basic functions of the embodiments of this application.
[0060] In one exemplary embodiment, such as Figure 2 As shown, a data query method based on an intelligent agent is provided, specifically including steps 10 and 20, wherein:
[0061] Step 10: Receive the query conditions and system identifier input by the user.
[0062] For the embodiments of this application, the data query method corresponds to two query modes: a first query mode (Simple mode) for vertical query and a second query mode (Complex mode) for horizontal multi-dimensional query; wherein, each query mode corresponds to a query system.
[0063] In one possible implementation, the system identifier can be represented by a number / code corresponding to the query mode input by the user. In another possible implementation, the system identifier can also generate a selection instruction for the query mode by the user through a click or touch operation; the representation method of the system identifier is not specifically limited in this embodiment.
[0064] Furthermore, users can either first enter the system identifier to determine the query mode, and then enter the query conditions to perform the query; or users can first enter the query conditions and then enter the system identifier to determine the query mode. This embodiment does not impose specific limitations on the input order of the query conditions and the system identifier.
[0065] Step 20: Determine the target query system from among the query systems based on the system identifier, and use the target query system to perform a query on the query conditions to obtain the query results.
[0066] In this embodiment, the user selects the target query mode by inputting a system identifier. The computer device determines the target query system from the query systems corresponding to the first and second query modes based on the system identifier input by the user. In one possible implementation, a unique identifier is pre-associated with each query mode, so that upon receiving the system identifier input by the user, the target query mode can be determined based on the system identifier, and the query system corresponding to the target query mode can be selected as the target query system from among the various query systems.
[0067] Specifically, each query system is built upon at least one query network, and each query network is associated with at least one data source. The query network is built upon at least one agent, and one or more of these agents are built upon a large language model. The query system corresponding to the first query mode is built upon one query network, while the query system corresponding to the second query mode is built upon multiple query networks. In other words, regardless of which query mode the user-input system identifier points to, the target query system can perform queries on the query conditions in at least one data source based on at least one query network to obtain the query results.
[0068] In the aforementioned data query method, the computer device determines the target query system from among the various query systems based on the system identifier input by the user. Since each query system is built upon at least one query network, and the query network is built upon at least one intelligent agent based on a large language model, the query network possesses the ability to deeply understand and analyze the query conditions. Based on the query network's in-depth understanding and analysis of the query conditions, it can retrieve the corresponding data from the relevant data sources more comprehensively and accurately. In other words, the accuracy and comprehensiveness of the query results output by the query network for the query conditions are high, and the participation of the large language model in the query task enhances the depth of the query. Furthermore, the improved accuracy and comprehensiveness of the query results reduce the need for users to perform multiple queries, thereby improving the efficiency of data retrieval.
[0069] In one embodiment, such as Figure 3As shown, the structure of the query network is further elaborated in detail. The query network includes a thinking agent, a knowledge gap agent, a tool selector agent, and multiple query tools. Each query tool is associated with at least one data source, wherein:
[0070] In each round, a thinking agent processes the context information and / or query objects in the cache chain to generate research directions for the query conditions; a knowledge judgment agent determines the gap direction based on the research direction and context information; a tool selection agent determines the target query tool from among the query tools based on the gap direction; and the target query tool processes the gap direction in at least one associated data source to obtain the query result of the current round and writes the query result of the current round into the cache chain.
[0071] Specifically, in the first cycle, the thinking agent performs the thinking analysis phase. Since the cache chain is empty, the thinking agent's processing objects only include the input query object. However, starting from the second cycle, data exists in the cache chain; therefore, the thinking agent's processing objects include the input query object and the context information in the cache chain.
[0072] The thinking intelligence reflects on the current research progress and query conditions, assesses the completeness and reliability of the contextual information in the cache chain (the query results output by the query tool in each previous iteration), and determines potential research directions. The purpose of this research direction is to enable the next knowledge gap agent to determine whether the contextual information in the cache chain is sufficient to end the loop. If the current iteration is the first iteration, the thinking intelligence considers what information needs to be collected to initiate research targeting the query conditions, thus determining the research direction.
[0073] Specifically, in each iteration, the processing object of the thinking agent is added to the corresponding thinking prompt template to construct an input template for the thinking agent. The thinking prompt template contains areas corresponding to the query object and context information, respectively. When no data exists in the cache chain, the area corresponding to the context information in the thinking prompt template can be empty. The thinking prompt template also includes preset thinking prompt words, which instruct the thinking agent to analyze the processing object and determine, based on the context information, which research directions (query directions) can be queried for the query object.
[0074] Furthermore, the knowledge gap agent performs the knowledge gap identification stage: the knowledge gap agent analyzes the context information in the cache chain based on the research direction output by the thinking agent in order to identify the gaps in the key problems to be solved.
[0075] Specifically, the judgment prompt template includes regions corresponding to the processing object and the research direction, respectively. The research direction output by the thinking agent, and the processing object of the thinking agent (the query object and / or context information in the cache chain) are input into the judgment prompt template corresponding to the judgment agent to construct an input template for the judgment agent. The judgment prompt template also includes preset judgment prompt words, which are used to instruct the judgment agent to identify gaps in the key problem to be solved, that is, to determine what missing information exists in the context information of the cache chain regarding the needs of the query conditions, and then generate the gap direction (supplementary query direction) to be queried based on the missing information.
[0076] If the knowledge-judging agent outputs a gap direction, then the gap direction is used as the tool to select the agent's processing object and continue processing; if it is determined that the gap direction output by the judgment agent is empty, then the loop round ends.
[0077] In some embodiments, multiple tool agents are pre-set, and each tool agent is used as a query tool, with at least one data source associated with each tool agent; thereby enabling each tool agent to query data in its associated data source.
[0078] In some embodiments, the tool selector agent performs the tool scheduling phase: the tool selector agent intelligently selects a suitable retrieval tool as the target query tool for the gap direction based on the type of gap direction. The types of gap directions include, but are not limited to, technical gap directions and knowledge gap directions. In one example, for a technical gap direction involving specific operational steps or troubleshooting (such as "VPN connection configuration"), the tool selector agent may choose to call the Gongdan Search Agent to access the work order system for querying; for a knowledge gap direction requiring conceptual explanations or process descriptions (such as "financial approval rules"), the tool selector agent may choose the Wiki Search Agent to query the process rules in the enterprise Wiki knowledge base.
[0079] Specifically, the tool selection prompt template contains an area corresponding to the direction of the gap; the gap direction output by the judgment agent is filled into the tool selection prompt template to construct an input template for the tool selection agent; the tool selection prompt template also includes data labels corresponding to each query tool, and the data labels represent the data type in the data source associated with the query tool. The tool selection prompt template also includes tool selection prompt words, which are used to instruct the tool selection agent to determine the target label related to the gap direction from each data label, and determine the query tool corresponding to the target label as the target query tool.
[0080] After the target query tool is determined, the query system will convert the gap direction into query terms (suggestion terms) specific to the target query tool, and input the query terms into the target query tool to create a query task for querying.
[0081] In some embodiments, the output of the tool selection prompt template may also include a target label corresponding to the notch direction, and the target label is used as a query term input to the target query tool. The target query tool performs a query within the associated data source based on the input query term and generates query results; wherein, the query results are associated with a source label, which is the data source corresponding to the data in the query results.
[0082] In some embodiments, the query system may further include a query term construction model based on a large language model; gap directions are added to the corresponding positions in the query term suggestion template to construct an input template for the query term construction model. The query term suggestion template also includes terminology conversion suggestions, which instruct the query term construction model to convert the gap directions into terminology and output them. The terminology is the query term input to the target query tool.
[0083] Each query tool (tool agent) independently executes query tasks by calling its associated data source. For example, the Wikisearch agent accesses the company's Wiki knowledge base using its specific query terms, obtains the raw data, automatically extracts key information based on the query terms, and generates a structured summary containing the data source as the query result. These query results are added to a cache chain, from which the thinking agent can retrieve the query results obtained in previous rounds. Each query tool can concurrently execute retrievals via an asynchronous interface (e.g., up to three queries can be initiated simultaneously).
[0084] In some embodiments, the query system is equipped with an independent execution component; for the input templates and output results of different agents, identifiers are pre-defined; the execution component can determine whether the data is an input template or an output result based on the preset identifiers, and determine its generation object and input object; then, according to the preset execution logic, it implements the steps of constructing the input templates of each agent and the steps of converting the gap direction into query terms.
[0085] The above content describes the structure of the query network, as well as the collaborative content and process of the various agents within it. The following describes the structure of the query systems corresponding to the first and second query modes, and the specific implementation methods of the query process.
[0086] In one embodiment, such as Figure 4 As shown, the query system corresponding to the first query mode includes a query network. When the target query system corresponding to the system identifier input by the user is the query system corresponding to the first query mode, the process of querying the query conditions and obtaining the query results includes: inputting the query conditions as query objects into the query network, and when any one of the first loop termination conditions is met, using the context data in the cache chain as the query result corresponding to the query conditions.
[0087] Specifically, in each round of the query network, the thinking agent performs a thinking analysis phase to process the input query object and obtain the research direction; then, the knowledge gap agent performs a knowledge gap identification phase to determine the gap direction based on the research direction and contextual information in the cache chain; next, the tool selector agent performs a tool scheduling phase to determine the matching target query tool from among the various query tools based on the gap direction; the execution component in the query system converts the gap direction into query terms (prompt words) specific to the target query tool and inputs the query terms into the target query tool; finally, the determined target query tool queries the query terms in the associated data source to obtain the query result of the current round, writes the query result into the cache chain, and the current round ends.
[0088] In the first loop cycle corresponding to the first query mode, there is no data in the cache chain, so the query object input to the query agent is only the query condition; starting from the second loop cycle, there is context data (the query results generated in the previous cycles) in the cache chain; therefore, starting from the second loop cycle, the query object input to the query agent includes not only the query condition, but also all the context data in the cache chain.
[0089] In some embodiments, in the query system corresponding to the first query mode, the query network stops the loop iteration when any one of the first loop termination conditions is met, and outputs the context information in the cache chain as the query result for the query conditions.
[0090] Specifically, the termination condition for the first loop includes at least one of the following:
[0091] The cycle repeats M times, where M ≥ 2;
[0092] The direction of the gap indicates the termination of the cycle;
[0093] The time taken for the query since the start of the first round has exceeded the preset time threshold.
[0094] To improve the comprehensiveness and accuracy of query results, at least two loop iterations are required; however, an infinite number of loop iterations are not allowed. Firstly, as the number of loop iterations increases, the amount of usable data retrieved in each subsequent iteration gradually decreases. Secondly, too many loop iterations will cause the query system to consume excessive token resources, thereby increasing the query cost. Therefore, by setting a maximum number of loop iterations M, the query results are made comprehensive and accurate to a certain extent without excessively consuming tokens.
[0095] In some embodiments, when the knowledge gap agent in the query network determines that there is no gap direction based on the query conditions and the context information in the cache chain, for example, when the determined gap direction is empty, it indicates that the query results obtained in the previous rounds have met the requirements of the query conditions. At this time, the query network stops entering the next round of the loop.
[0096] In some other embodiments, in order to improve the efficiency of data query and reduce the response time to users, the timer starts from the first loop of the query network. When it is determined that the query time exceeds a preset time threshold, the current loop stops and the context information already existing in the cache chain of the query network is used as the final query result.
[0097] In one embodiment, such as Figure 5 As shown, the query system corresponding to the second query mode includes multiple sub-query networks, which have the same structure as the query network; where "multiple" means two or more. Figure 5 Based on the query system structure shown, the process involves determining the target query system from among the various query systems according to the system identifier, and then using the target query system to perform queries based on the query conditions to obtain the query results. Figure 6 As shown, it may specifically include steps 21-23, wherein:
[0098] Step 21: Parse the query conditions to obtain the structure outline; the structure outline includes branch topics for multiple dimensions of the query conditions.
[0099] In some embodiments, the query system further includes a main query network, which has the same structure as the query network. The main query network is used to parse the input processing object to obtain branch topics in multiple dimensions.
[0100] Specifically, the query conditions are input as query objects into the main query network for processing. The query conditions input into the main query network (Planner agent) serve as the processing objects for the main query network in the first loop. The main query network automatically executes at least one loop based on the processing objects, using the context information in the cache chain as the initial query result. Starting from the second loop, the processing objects of the main query network are the query conditions and the context information in the cache chain.
[0101] If the second loop termination condition is met, the context data in the cache chain corresponding to the main query network is used as the initial query result. The second loop termination condition includes: the number of loop iterations reaches N, where N≤2.
[0102] While executing multiple iterations to generate more comprehensive and accurate initial query results facilitates a more rational division of the final branch topics, this also leads to excessive token consumption and increases query time. Therefore, limiting the number of iterations in the main query network to generate initial query results to a maximum of two can improve the dimensionality of data queries while keeping query time within an acceptable range and making the cost of consumed tokens manageable.
[0103] After obtaining the initial query results, analyzing the initial query results will yield background information for the query conditions. Further breaking down the background information will yield a structural outline of at least two dimensions of branch topics.
[0104] In some embodiments, the query system further includes an analysis model built on a large language model. The analysis model processes the initial query results to obtain background information, and further processes this background information to obtain a structural outline of branch topics with at least two dimensions. The structural outline consists of sequentially arranged branch topics, ordered hierarchically to facilitate the generation of logical and hierarchical analysis reports. For example, for a query condition A, the generated structural outline for A includes four branch topics: basic concepts A1, current development status A2, advantages and disadvantages A3, and future development directions A4. A1-A4 represent the order of the branch topics in the structural outline.
[0105] The analysis model processes the query conditions and the initial query results output by the main query network to generate background information specific to the query conditions. The initial query information generated by the main query network may contain a large amount of content, including invalid and disjointed information; while the background information generated by the analysis model from the initial query results contains only logically coherent content relevant to the query conditions.
[0106] Specifically, the query conditions and initial query results are added to the corresponding positions in the first analysis template to construct the input template for the analysis model. The first analysis template also has preset background generation prompts, which are used to instruct the analysis model to analyze the content of the processed object, thereby determining the content related to the query conditions and adjusting the logic of the content related to the query conditions to make the content and logic coherent, thereby obtaining the background information output by the analysis model for the first analysis template.
[0107] The background information is further processed using the analysis model to obtain the branch topics generated by the analysis model based on the background information.
[0108] Specifically, the background information generated by the analysis model is added to the corresponding position in the second analysis template to construct an input template for the analysis model. The second analysis template also has preset topic splitting prompts, which are used to instruct the analysis model to analyze the background information and split the background information to generate branch topics with multiple dimensions.
[0109] Step 22: Match subquery networks for each branch topic, input the branch topic as the query object into the matching subquery network for processing, and when any of the first loop termination conditions are met, use the context data in the cache chain corresponding to the subquery network as the branch query result corresponding to the branch topic.
[0110] Step 23: Based on the query results of each branch and the structural outline, generate the query results corresponding to the query conditions.
[0111] Specifically, for each branch topic, a subquery network is matched. When the number of subquery networks is equal to or greater than the number of branch topics, a unique subquery network is randomly assigned to each branch topic. When the number of branch topics is greater than the number of subquery networks, a unique branch topic is matched to each subquery network for processing. Any subquery network is released and marked as idle after completing its query task. Unqueried branch topics are reassigned to released and idle subquery networks first; that is, the principle of first-release, first-assignment is followed until all branch topics have been queried by subquery networks.
[0112] For each subquery network, the branch topic assigned to the subquery network is its processing object. The queries of each subquery network on the branch topic can be performed in parallel. In the process of each subquery network querying the branch topic, a complete cycle also includes the aforementioned thinking agent performing the thinking analysis phase, the knowledge gap agent performing the knowledge gap identification phase, the toolselector agent performing the tool scheduling phase, and the target query tool performing the specific query data query process.
[0113] In one embodiment, when each subquery network satisfies the first loop termination condition, it uses the context information in its cache chain as the branch query result corresponding to the branch topic it matches.
[0114] After obtaining the branch query results corresponding to each branch topic, a research report is generated based on the structural outline, the branch query results, and background technology. The specific process of generating the research report is as follows: a report template is created based on the order of each branch topic in the structural outline; the branch query results are filled into the areas corresponding to each branch topic in the report template; at the same time, background technology is filled into the preset positions in the structural outline to obtain the research report based on the query conditions.
[0115] The generated research report is proofread according to the specified proofreading criteria. After the research report passes proofreading, it is output as the final query result based on the query criteria. These proofreading criteria include, but are not limited to, criteria for report format, text format, word count, and sensitive words. The proofreading process can be implemented using rule-based proofreading tools, API (Application Programming Interface) services of third-party file verification tools, or automated tools based on VBA scripts. This embodiment does not specifically limit the implementation method of the proofreading process.
[0116] The first query mode involves multiple rounds of progressive queries based on the query conditions to obtain more in-depth results. The second query mode, however, first performs a preliminary query on the query conditions to obtain initial results; then, it further breaks down these initial results to obtain background technology and a structural outline containing multiple sub-topics. Compared to the first query mode, the second query mode, during the query phase, breaks down the background information into multiple sub-topics and performs multiple rounds of progressive queries on each sub-topic. Thus, the second query mode achieves categorized querying during the query process, directly obtaining query results for each sub-topic, and ultimately generating a research report based on the sub-topic query results, background technology, and structural outline.
[0117] Because the structure outline arranges the various sub-topics in a hierarchical order, even without post-processing of the logical report, the research report constructed based on the structure outline has logical coherence and a sense of hierarchy.
[0118] In one embodiment, such as Figure 7 As shown, the data query method provided in this application embodiment further includes steps 31 and 32, wherein:
[0119] Step 31: Determine the output format specifications based on the type of the target query system or the query conditions;
[0120] Step 33: Process the query results according to the output format specifications to obtain the output results.
[0121] Specifically, the query results output by the second and first query modes differ in format. For example, the query system outputting the first query mode provides individual data entries along with their source annotations, while the query system outputting the second query mode provides a structured research report containing background technology related to the query conditions and branch query results for various dimensions of related topics, with each data entry also associated with a source annotation. Therefore, the query results output by the second and first query modes require different formatting.
[0122] Specifically, the type of the query system indicates whether the system corresponds to the first query mode or the second query mode. The corresponding output format specification is set in advance for each query mode. When the query result output by the target query system is obtained, the matching output format specification is determined based on the system identifier input by the user / the type of the target query system. Then, the query result is processed accordingly based on the determined output format specification to obtain the output result to the user.
[0123] Of course, users can specify the output format of the query results in the query conditions. If the query conditions entered by the user have an output format rule, the output format specification specified by the customer will be used first; otherwise, the output format specification that matches the type of the target query system will be used.
[0124] In some embodiments, within the query system corresponding to the second query mode, the formatting of the query results can be performed by the main query network (planner agent) or by a separate analytical agent. In one example, the formatting of a research report may include: first, performing a comprehensive language quality check on the research report, including correcting grammatical errors, adjusting inappropriate wording, and optimizing sentence structure; second, standardizing the terminology and style of the entire research report to ensure consistency in language style; simultaneously optimizing the transitions between different sub-topics to enhance the logical coherence of the report; and finally, standardizing the source citations (reference list) to ensure the standardization of citation format.
[0125] In the query system corresponding to the first query mode, the formatting of the query results can be performed by a thinking agent or by a separate analysis agent; this embodiment does not impose specific limitations on this. In one example, the formatting process performed on the query results corresponding to the first query mode may include: preprocessing the format of the source annotation corresponding to each piece of data in the query results to make the format uniform.
[0126] In an exemplary embodiment, the technical solution provided by the present application is explained by demonstrating the process of the query network corresponding to the first query mode executing a specific query task, as shown below:
[0127] The query condition is: What is MCP?
[0128] The query system first initializes, loading all core intelligent agent modules and configuring a distributed data access environment. Through standardized interface protocols, tool agents (such as the Wiki search agent) can connect to various data sources, which can reside on the same or different storage devices, requiring only network reachability. The query system supports dynamically adding new data sources; simply configure the corresponding access URL (Uniform Resource Locator) and authentication information, eliminating the need for local deployment. During the environment preparation phase, key parameters of the research process, such as the maximum number of iterations and query timeout thresholds, are also set, and the asynchronous task scheduling framework is initialized.
[0129] The process involves the thinking agent performing the thinking and analysis phase, the knowledge gap agent performing the knowledge gap identification phase, the tool selector agent performing the tool scheduling phase, and the target query tool performing the specific data query.
[0130] (1) The process of the first cycle:
[0131] (1.1) The thinking agent performs the thinking and analysis phase:
[0132] The thinking agent first performs initial analysis (such as code snippets). <thought1>As shown in the figure, the research objective is determined to be "to clarify the terminology definition and domain affiliation of MCP". At this point, the system establishes an initial research framework and marks the key knowledge gaps as "full terminology" and "basic definition".
[0133] <thought1>
[0134] Since this is our first iteration, we haven't yet learned anything from the previous iteration. This means we need to first define and understand the basic concepts of MCP.
[0135] - We need to ensure that this research covers all the key aspects of MCP, including its definition, common uses, and applications in different fields.
[0136] - For topics we want to explore in more depth, once we have a basic understanding of MCP, we can consider exploring specific application cases of it in particular industries or technologies.
[0137] Since this is still an initial attempt to gather information, it's too early to discuss whether the desired information can be retrieved. However, my plan is to start by searching from authoritative sources, such as academic papers, official documents, or industry reports.
[0138] If we find it difficult to find relevant information or the amount of information is insufficient, we may need to adjust the keywords to conduct a broader search, or we may need to consider turning to other topics related to MCP to obtain more information.
[0139] - We don't expect to encounter too many contradictory or conflicting viewpoints at this stage, but if we do, we will carefully analyze the basis behind each statement and try to find the most reasonable explanation.
[0140] To conduct this research effectively, the first iteration should focus on gathering fundamental information about MCP, including but not limited to its definition, historical development, and key functional characteristics. This will provide a solid foundation for our subsequent in-depth exploration.
[0141]
[0142] (1.2) Knowledge Judgment Agent Performs Knowledge Gap Identification Stage:
[0143] The knowledge gap agent generates the first research task based on the research direction output by the aforementioned thinking agent, and outputs the gap direction as follows: <task1>As shown:
[0144] <task1>
[0145] Address this knowledge gap: What is the full name and basic definition of MCP?
[0146]
[0147] Tool scheduling and execution phase:
[0148] (1.3) Tool selection agent execution tool scheduling phase:
[0149] The tool selector agent is chosen based on the type of knowledge gap, using Wiki SearchAgent as the target query tool, as follows: <action1>As shown:
[0150] <action1>
[0151] Calling the following Tools to address the knowledge gap:
[0152] [Agent] WikiSearchAgent [Query] Definition of MCP [Entity] null。
[0153]
[0154] The Wiki Search Agent returns structured results after performing a search, as shown in the [ToolResult] section below:
[0155] [Tool Result 1] What is the full name and basic definition of WikiSearchAgent gap_MCP? What is the definition of query_MCP?
[0156] ## Definition of MCP:
[0157] MCP (Model Context Protocol) is an open-source license introduced by Anthropic, designed to provide a standardized integration framework for Large Language Models (LLMs) with external data sources and tools ([MCP Principles and Implementation](URL_Company Internal Technical Document)).
[0158] ### Core Values and Characteristics;
[0159] - **Core Value:** Promoting the standardization and decentralization of large-scale model applications. By providing standard interfaces, M×N problems are transformed into M+N problems, significantly reducing development complexity and enhancing the model's contextual understanding capabilities ([MCP Principles and Implementation](URL_Company Internal Technical Documentation)).
[0160] - **Key Features**: Flexibility, security, scalability, and seamless access to local resources and remote services.
[0161] ### Application Scenarios and Architecture Components;
[0162] - **Application Scenarios**: Intelligent development assistant, enterprise knowledge hub, cross-platform AI agent, etc.
[0163] - **Architecture Components**: The MCP architecture consists of a host, a client, and a server. It adopts a client-server architecture to ensure efficient and secure bidirectional connections ([MCP Principles and Implementation](URL_Company Internal Technical Document)).
[0164] The above describes the process of the first iteration of the query network; the following content illustrates the process of the second iteration of the query network.
[0165] (2) The process of the second cycle:
[0166] (2.1) The thinking agent performs the thinking and analysis phase:
[0167] After evaluating the query results obtained in the first round, the thinking agent proposes research directions that require in-depth study of the technical architecture, as follows: <thought2>As shown:
[0168] <thought2>
[0169] ### Thoughts:
[0170] What did you learn?
[0171] In the first iteration, we discovered that MCP stands for "Model Context Protocol," an open-source protocol launched by Anthropic that aims to standardize the integration of large language models with external data sources and tools. It offers flexibility, security, and scalability, and is suitable for multiple scenarios, such as intelligent development assistants and enterprise knowledge hubs.
[0172] - **Does it cover all the key aspects?**
[0173] The first iteration focused primarily on the basic definition and core features of MCP, but did not delve into its specific implementation details, technical architecture, or challenges and limitations in practical applications. Furthermore, while we understand the application scenarios of MCP, its implementation across different industries remains unclear.
[0174] What topics would you like to explore in depth next?
[0175] - MCP's specific technical architecture: the interaction mechanism between the host, client, and server.
[0176] - Case Studies: How effective is MCP in specific applications such as intelligent development assistants and enterprise knowledge hubs? What are some successful case studies?
[0177] - Potential challenges and limitations: such as security issues, compatibility with other systems, performance optimization, etc.
[0178] Are there other similar protocols, and what advantages does MCP have over them?
[0179] Did you find the information you needed?
[0180] Yes, we have obtained a basic definition and some key characteristics of MCP, but this information is still relatively superficial, especially in terms of technical implementation and real-world applications, there is still a lot of room for exploration.
[0181] - **Method adjustment or reversal?**
[0182] The current approach is effective, and we can continue to explore this direction further in the future. We need to broaden our search scope, focusing on the technical architecture and practical application scenarios of MCP, while also paying attention to potential challenges and competing solutions.
[0183] - **Contradiction or conflict?**
[0184] There are no obvious contradictions or conflicts at present, but we anticipate encountering some limitations or points of contention as we further examine its technical details and practical applications. For example, while MCP claims high security, it may face new threats in complex real-world environments.
[0185] In summary, our goal in the second iteration was to gain a deeper understanding of the technical architecture and practical applications of MCP, laying the foundation for subsequent evaluation of its advantages and disadvantages and potential improvement directions.
[0186]
[0187] (2.2) Knowledge Judgment Agent Performs Knowledge Gap Identification Stage:
[0188] Based on the research directions output by the aforementioned thinking agent and the query results in [Tool Result 1], the knowledge gap agent generates the gap directions again as follows: <task2>As shown:
[0189] <task2>
[0190] Address this knowledge gap: The specific technical architecture of MCP: the interaction mechanism between the host, client, and server.
[0191]
[0192] (2.3) Tool selection agent execution tool scheduling phase:
[0193] Tool selector agent: Based on the type of knowledge gap, WikiSearch Agent is selected again as the target query tool, as follows: <action2>As shown:
[0194] <action2>
[0195] Calling the following Tools to address the knowledge gap:
[0196] [Agent] WikiSearchAgent [Query] MCP architecture [Entity] null。
[0197]
[0198] The second round of query results returned by WikiSearchAgent is shown in [Tool Result 2]:
[0199] [Tool Result 2] WikiSearchAgent gap_MCP's specific technical architecture: the interaction mechanism between the host, client, and server (query_MCP architecture).
[0200] ## MCP's technical architecture: the interaction mechanism between the host, client, and server.
[0201] MCP (Model Context Protocol) is an open standard designed to unify communication between large language models (LLMs) and external data sources and tools. It adopts a client-server architecture, allowing AI applications to connect to multiple servers through standardized interfaces [1].
[0202] ### Core Components
[0203] - **Host:** The user-facing AI application (such as ChatGPT, Cursor, etc.) is responsible for interacting with the user and determining which external functions are needed.
[0204] - **Client:** A protocol client that maintains a one-to-one connection with the server, managing communication between the host and a specific MCP server.
[0205] - **Server:** A lightweight program that exposes specific functionality through a standardized model context protocol, providing secure access to local or remote data sources and services.
[0206] ### Communication Flow###
[0207] 1. The user interacts with the host application, and the LLM analyzes the request to determine whether an external tool needs to be invoked.
[0208] 2. The host instructs the client to connect to the appropriate server; the client queries the server to discover the capabilities it provides (Tools, resources, prompts).
[0209] 3. Based on user needs or LLM judgment, the host instructs the client to invoke specific capabilities from the server.
[0210] 4. The server executes the requested function and returns the result to the client, then sends it back to the host, and finally merges it into the LLM context or presents it directly to the user.
[0211] [1]: URL_Company Internal Technical Documents.
[0212] The above is an example of the query network executing two rounds of loops in the query system corresponding to the first query mode. (Note: URL is the source tag, "##" is a dialog separator, and "**" is a separator for parallel objects.)
[0213] The data query method provided in this application has at least the following beneficial effects:
[0214] 1. Enhanced deep semantic understanding capabilities: Related technologies employ keyword-based matching or convert query conditions into text vectors for query conditions, and then use the text vectors between the query conditions and the data text to achieve retrieval queries.
[0215] Compared with related technologies, the agent-based data query method provided in this application significantly improves the system's ability to parse enterprise professional terms and complex queries through a multi-agent collaborative architecture and iterative research mechanism. Furthermore, since each agent is built based on a large language model, each agent can utilize the large language model's deep analysis and semantic understanding capabilities to perform detailed analysis of the objects to be processed. Therefore, when faced with business terms with synonyms, each agent can understand them well. Moreover, due to the existence of multiple loop mechanisms in the query network, each loop iteration can further analyze the contextual information obtained from the previous iterations and determine any remaining gaps. This allows the query network to understand and digest the query conditions of complex queries containing multiple conditions during the query phase, thereby demonstrating higher query accuracy in professional domain queries.
[0216] 2. Dynamic Knowledge Updates and Real-Time Assurance: The system adopts a distributed data access architecture and asynchronous update mechanism. When the enterprise's data source changes, the research agent can automatically obtain the latest information without the need for manual index reconstruction. This real-time adaptability is particularly suitable for enterprise environments with rapid business iterations, significantly shortening the information update response cycle.
[0217] 3. Research-oriented thinking simulation and in-depth analysis: Through the collaborative work of intelligent agents, the system achieves iterative research capabilities similar to those of human researchers. When faced with complex business queries, the system can automatically identify knowledge gaps, adjust research directions, and generate data-supported conclusive reports, achieving a professional level of analysis.
[0218] 4. Seamless integration of multi-source heterogeneous data: The intelligent scheduling mechanism can simultaneously connect to various heterogeneous data sources, automatically associating different types of data when processing complex queries to form a comprehensive solution, significantly improving the completeness of cross-system queries.
[0219] 5. Balancing resource optimization and response speed: By using dynamic termination conditions (number of iterations, time threshold, and result completeness) and asynchronous concurrent processing, the system optimizes resource consumption while ensuring research quality, achieving a good balance between research depth and response speed, and significantly improving research efficiency compared to traditional solutions.
[0220] 6. Explainability: All research reports automatically indicate data sources and provide complete citation notes, ensuring that the research process is transparent and traceable, significantly reducing the company's compliance risks.
[0221] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0222] Based on the same inventive concept, this application also provides a data query apparatus for implementing the agent-based data query method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more data query apparatus embodiments provided below can be found in the limitations of the agent-based data query method described above, and will not be repeated here.
[0223] In one exemplary embodiment, such as Figure 8 As shown, a data query device 800 is provided, including a receiving module 801 and a query module 802, wherein:
[0224] The receiving module 801 is used to receive the query conditions and system identifier input by the user;
[0225] The query module 802 is used to determine the target query system from each query system based on the system identifier, and to use the target query system to perform a query on the query conditions to obtain the query results;
[0226] The target query system is built on at least one query network, which is associated with at least one data source; the query network is built on at least one agent, and one or more of the agents are built on a large language model.
[0227] In one embodiment, the query module 802 is specifically used for:
[0228] The target query pattern is determined based on the system identifier, and the query system corresponding to the target query pattern is identified as the target query system from among the various query systems.
[0229] The query modes include the first query mode of vertical query and the second query mode of horizontal multi-dimensional query.
[0230] In one embodiment, the query network includes a thinking agent, a knowledge-judging agent, a tool-selecting agent, and multiple query tools, each query tool being associated with at least one data source, wherein:
[0231] In each round, a thinking agent processes the context information in the cache chain and / or the input query object to generate research directions for the query object; the cache chain is used to cache the query results of each round.
[0232] A knowledge-judgment intelligent agent is used to determine the direction of the gap based on research direction and contextual information;
[0233] A tool selection agent is used to determine the target query tool from among the various query tools based on the gap direction;
[0234] The target query tool is used to query the gap direction in at least one associated data source, obtain the query results for the current round, and write the query results for the current round to the cache chain.
[0235] In one embodiment, when the target query mode is the first query mode, the target query system includes a query network, and the query module 802 is specifically used for:
[0236] The query conditions are input into the query network as query objects. When any of the first loop termination conditions are met, the context data in the cache chain is used as the query result corresponding to the query conditions.
[0237] In one embodiment, when the target query mode is the second query mode, the query module 802 is specifically used for:
[0238] The query conditions are parsed to obtain the structure outline; the structure outline includes branch topics for multiple dimensions of the query conditions.
[0239] Match a secondary query network to each branch topic, input the branch topic as the query object into the matching secondary query network for processing, and when any of the first loop termination conditions are met, use the context data in the cache chain corresponding to the secondary query network as the branch query result corresponding to the branch topic.
[0240] Based on the query results of each branch and the structural outline, the query results corresponding to the query conditions are generated.
[0241] In one embodiment, the target query system further includes a main query network and a query module 802, specifically used for:
[0242] The query conditions are input into the main query network for processing. If the second loop termination condition is met, the context data in the cache chain corresponding to the main query network is used as the initial query result.
[0243] The initial query results are analyzed to obtain the structural outline.
[0244] In one embodiment, the first loop termination condition includes at least one of the following:
[0245] The cycle repeats M times, where M ≥ 2;
[0246] The direction of the gap indicates the termination of the cycle;
[0247] The time taken for the query since the start of the first round has exceeded the preset time threshold.
[0248] In one embodiment, the second loop termination condition includes:
[0249] The cycle repeats N times, where N ≤ 2.
[0250] In one embodiment, the data query device 800 further includes a format processing module, which is specifically used for:
[0251] Determine the output format specifications based on the type of the target query system or the query conditions;
[0252] The query results are formatted according to the output format specifications to obtain the output results.
[0253] Each module in the aforementioned data query device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0254] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 9 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When the computer program is executed by the processor, it implements a data query method based on intelligent agents. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads set on the casing of the computer device, or external keyboards, touchpads, or mice, etc.
[0255] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0256] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the agent-based data query method as described in any of the above method embodiments.
[0257] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of the agent-based data query method as described in any of the above method embodiments.
[0258] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of an agent-based data query method as described in any of the above method embodiments.
[0259] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0260] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0261] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0262] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A data query method based on intelligent agents, characterized in that, The method includes: Receive user-input query criteria and system identifier; The target query system is determined from each query system based on the system identifier, and the query is performed on the query conditions using the target query system to obtain the query results; The query system is built on at least one query network, which is associated with at least one data source; the query network is built on at least one agent, and one or more of the at least one agent are built on a large language model.
2. The method according to claim 1, characterized in that, The step of determining the target query system from each query system based on the system identifier includes: The target query pattern is determined based on the system identifier, and the query system corresponding to the target query pattern is identified as the target query system from each of the query systems. The query modes include a first query mode that performs vertical queries and a second query mode that performs horizontal multi-dimensional queries.
3. The method according to claim 1 or 2, characterized in that, The query network includes a thinking agent, a knowledge-judging agent, a tool-selecting agent, and multiple query tools. Each query tool is associated with at least one of the data sources, wherein: In each round, the thinking agent processes the context information in the cache chain and / or the input query object to generate research directions for the query object; the cache chain is used to cache the query results of each round. The knowledge-judging intelligent agent is used to determine the gap direction based on the research direction and the context information; A tool selection agent is used to determine the target query tool from among the query tools based on the direction of the gap. The target query tool is used to query the gap direction in at least one associated data source, obtain the query result for the current round, and write the query result for the current round into the cache chain.
4. The method according to claim 3, characterized in that, When the target query mode is the first query mode, the target query system includes a query network, and the step of using the target query system to query the query conditions and obtain query results includes: The query conditions are input into the query network as query objects. When any one of the first loop termination conditions is met, the context data in the cache chain is used as the query result corresponding to the query conditions.
5. The method according to claim 3, characterized in that, When the target query mode is the second query mode, the target query system includes multiple sub-query networks. The step of using the target query system to query the query conditions and obtain query results includes: The query conditions are parsed to obtain a structural outline; the structural outline includes branch topics for multiple dimensions of the query conditions; The subquery network is matched for each of the branch topics. The branch topic is input as the query object into the matched subquery network for processing. When any of the first loop termination conditions is met, the context data in the cache chain corresponding to the subquery network is used as the branch query result corresponding to the branch topic. Based on the query results of each branch and the structural outline, the query results corresponding to the query conditions are generated.
6. The method according to claim 5, characterized in that, The target query system also includes a main query network, wherein parsing the query conditions to obtain a structural outline includes: The query conditions are input into the main query network as query objects for processing. If the second loop termination condition is met, the context data in the cache chain corresponding to the main query network is used as the initial query result. The initial query results are analyzed to obtain the structural outline.
7. The method according to claim 4 or 5, characterized in that, The first loop termination condition includes at least one of the following: The cycle repeats M times, where M ≥ 2; The direction of the gap indicates the termination of the loop; The time taken for the query since the start of the first round has exceeded the preset time threshold.
8. The method according to claim 6, characterized in that, The second loop termination condition includes: The cycle repeats N times, where N ≤ 2.
9. The method according to any one of claims 4-6, characterized in that, The method further includes: The output format specification is determined based on the type of the target query system or the query conditions; The query results are formatted according to the aforementioned output format specification to obtain the output results.
10. A data query device, characterized in that, The device includes a receiving module and a query module, wherein: The receiving module is used to receive the query conditions and system identifier input by the user; The query module is used to determine the target query system from each query system according to the system identifier, and use the target query system to query the query conditions to obtain the query results; The query system is built on at least one query network; the query network is associated with at least one data source; the query network is built on at least one agent, and one or more of the at least one agent are built on a large language model.
11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 9.
12. 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 steps of the method according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 9.