Intelligent agent instance construction method and data processing method based on intelligent agent instance

Through the agent instance production unit, the intellectual instance construction unit is constructed based on metadata, which solves the problems of limited universality and high complexity in the agent construction method, and realizes the structural unified and convenient expansion of the agent instance.

CN118690779BActive Publication Date: 2024-11-22YUNLI ZHIHUI TECH CLOUD WISDOM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411171684.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-11-22
Estimated Expiration
2044-08-26

AI Technical Summary

Technical Problem

The existing agent construction methods lead to limited universality of agents, complex use and difficult to scale, resulting in proprietary configurations for each scenario, which are difficult to understand and use.

Method used

Through the agent instance production unit, an agent instance is constructed based on metadata, including memory unit instances and agent skill instance chains, unified structure and easy to expand and understand.

Benefits of technology

It realizes structural unity of the agent instance, which is easy to expand and use, reduces the complexity of the agent and improves its universality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118690779B_ABST
    Figure CN118690779B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of intelligent agent construction, and provides an intelligent agent instance construction method and a data processing method based on the intelligent agent instance. The intelligent agent instance construction method comprises: generating metadata in response to an intelligent agent definition operation input by a user, and the metadata carries intelligent agent configuration information; generating an intelligent agent instance production unit in response to an initialization operation input by a user; and constructing an intelligent agent instance based on the intelligent agent configuration information through the intelligent agent instance production unit, and the intelligent agent instance comprises: a memory unit instance and an intelligent agent skill instance chain, and the memory unit instance is used to store the first context data of the intelligent agent instance in its life cycle. The method constructs an intelligent agent instance (including a memory unit instance and an intelligent agent skill instance chain) based on metadata through the intelligent agent instance production unit, so that the structure of the intelligent agent instance is more unified, easier to expand, and easier to understand and use.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent agent construction, and in particular to an intelligent agent instance construction method and a data processing method based on the intelligent agent instance. Background Art

[0002] The large model agent is the core of the engineering of artificial intelligence generative content (AIGC). Many enhancements of the large language model (LLM), such as retrieval-augmented generation (RAG), are implemented in the agent.

[0003] At present, there is no unified way to build intelligent agents, and there are large differences. The differentiated configuration of intelligent agents is caused by gradual iteration and the lack of a unified abstract framework, which makes it inconvenient to use and expand intelligent agents. Each additional scenario requires a set of proprietary configurations, which is also difficult to understand. The existing intelligent agent construction method not only limits the versatility of intelligent agents, but also increases the complexity of using intelligent agents and the difficulty of expansion. Summary of the invention

[0004] The present invention provides an intelligent agent instance construction method and a data processing method based on the intelligent agent instance, so as to solve the technical problems that the existing intelligent agent construction method not only limits the versatility of the intelligent agent, but also increases the complexity of the use of the intelligent agent and the difficulty of expansion. The intelligent agent instance construction method constructs the intelligent agent instance (including the memory unit instance and the intelligent agent skill instance chain) based on metadata through the intelligent agent instance production unit, so that the structure of the intelligent agent instance is more unified, easier to expand, and easier to understand and use.

[0005] In a first aspect, the present invention provides a method for constructing an intelligent agent instance, comprising the following steps.

[0006] In response to an agent definition operation input by a user, metadata is generated, wherein the metadata carries agent configuration information; in response to an initialization operation input by the user, an agent instance production unit is generated; through the agent instance production unit, an agent instance is constructed based on the agent configuration information, wherein the agent instance includes: a memory unit instance and an agent skill instance chain, wherein the memory unit instance is used to store the first context data of the agent instance in its life cycle.

[0007] According to a method for constructing an agent instance provided by the present invention, the agent skill instance chain includes a preparation skill instance, a perception skill instance, a retrieval skill instance, a reasoning skill instance and an execution skill instance which are chained in sequence; wherein the preparation skill instance is used to respond to the initialization operation input by the user to initialize the agent instance; the perception skill instance is used to respond to the data processing operation input by the user to generate data to be processed and extract structured data from the data to be processed; the retrieval skill instance is used to perform prompt word assembly and retrieval enhancement generation on the structured data to obtain first target data; the reasoning skill instance is used to call a large language model and / or other agents to reason on the first target data to obtain second target data; and the execution skill instance is used to obtain a data processing result based on the second target data.

[0008] According to a method for constructing an agent instance provided by the present invention, the method also includes: generating a dialog flow context storage unit instance after the perception skill instance responds to the data processing operation of the user input, and the dialog flow context storage unit instance is used to store the second context data of the agent skill instance chain during the data processing process, and the second context data includes: dialog reference knowledge data, debugging auxiliary information and data flow.

[0009] According to a method for constructing an agent instance provided by the present invention, the method further includes: generating a session Session in response to a session creation operation input by the user; wherein the session Session is used to store the agent instance.

[0010] According to a method for constructing an intelligent agent instance provided by the present invention, the first context data includes: system prompt words, external database table metadata definitions, external tool definitions, external document parsing data, historical conversation data, and cached global variables.

[0011] In a second aspect, the present invention also provides a data processing method based on an agent instance, comprising the following steps.

[0012] Through the perception skill instance in the intelligent agent instance, respond to the data processing operation input by the user, generate data to be processed, and extract structured data from the data to be processed, the intelligent agent instance is obtained based on any one of the intelligent agent instance construction methods of the first aspect; through the retrieval skill instance in the intelligent agent instance, the structured data is assembled with prompt words and retrieval enhancement is generated to obtain first target data; through the reasoning skill instance in the intelligent agent instance, call a large language model and / or other intelligent agents to reason about the first target data to obtain second target data; through the execution skill instance in the intelligent agent instance, obtain a data processing result according to the second target data.

[0013] In a third aspect, the present invention also provides an intelligent agent instance construction device, comprising the following modules.

[0014] The generation module is used to generate metadata in response to the agent definition operation input by the user, and the metadata carries the agent configuration information; and to generate an agent instance production unit in response to the initialization operation input by the user.

[0015] A building module is used to build an agent instance through the agent instance production unit based on the agent configuration information, and the agent instance includes: a memory unit instance and an agent skill instance chain, and the memory unit instance is used to store the first context data of the agent instance in its life cycle.

[0016] In a fourth aspect, the present invention also provides a data processing device based on an agent instance, comprising the following modules.

[0017] A processing module is used to respond to the data processing operation input by the user through the perception skill instance in the intelligent agent instance, generate data to be processed, and extract structured data from the data to be processed, wherein the intelligent agent instance is obtained based on any one of the intelligent agent instance construction methods of the first aspect; through the retrieval skill instance in the intelligent agent instance, the structured data is assembled with prompt words and retrieval enhancement is generated to obtain first target data; through the reasoning skill instance in the intelligent agent instance, a large language model and / or other intelligent agents are called to reason about the first target data to obtain second target data; through the execution skill instance in the intelligent agent instance, a data processing result is obtained according to the second target data.

[0018] In a fifth aspect, the present invention further provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, it implements the intelligent agent instance construction method as described in any one of the first aspects, or implements the data processing method based on the intelligent agent instance as described in the second aspect.

[0019] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, it implements the intelligent agent instance construction method as described in any one of the first aspects, or implements the data processing method based on the intelligent agent instance as described in the second aspect.

[0020] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements the intelligent agent instance construction method as described in any one of the first aspects, or implements the data processing method based on the intelligent agent instance as described in the second aspect.

[0021] The present invention provides an agent instance construction method and a data processing method based on the agent instance. The agent instance construction method generates metadata by responding to the agent definition operation input by the user, and the metadata carries the agent configuration information; generates an agent instance production unit in response to the initialization operation input by the user; and constructs the agent instance based on the agent configuration information through the agent instance production unit, and the agent instance includes: a memory unit instance and an agent skill instance chain, and the memory unit instance is used to store the first context data of the agent instance in the life cycle. The method constructs the agent instance (including the memory unit instance and the agent skill instance chain) based on the metadata through the agent instance production unit, so that the structure of the agent instance is more unified, easier to expand, and easier to understand and use. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0023] Figure 1 It is a schematic diagram of the interface for creating an intelligent agent provided by the prior art.

[0024] Figure 2 It is a schematic diagram of the task execution agent configuration interface provided by the prior art.

[0025] Figure 3 It is a schematic diagram of the custom agent configuration interface provided by the prior art.

[0026] Figure 4 It is a schematic diagram of the knowledge retrieval agent configuration interface provided by the prior art.

[0027] Figure 5 It is a flow chart of the method for constructing an intelligent agent instance provided by the present invention.

[0028] Figure 6 It is a schematic diagram of an application scenario of the intelligent agent instance production unit provided by the present invention.

[0029] Figure 7 It is a schematic diagram of the intelligent agent skill instance chain provided by the present invention.

[0030] Figure 8 It is a flow chart of the data processing method based on the intelligent agent instance provided by the present invention.

[0031] Fig. 9 It is one of the application scenario schematic diagrams of the intelligent agent instance provided by the present invention.

[0032] Fig.10 This is the second schematic diagram of the application scenario of the intelligent agent instance provided by the present invention.

[0033] Fig.11 This is the third schematic diagram of the application scenario of the intelligent agent instance provided by the present invention.

[0034] Fig.12 It is a structural schematic diagram of the intelligent agent instance construction device provided by the present invention.

[0035] Fig.13 It is a structural schematic diagram of a data processing device based on an intelligent agent instance provided by the present invention.

[0036] Fig.14 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION

[0037] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] In order to better understand the embodiments of the present invention, the background technology is first described in detail.

[0039] Take the function of an existing product agent as an example. Figure 1 It is a schematic diagram of the interface for creating an intelligent agent provided by the prior art. Figure 1 As can be seen, there are generally multiple templates for different scenarios, and the elements required to be configured for each template are different. Specifically, Figure 2 is a schematic diagram of a task execution agent configuration interface provided by the prior art. Figure 3is a schematic diagram of a custom agent configuration interface provided by the prior art. Figure 4 It is a schematic diagram of the knowledge retrieval agent configuration interface provided by the prior art.

[0040] Combination Figure 2-Figure 4 ,Differentiated agent configurations are caused by gradual iteration and ,the lack of a unified abstract framework, which makes it inconvenient for the use and ,expansion of agents. Each additional scenario requires a set of proprietary ,configurations, which are also difficult to understand.,The existing agent construction methods not only limit the ,versatility of agents, but also increase the complexity of the use of agents and ,the difficulty of expansion.

[0041] To solve the above problems, an embodiment of the present invention provides an intelligent agent instance construction method and a data processing method based on the intelligent agent instance. The intelligent agent instance construction method constructs an intelligent agent instance (including a memory unit instance and an intelligent agent skill instance chain) through an intelligent agent instance production unit based on metadata, so that the structure of the intelligent agent instance is more unified, easier to expand, and easier to understand and use.

[0042] It should be noted that the execution subject of the intelligent agent instance construction method involved in the embodiment of the present invention can be an intelligent agent instance construction device or an electronic device; the execution subject of the data processing method based on the intelligent agent instance involved in the embodiment of the present invention can be a data processing device based on the intelligent agent instance or an electronic device.

[0043] Optionally, the above-mentioned electronic devices may include: computers and mobile terminals, etc.

[0044] The following is a further description of the method for constructing an intelligent agent instance involved in an embodiment of the present invention.

[0045] Figure 5 It is a flow chart of the method for constructing an intelligent agent instance provided by the present invention. Figure 5 As shown, the method includes the following steps 501 to 503.

[0046] Step 501: In response to the agent definition operation input by the user, metadata is generated, and the metadata carries the agent configuration information.

[0047] Optionally, the agent configuration information may include: agent identification, agent name, agent description, creation time, update time, creator information, and agent skill interface function, etc.

[0048] Exemplarily, the agent skill interface function is as follows:

[0049]

[0050] It should be noted that the preparation skill instances, perception skill instances, retrieval skill instances, reasoning skill instances and execution skill instances involved below all need to implement the above-mentioned agent skill interface function.

[0051] Step 502: In response to the initialization operation input by the user, an agent instance production unit is generated.

[0052] Among them, the intelligent agent instance production unit can also be called an intelligent agent factory.

[0053] Step 503: construct an agent instance through the agent instance production unit based on the agent configuration information, the agent instance includes: a memory unit instance and an agent skill instance chain, the memory unit instance is used to store the first context data of the agent instance in its life cycle.

[0054] After generating metadata and an agent instance production unit, the electronic device constructs an agent instance based on the agent configuration information carried in the metadata through the agent instance production unit when receiving an agent instance creation request. The agent instance construction method constructs an agent instance (including a memory unit instance and an agent skill instance chain) based on metadata through the agent instance production unit, so that the structure of the agent instance is more unified, easier to expand, and easier to understand and use.

[0055] In some embodiments, the method may further include: the electronic device generates a session Session in response to a session creation operation input by a user; wherein the session Session is used to store agent instances.

[0056] For example, Figure 6 Schematic diagram of the application scenario of the intelligent agent instance production unit provided by the present invention. Figure 6 It can be seen that the electronic device can respond to the session creation operation input by the user and generate a session Session. Then, the electronic device generates an agent instance creation request in response to the activation operation input by the user through the session Session, and sends the agent instance creation request to the agent instance production unit. In this way, when the agent instance production unit receives the agent instance creation request, the electronic device constructs an agent instance through the agent instance production unit based on the agent configuration information carried by the metadata, and injects the agent instance into the session Session to interact with the user.

[0057] In some embodiments, the agent skill instance chain includes a preparation skill instance, a perception skill instance, a retrieval skill instance, a reasoning skill instance and an execution skill instance that are chained in sequence; wherein the preparation skill instance is used to respond to the initialization operation input by the user to initialize the agent instance; the perception skill instance is used to respond to the data processing operation input by the user to generate data to be processed and extract structured data from the data to be processed; the retrieval skill instance is used to perform prompt word (Prompt) assembly and retrieval enhanced generation (RAG) on the structured data to obtain the first target data; the reasoning skill instance is used to call the large language model (LLM) and / or other agents to reason about the first target data to obtain the second target data; the execution skill instance is used to obtain the data processing result according to the second target data.

[0058] It should be noted that the preparation of the skill instance is only executed once when the agent instance is initialized; each interaction between the user and the agent instance will be chained through the perception skill instance, retrieval skill instance, reasoning skill instance and execution skill instance.

[0059] Specifically, in the process of preparing the skill instance to initialize the agent instance, for the initialization of the agent skill instance chain, the prepared skill instance can determine the skill execution strategy information, and the skill execution strategy information may include: next skill (NextSkill), next stage (NextStage) and direct return (Return).

[0060] Optionally, a perception skill instance may include multiple sub-perception skill instances (e.g., speech-to-text and image recognition); a retrieval skill instance may include multiple sub-retrieval skill instances (e.g., prompt word assembly and vector retrieval); a reasoning skill instance may include multiple sub-reasoning skill instances (e.g., calling a large language model and calling other intelligent agents); an execution skill instance may include multiple sub-execution skill instances (e.g., Text-to-Image (TTI), Text-to-Speech (TTS), Text-to-Video (TTV), tool calls and data analysis (e.g., using Structured Query Language (SQL)), etc.). The number of multiple sub-perception skill instances, the number of multiple sub-retrieval skill instances, the number of multiple sub-reasoning skill instances, and the number of multiple sub-execution skill instances are not specifically limited here. The above-mentioned sub-perception skill instances, sub-retrieval skill instances, sub-reasoning skill instances, and sub-execution skill instances can all be referred to as sub-skill instances.

[0061] It should be noted that every interaction between the user and the agent instance will be chained through all sub-skill instances, but not all sub-skill instances will be executed.

[0062] Exemplarily, the retrieval enhanced generation (RAG) can be implemented by a preset vector retrieval knowledge base, a search engine, etc.

[0063] Exemplarily, the data to be processed may be text data, voice data, image data, documents, etc. Correspondingly, when the data to be processed is voice data, the perception skill instance can perform automatic speech recognition (ASR) to convert the voice data into text data, and the structured data is the text data; when the data to be processed is image data, the perception skill instance can perform image recognition to extract image information from the image data, and the structured data is the image information; when the data to be processed is a document, the perception skill instance can parse the document to extract summary information and content information of each paragraph from the document, and the structured data is the summary information and content information of each paragraph.

[0064] For example, Figure 7 Schematic diagram of the agent skill instance chain provided by the present invention. Figure 7 As can be seen from the figure, in the process of interacting with the user, preparing skill instances (corresponding to Figure 7 Preparation in the above example can respond to the initialization operation input by the user and initialize the agent instance; the perception skill instance (corresponding to Figure 7 Perception in the code can respond to the data processing operation input by the user, generate data to be processed, extract structured data from the data to be processed, and then retrieve skill instances (corresponding to Figure 7 The structured data is then assembled with prompts and retrieval enhanced generation (RAG) to obtain organized data, i.e., the first target data, and then the skill instance (corresponding to Figure 7 The reasoning in the inference can call the large language model (LLM) and / or other agents to reason about the first target data, obtain the reasoning result, i.e., the second target data, and then execute the skill instance (corresponding to Figure 7The execution (Action) in the skill instance can automatically identify whether it is necessary to perform related operations according to the second target data. If it is not necessary to perform related operations, the second target data is directly determined as the data processing result; if it is necessary to perform related operations, the related operations are performed according to the second target data (for example, calling external tools, TTI, TTS, TTV, etc. through the Application Programming Interface (API)) to obtain the data processing result. The execution skill instance can output the data processing result to the user end.

[0065] In some embodiments, the method may also include: after the perception skill instance responds to the data processing operation of the user input, generating a dialog flow context storage unit instance, the dialog flow context storage unit instance is used to store the second context data of the agent skill instance chain during the data processing process, the second context data including: dialog reference knowledge data, debugging auxiliary information and data flow.

[0066] The dialogue reference knowledge data refers to the referenced knowledge retrieved by searching the skill instance.

[0067] It should be noted that during the interaction between the user and the intelligent agent instance, as long as the skill instance is executed to output the data processing result to the user end, the electronic device will clear the dialog flow context storage unit instance until the next interaction with the user. After the perceived skill instance responds to the data processing operation input by the user, the dialog flow context storage unit instance is regenerated to store the second context data of the intelligent agent skill instance chain in the new round of data processing.

[0068] In some embodiments, the first context data may include: system prompts, external database table metadata definitions, external tool definitions, external document parsing data, historical conversation data, and cached global variables.

[0069] Since the large language model (LLM) has no context, the electronic device can set a maximum context length threshold according to the large language model (LLM), and save historical conversation data based on the maximum context length threshold to improve the reasoning effect.

[0070] Optionally, if the execution skill instance enables a sub-execution skill instance of a tool call, then when the intelligent agent instance is initialized, the electronic device writes the API interface information corresponding to the tool call to the external tool definition; if the execution skill instance enables a sub-execution skill instance of a data analysis, then when the intelligent agent instance is initialized, the electronic device writes the database table metadata information to the external database table metadata definition.

[0071] In an embodiment of the present invention, in response to an agent definition operation input by a user, metadata is generated, and the metadata carries agent configuration information; in response to an initialization operation input by a user, an agent instance production unit is generated; through the agent instance production unit, based on the agent configuration information, an agent instance is constructed, and the agent instance includes: a memory unit instance and an agent skill instance chain, and the memory unit instance is used to store the first context data of the agent instance in its life cycle. The method constructs an agent instance (including a memory unit instance and an agent skill instance chain) based on metadata through an agent instance production unit, so that the structure of the agent instance is more unified, easier to expand, and easier to understand and use.

[0072] The data processing method based on the agent instance involved in the embodiment of the present invention is further explained below.

[0073] Figure 8 is a flow chart of the data processing method based on the agent instance provided by the present invention, such as Figure 8 As shown, the method includes the following steps 801 to 804.

[0074] Step 801: generate data to be processed by responding to the data processing operation input by the user through the perception skill instance in the agent instance, and extract structured data from the data to be processed. The agent instance is based on Figure 5 The agent instance construction method shown is obtained.

[0075] Step 802: assemble prompt words and generate retrieval enhancement for structured data through the retrieval skill instance in the agent instance to obtain the first target data.

[0076] Step 803: Call the large language model and / or other agents through the reasoning skill instance in the agent instance to reason about the first target data to obtain the second target data.

[0077] Step 804: Obtain a data processing result according to the second target data through the execution skill instance in the agent instance.

[0078] The above process of determining the data processing results is the same as the process of determining the data processing results by the intelligent agent skill instance chain involved above, and will not be described in detail here.

[0079] In the embodiment of the present invention, the intelligent agent instance generates data to be processed in response to the data processing operation input by the user through the perception skill instance in the intelligent agent instance, and extracts structured data from the data to be processed. Figure 5The method for constructing an agent instance shown in the figure is obtained; by using the retrieval skill instance in the agent instance, the structured data is assembled with prompt words and retrieval enhancement is generated to obtain the first target data; by using the reasoning skill instance in the agent instance, the large language model and / or other agents are called to reason on the first target data to obtain the second target data; by using the execution skill instance in the agent instance, the data processing result is obtained according to the second target data. Based on the constructed agent instance, this method can interact with users efficiently and accurately, and provide users with more intelligent data processing services.

[0080] For example, Fig. 9 This is one of the application scenario diagrams of the intelligent agent example provided by the present invention. Fig. 9 It can be seen that if the user inputs a reference document to the agent instance, the perception skill instance can start the sub-execution skill instance of reading the document, parse the reference document, extract the summary information and the content information of each paragraph from the reference document, and the electronic device can save the summary information and the content information of each paragraph to the external document parsing data mentioned above.

[0081] For example, Fig.10 This is the second schematic diagram of the application scenario of the intelligent agent example provided by the present invention. Fig.10 It can be seen that if the user inputs two questions to the agent instance, namely question 1 and question 2, the reasoning skill instance can call the large language model (LLM) to reason about question 1 and question 2, and obtain answer 1 corresponding to question 1 and answer 2 corresponding to question 2. The electronic device can save answer 1 and answer 2 to the historical dialogue data mentioned above.

[0082] For example, Fig.11 This is the third schematic diagram of the application scenario of the intelligent agent example provided by the present invention. Fig.11 As can be seen from the figure, the reasoning skill instance can also obtain the required data from the first context data stored in the memory unit instance, obtain new first target data based on the first target data and the required data, and call the large language model (LLM) to reason about the new first target data.

[0083] The intelligent agent instance construction device provided by the present invention is described below. The intelligent agent instance construction device described below and the intelligent agent instance construction method described above can be referenced to each other.

[0084] Fig.12 is a schematic diagram of the structure of the intelligent agent instance construction device provided by the present invention, such as Fig.12 As shown, the device includes the following generating module 1201 and constructing module 1202.

[0085] The generation module 1201 is used to generate metadata in response to the agent definition operation input by the user, and the metadata carries the agent configuration information; and to generate an agent instance production unit in response to the initialization operation input by the user.

[0086] Construction module 1202 is used to construct an agent instance through the agent instance production unit based on the agent configuration information. The agent instance includes: a memory unit instance and an agent skill instance chain. The memory unit instance is used to store the first context data of the agent instance in its life cycle.

[0087] Optionally, the agent skill instance chain includes a preparation skill instance, a perception skill instance, a retrieval skill instance, a reasoning skill instance and an execution skill instance that are chained in sequence; wherein the preparation skill instance is used to respond to the initialization operation input by the user to initialize the agent instance; the perception skill instance is used to respond to the data processing operation input by the user to generate data to be processed and extract structured data from the data to be processed; the retrieval skill instance is used to perform prompt word assembly and retrieval enhancement generation on the structured data to obtain first target data; the reasoning skill instance is used to call a large language model and / or other agents to reason on the first target data to obtain second target data; and the execution skill instance is used to obtain a data processing result based on the second target data.

[0088] Optionally, generation module 1201 is also used to generate a dialog flow context storage unit instance after the perception skill instance responds to the data processing operation of the user input, and the dialog flow context storage unit instance is used to store the second context data of the intelligent agent skill instance chain during the data processing process, and the second context data includes: dialog reference knowledge data, debugging auxiliary information and data flow.

[0089] Optionally, the generation module 1201 is further used to generate a session Session in response to a session creation operation input by the user; wherein the session Session is used to store the agent instance.

[0090] Optionally, the first context data includes: system prompt words, external database table metadata definition, external tool definition, external document parsing data, historical conversation data, and cached global variables.

[0091] The following is a description of the data processing device based on the agent instance provided by the present invention. The data processing device based on the agent instance described below and the data processing method based on the agent instance described above can be referenced to each other.

[0092] Fig.13 is a schematic diagram of the structure of the data processing device based on the agent instance provided by the present invention, such as Fig.13 As shown, the device includes the following processing module 1301.

[0093] The processing module 1301 is used to generate data to be processed in response to the data processing operation input by the user through the perception skill instance in the intelligent agent instance, and extract structured data from the data to be processed. The intelligent agent instance is based on Figure 5 The method for constructing the intelligent agent instance shown is used to obtain the first target data by assembling prompt words and generating retrieval enhancement on the structured data through the retrieval skill instance in the intelligent agent instance; the large language model and / or other intelligent agents are called to infer the first target data through the reasoning skill instance in the intelligent agent instance to obtain the second target data; and the data processing result is obtained according to the second target data through the execution skill instance in the intelligent agent instance.

[0094] Fig.14 is a schematic diagram of the structure of the electronic device provided by the present invention, such as Fig.14 As shown, the electronic device may include: a processor 1410, a communications interface 1420, a memory 1430 and a communication bus 1440, wherein the processor 1410, the communications interface 1420 and the memory 1430 communicate with each other via the communication bus 1440. The processor 1410 may call the logic instructions in the memory 1430 to execute the above-mentioned agent instance construction method, or the data processing method based on the agent instance.

[0095] In addition, the logic instructions in the above-mentioned memory 1430 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk.

[0096] On the other hand, the present invention also provides a computer program product, which includes a computer program. The computer program can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the above-mentioned intelligent agent instance construction method, or a data processing method based on the intelligent agent instance.

[0097] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is implemented to execute the above-mentioned intelligent agent instance construction method, or a data processing method based on the intelligent agent instance.

[0098] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0099] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0100] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for constructing an intelligent agent instance, It is characterized in that include: In response to an agent definition operation input by a user, metadata is generated, wherein the metadata carries agent configuration information; In response to the initialization operation input by the user, generating an agent instance production unit; By means of the agent instance production unit, an agent instance is constructed based on the agent configuration information, wherein the agent instance comprises: a memory unit instance and an agent skill instance chain, wherein the memory unit instance is used to store the first context data of the agent instance in its life cycle; The agent skill instance chain includes a preparation skill instance, a perception skill instance, a retrieval skill instance, a reasoning skill instance and an execution skill instance connected in a chain in sequence; The prepared skill instance is used to initialize the agent instance in response to the initialization operation input by the user; The perception skill instance is used to respond to the data processing operation input by the user, generate data to be processed, and extract structured data from the data to be processed; The retrieval skill instance is used to perform prompt word assembly and retrieval enhancement generation on the structured data to obtain the first target data; The reasoning skill instance is used to call a large language model and / or other intelligent agents to reason about the first target data to obtain second target data; The execution skill instance is used to obtain a data processing result according to the second target data; The agent configuration information includes agent identification, agent name, agent description, creation time, update time, creator information and agent skill interface function; The first context data includes system prompt words, external database table metadata definition, external tool definition, external document parsing data, historical conversation data and cached global variables.

2. The method for constructing an agent instance according to claim 1, It is characterized in that The method further comprises: After the perception skill instance responds to the data processing operation of the user input, a dialog flow context storage unit instance is generated. The dialog flow context storage unit instance is used to store the second context data of the intelligent agent skill instance chain during the data processing process. The second context data includes: dialog reference knowledge data, debugging auxiliary information and data flow.

3. The method for constructing an agent instance according to claim 1 or 2, It is characterized in that The method further comprises: In response to the session creation operation input by the user, a session Session is generated; The session is used to store the agent instance.

4. The method for constructing an agent instance according to claim 1 or 2, It is characterized in that The first context data includes: system prompt words, external database table metadata definition, external tool definition, external document parsing data, historical conversation data and cached global variables.

5. A data processing method based on agent instance, It is characterized in that include: Generate data to be processed in response to a data processing operation input by a user through a perception skill instance in an agent instance, and extract structured data from the data to be processed, wherein the agent instance is obtained based on the agent instance construction method according to any one of claims 1 to 4; By using the retrieval skill instance in the agent instance, the structured data is assembled with prompt words and retrieval enhancement is generated to obtain first target data; By using the reasoning skill instance in the agent instance, calling a large language model and / or other agents, reasoning on the first target data, and obtaining second target data; By executing the skill instance in the agent instance, a data processing result is obtained according to the second target data.

6. An intelligent agent instance construction device, It is characterized in that include: A generation module, used to generate metadata in response to an agent definition operation input by a user, wherein the metadata carries agent configuration information; In response to the initialization operation input by the user, generating an agent instance production unit; A construction module, used to construct an agent instance based on the agent configuration information through the agent instance production unit, wherein the agent instance includes: a memory unit instance and an agent skill instance chain, wherein the memory unit instance is used to store the first context data of the agent instance in the life cycle; The agent skill instance chain includes a preparation skill instance, a perception skill instance, a retrieval skill instance, a reasoning skill instance and an execution skill instance connected in a chain in sequence; The prepared skill instance is used to initialize the agent instance in response to the initialization operation input by the user; The perception skill instance is used to respond to the data processing operation input by the user, generate data to be processed, and extract structured data from the data to be processed; The retrieval skill instance is used to perform prompt word assembly and retrieval enhancement generation on the structured data to obtain the first target data; The reasoning skill instance is used to call a large language model and / or other intelligent agents to reason about the first target data to obtain second target data; The execution skill instance is used to obtain a data processing result according to the second target data; The agent configuration information includes agent identification, agent name, agent description, creation time, update time, creator information and agent skill interface function; The first context data includes system prompt words, external database table metadata definition, external tool definition, external document parsing data, historical conversation data and cached global variables.

7. A data processing device based on an agent instance, It is characterized in that include: A processing module, configured to generate data to be processed in response to a data processing operation input by a user through a perception skill instance in an agent instance, and extract structured data from the data to be processed, wherein the agent instance is obtained based on the agent instance construction method according to any one of claims 1 to 4; and to perform prompt word assembly and retrieval enhancement generation on the structured data through a retrieval skill instance in the agent instance to obtain first target data; Through the reasoning skill instance in the agent instance, a large language model and / or other agents are called to infer the first target data to obtain second target data; through the execution skill instance in the agent instance, a data processing result is obtained according to the second target data.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, it implements the agent instance construction method as described in any one of claims 1 to 4, or implements the agent instance-based data processing method as described in claim 5.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, it implements the agent instance construction method as described in any one of claims 1 to 4, or implements the agent instance-based data processing method as described in claim 5.