Intelligent agent application object generation method and device, computer equipment and storage medium

By stripping public services into public service pools and referencing them in agent application objects, the problem of low generation efficiency of traditional agent application objects is solved, resource sharing and rapid compilation and construction are realized, and the generation efficiency and responsiveness are improved.

CN118605884AActive Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Application Number
CN202411081852.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-08
Publication Date
2024-09-06
Estimated Expiration
2044-08-08

AI Technical Summary

Technical Problem

Traditional agent application object generation efficiency is low, resulting in a waste of computing and storage resources and long compilation and construction time.

Method used

By stripping the public services in the topology representation diagram into a public service pool, only the part of the agent application object itself is compiled and constructed, and the public services in the public service pool are used for initialization and invocation to achieve resource sharing and rapid compilation and construction.

Benefits of technology

It greatly improves the generation efficiency of agent application objects, saves computing and storage resources, reduces compilation and construction time, and improves single-node Agent service response and concurrency capabilities.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118605884A
    Figure CN118605884A
Patent Text Reader

Abstract

The invention relates to an agent application object generation method and device, computer equipment and a storage medium. The method comprises: in response to a service request, determining a topology representation graph indicated by the service request, the topology representation graph comprising a plurality of topology nodes, each topology node representing a component, and at least one component using a public service in a public service pool; compiling the topology representation graph to initialize a component represented by the compiled topology node, and obtaining an initialized component; wherein when the target component represented by the compiled topological node uses the target public service in the public service pool, compiling the function of using the target public service by the target component in a manner of quoting the target public service in the public service pool; and in response to completion of compiling of the topological representation graph, obtaining an agent application object determined based on the initialized component corresponding to each topological node in the topological representation graph. By adopting the method, the generation efficiency of the intelligent agent application object can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for generating an intelligent agent application object. Background Art

[0002] With the development of computer technology, agent applications have emerged. Agent applications are intelligent applications. Intelligent applications can be implemented based on large language models. Large language models (LLM) are artificial intelligence models designed to understand and generate human language. Agent applications based on large language models have their behavior determined by LLM based on the current state of the agent and external inputs. They can be used specifically to solve a certain type of problem, such as legal consulting agents, which are used specifically to provide legal consulting services.

[0003] In traditional technology, the generation of intelligent agent application objects can be obtained by compiling a pre-built topological representation graph, but there is often a problem of low efficiency in the generation of intelligent agent application objects. Summary of the invention

[0004] Based on this, it is necessary to provide an intelligent agent application object generation method, device, computer equipment, computer readable storage medium and computer program product that can improve the generation efficiency of intelligent agent application objects in response to the above technical problems.

[0005] In a first aspect, the present application provides a method for generating an intelligent agent application object. The method comprises:

[0006] In response to a service request, determining a topology representation graph indicated by the service request, the topology representation graph comprising a plurality of topology nodes, each topology node representing a component, at least one of the components using a public service in a public service pool;

[0007] Compiling the topology representation graph to initialize components represented by the compiled topology nodes to obtain initialized components;

[0008] Wherein, when the target component represented by the compiled topological node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool;

[0009] In response to the completion of compiling the topology representation graph, an intelligent agent application object determined based on the initialized components corresponding to each topology node in the topology representation graph is obtained.

[0010] In a second aspect, the present application also provides an intelligent agent application object generation device. The device comprises:

[0011] A topology representation graph determination module, configured to determine, in response to a service request, a topology representation graph indicated by the service request, wherein the topology representation graph includes a plurality of topology nodes, each topology node represents a component, and at least one of the components uses a public service in a public service pool;

[0012] A topology representation graph compiling module is used to compile the topology representation graph to initialize the components represented by the compiled topology nodes to obtain initialized components; wherein, when the target component represented by the compiled topology node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool;

[0013] The intelligent agent application object obtaining module is used to obtain the intelligent agent application object determined by the initialized components corresponding to each topological node in the topological representation graph in response to the completion of compiling the topological representation graph.

[0014] In some embodiments, the service request is a request initiated by a first user in a first session. The intelligent agent application object generation method of the present application also includes: an intelligent agent application object running module, which is used to run the intelligent agent application object in a stateless mode, and obtain the output information of the intelligent agent application object for the service request; use the output information as a response result of the service request, and return the response result to the terminal of the first user.

[0015] In some embodiments, the intelligent agent application object running module is also used to: determine the input information of the intelligent agent application object; input the input information to the intelligent agent application object to run the intelligent agent application object, and obtain the output information of the intelligent agent application object in response to the service request; determine the session state information under the first session based on the input information and the state information of the intelligent agent application object during the running process, and associate the session state information with the session identifier of the first session and save it in the distributed cache.

[0016] In some embodiments, the intelligent agent application object running module is also used to: input the input information into the intelligent agent application object; call each initialized component in the intelligent agent application object to process the input information according to the topological representation diagram, and obtain the output information of the intelligent agent application object for the service request; wherein, when the called component is a component that uses public services in the public service pool, send a service call request to the public service in the public service pool referenced by the called component, and continue to participate in the processing of the input information based on the response result of the service call request.

[0017] In some embodiments, the intelligent agent application object generation device of the present application also includes: an intelligent agent application object caching module, which is used to cache the intelligent agent application object, the topological representation map and the compilation parameters corresponding to the topological representation map, and establish an association relationship between the intelligent agent application object, the topological representation map and the compilation parameters corresponding to the topological representation map.

[0018] In some embodiments, the service request is a request initiated by a first user in a first session. The intelligent agent application object generation device of the present application also includes: a service request response module, which is used to respond to a service request newly initiated by the first user in the first session, obtain the session identifier and user input information of the first session from the newly initiated service request; obtain the session status information under the first session according to the session identifier; determine the input information of the intelligent agent application object according to the session status information and the user input information; and input the determined input information into the intelligent agent application object to obtain a response result of the newly initiated service request.

[0019] In some embodiments, the intelligent agent application object generation device of the present application also includes: a response result caching module, which is used to save the response result of the newly initiated service request to the distributed cache to update the session status information under the first session in the distributed cache; the updated session status information is used to determine the response result of the subsequent service request initiated by the first user under the first session.

[0020] In some embodiments, the service request response module is further used to respond to the service request initiated by the second user in the second session, obtain the target topology representation map and target compilation parameters indicated by the service request initiated by the second user in the second session; when the target topology representation map is associated with the cached topology representation map of the intelligent agent application object Figure 1and the target compilation parameters are consistent with the compilation parameters associated with the cached intelligent application object, the cached intelligent application object is used as the target intelligent application object under the second session; and the response result of the service request initiated by the second user in the second session is determined through the target intelligent application object.

[0021] In some embodiments, the topology representation graph compilation module is also used to: determine the node dependency relationship between each topology node in the topology representation graph based on the connection relationship between each topology node in the topology representation graph; determine the compilation order of each topology node based on the node dependency relationship between each topology node; compile each topology node in the topology representation graph in sequence according to the compilation order to initialize the components represented by the compiled topology nodes to obtain initialized components.

[0022] In some embodiments, the topology representation map determination module is also used to determine the topology representation map and compilation parameters indicated by the service request in response to the service request; the topology representation map compilation module is also used to compile the topology representation map according to the compilation parameters to initialize the components represented by the compiled topology nodes to obtain initialized components.

[0023] In some embodiments, among the components respectively represented by the multiple topological nodes, at least one component is a pre-trained large language model.

[0024] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above-mentioned agent application object generation method are implemented.

[0025] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above-mentioned method for generating an intelligent agent application object when executed by a processor.

[0026] In a fifth aspect, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above-mentioned method for generating an intelligent agent application object are implemented.

[0027] The above-mentioned intelligent agent application object generation method, device, computer equipment, storage medium and computer program product, in response to a service request, determine a topological representation graph indicated by the service request, the topological representation graph includes multiple topological nodes, each topological node represents a component, at least one component uses the public service in the public service pool, compiles the topological representation graph to initialize the component represented by the compiled topological node, and obtains the initialized component. In response to the completion of the compilation of the topological representation graph, an intelligent agent application object determined based on the initialized components corresponding to each topological node in the topological representation graph is obtained, wherein, when the target component represented by the compiled topological node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool. In this way, the public service can be separated from the intelligent agent application object, so that in the process of generating the intelligent agent application object, only the part of the intelligent agent application object itself needs to be compiled and constructed, and the computing and storage resources occupied are relatively small, thereby realizing the rapid compilation and construction of the intelligent agent application object, thereby improving the generation efficiency of the intelligent agent application object. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0029] Figure 1 A diagram of an application environment of an intelligent agent application object generation method in some embodiments;

[0030] Figure 2 A schematic diagram of a flow chart of a method for generating an intelligent agent application object in some embodiments;

[0031] Figure 3 is a schematic diagram of a topological representation diagram in some embodiments;

[0032] Figure 4 Schematic diagrams of topological representation diagrams in other embodiments;

[0033] Figure 5 A schematic diagram of the overall process of a method for generating an intelligent agent application object in some embodiments;

[0034] Figure 6 A schematic diagram of a flow chart of response steps for a newly initiated service request in some embodiments;

[0035] Figure 7 A schematic diagram of an Agent application service framework in some embodiments;

[0036] Figure 8 It is a schematic diagram of the Agent application service framework in some other embodiments;

[0037] Fig. 9 A schematic diagram of the compilation process of an Agent application object in some embodiments;

[0038] Fig.10 A schematic diagram of a service flow of an Agent application object in some embodiments;

[0039] Fig.11 It is a structural block diagram of an intelligent agent application object generation device in some embodiments;

[0040] Fig.12 is an internal structure diagram of a computer device in some embodiments;

[0041] Fig.13 1 is a diagram of the internal structure of a computer device in some other embodiments. DETAILED DESCRIPTION

[0042] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0043] The method for generating an intelligent agent application object provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 and the server 104 can communicate through a network, such as a wired or wireless network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, can be integrated on the server 104, or can be placed on the cloud or other servers. The terminal 102 can be, but is not limited to, various desktop computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be an independent physical server, or it can be a server cluster or distributed system composed of multiple physical servers, or it can be a cloud server that provides cloud computing services.

[0044] The method for generating an intelligent agent application object provided in the embodiment of the present application can be performed by a computer device in each step. A computer device refers to an electronic device with data calculation, processing and storage capabilities. Figure 1Taking the application environment shown as an example, the intelligent agent application object generation method can be executed by the terminal 102 alone, or by the server 104 alone, or by the terminal 102 and the server 104 interacting and cooperating to execute, which is not limited in this application.

[0045] Taking the server 104 executing alone as an example, the server can respond to the service request sent by the terminal, determine the topology representation graph indicated by the service request, the topology representation graph includes multiple topology nodes, each topology node represents a component, at least one component uses the public service in the public service pool, and compile the topology representation graph to initialize the component represented by the compiled topology node to obtain the initialized component, wherein, when the target component represented by the compiled topology node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool, and in response to the completion of the compilation of the topology representation graph, an intelligent agent application object determined based on the initialized components corresponding to each topology node in the topology representation graph is obtained.

[0046] In some embodiments, Figure 2 As shown, a method for generating an intelligent agent application object is provided, and the method is executed by a computer device, and the computer device can be Figure 1 In the server 104 or terminal 102, in the embodiment of the present application, the method is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0047] Step 202: In response to the service request, determine a topology representation graph indicated by the service request, where the topology representation graph includes a plurality of topology nodes, each topology node represents a component, and at least one component uses public services in a public service pool.

[0048] Among them, the service request is a request for the intelligent agent application to provide a service. In different application scenarios, the service requested by the service request may be different services. For example, in the legal consulting application scenario, the service request is used to request the corresponding intelligent agent application to provide legal consulting services. In the medical consulting application scenario, the service request is used to request the corresponding intelligent agent application to provide medical consulting services. The intelligent agent application is an application based on the Agent. In the intelligent agent application, the behavior of the Agent can be determined according to the current state of the Agent and external input. In a specific application, the intelligent agent application of the present application can be an AI-based intelligent agent application, for example, it can be an LLM-based intelligent agent application.

[0049] The topological representation graph is used to represent the intelligent agent application. The topological representation graph includes multiple topological nodes, each of which represents a component. That is, the topological representation graph is a graph that represents the components contained in the intelligent agent application with topological nodes. The connection relationship between the topological nodes in the topological representation graph represents the dependency relationship between the topological nodes. The topological representation graph can be specifically a DAG (directed acyclic graph). For example, taking an intelligent agent application based on LLM as an example, the various tools, LLM and other components that the Agent application depends on are represented as topological nodes, and connected according to the dependency relationship, so that the topological representation graph of the intelligent agent application based on LLM can be obtained. Refer to Figure 3 , is a schematic diagram of a topological representation diagram in some embodiments, Figure 3 In the topological representation graph, the final node is the agent, whose upstream depends on the service nodes and various tool nodes provided by LLM. LLM and various tools are the components represented by each topological node in the topological representation graph. Figure 3 It can also be seen that each tool will rely on services such as databases and search engines, and the overall compilation will be built into an Agent application object to provide external services.

[0050] Among the components represented by each topological node of the topological representation graph, at least one component uses the public services in the public service pool, that is, the operation of at least one component depends on one or more public services in the public service pool. The public service pool here refers to a service pool composed of multiple public services. These public services are the services that the components in the intelligent application object need to use during the operation. In this application, these services are separated from the intelligent application object to form independent services. The advantages are mainly: first, it greatly saves the compilation and construction time of the topological representation graph. In general, database connection, network resource initialization, etc. are relatively time-consuming, and there are problems with service stability guarantee for separate calls; second, it saves a lot of computing, storage and network resources. Different Agents only reference objects in the resource pool during the compilation and construction process, and do not occupy them independently. They apply for them when needed and release them after use, thereby realizing the sharing of public service resources and greatly improving resource utilization efficiency. For example, refer to Figure 4 , which is a schematic diagram of a topological representation diagram in some other embodiments, Figure 3 Taking the topological representation diagram in as an example, the database, search engine, large model service, etc. that each component depends on can be separated out to form a public service pool.

[0051] Specifically, the topology representation map indicated by the service request is the topology representation map determined according to the service request. For different application scenarios, the intelligent agent applications that provide services are usually different, so different topology representation maps can be pre-built for different application scenarios. After receiving the service request, the server can determine the corresponding topology representation map according to the application scenario identifier indicated by the service request, and the topology representation map is the topology representation map indicated by the service request.

[0052] In some embodiments, among the components represented by the multiple topological nodes, at least one component is a pre-trained large language model.

[0053] Step 204, compile the topology representation graph to initialize the components represented by the compiled topology nodes to obtain initialized components; wherein, when the target component represented by the compiled topology node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool.

[0054] Among them, compiling the topological representation graph, that is, compiling each topological node contained in the topological representation graph, by compiling each topological node, the component represented by the topological node can be initialized, after each topological node is compiled, the initialized component corresponding to the topological node can be obtained.

[0055] Specifically, the service request may also indicate compilation parameters, which may be parameters required during the initialization process of each component. For example, for the Agent component, the compilation parameters may be Agent parameters, for the LLM component, the compilation parameters may be LLM parameters, and for the tool component, the compilation parameters may be tool parameters. After receiving the service request, the server obtains the compilation parameters from the service request, and after determining the topology representation map according to the service request, it may compile the determined topology representation map according to the obtained compilation parameters.

[0056] Among the components represented by the topological node, at least one component uses the public service of the public service pool. Therefore, in the process of compiling the topological representation graph, when the target component represented by the compiled topological node does not use the public service, the initialization is completed according to the customization of the target component; when the target component represented by the compiled topological node uses the target public service in the public service pool, the server can reference the target public service in the public service pool to compile the function of the target component using the target public service, and for other functions in the target component, continue to initialize according to the customization of the target component. Exemplarily, the reference to the target public service in the public service pool can specifically record the access location of the target public service in the public service pool, for example, it can be a uniform resource locator (URL) that records the target public service.

[0057] Optionally, when compiling the topological representation graph, the server can also determine the dependency relationship between the topological nodes according to the connection relationship between the topological nodes in the topological representation graph, and then determine the compilation order of the topological nodes according to the dependency relationship, and compile each topological node in sequence according to the compilation order to initialize the components represented by the compiled topological nodes to obtain the initialized components. Optionally, when compiling the topological representation graph, for topological nodes that have no dependency relationship with each other, multiple threads can be called to compile them simultaneously to further improve the efficiency of generating intelligent agent application objects.

[0058] Step 206, in response to the completion of compiling the topology representation graph, obtain an intelligent agent application object determined based on the initialized components corresponding to each topology node in the topology representation graph.

[0059] Specifically, the server can determine whether the compilation of each topological node in the topological representation graph is completed. When all topological nodes are compiled, the server can determine that the compilation of the topological representation graph is completed. The server can obtain an intelligent application object in response to the completion of the compilation of the topological representation graph. The intelligent application object is an object determined based on the initialized components corresponding to each topological node in the topological representation graph.

[0060] Furthermore, the server may obtain a response result of the service request by running the agent application object, and then return the response result to the terminal that sent the service request.

[0061] Combine the following Figure 5 The above steps 202 to 206 are described by way of example. Figure 5, is a schematic diagram of the overall process of the agent application object generation method in some embodiments. After receiving the service request, the server can determine the topology representation graph indicated by the service request. Assuming that the topology representation graph contains three topology nodes, namely, topology node A, topology node B and topology node C, wherein the component represented by topology node C uses public services, then in the process of compiling the topology representation graph, when compiling to topology node A, the component represented by topology node A can be customized initialized to obtain the initialized component corresponding to topology node A, when compiling to topology node B, the component represented by topology node B can be customized initialized to obtain the initialized component corresponding to topology node B, when compiling to topology node C, the component represented by topology node C is compiled by referencing public services for some functions that use public services, and other parts are customized initialized. After obtaining the initialized component corresponding to topology node C, the compilation of the topology representation graph is completed, and the agent application object is obtained, which contains the initialized component corresponding to topology node A, the initialized component corresponding to topology node B, and the initialized component corresponding to topology node C.

[0062] In the above-mentioned intelligent agent application object generation method, in response to a service request, a topology representation graph indicated by the service request is determined, the topology representation graph includes multiple topology nodes, each topology node represents a component, at least one component uses the public service in the public service pool, the topology representation graph is compiled to initialize the component represented by the compiled topology node, and the initialized component is obtained. In response to the completion of the compilation of the topology representation graph, an intelligent agent application object determined based on the initialized components corresponding to each topology node in the topology representation graph is obtained, wherein, when the target component represented by the compiled topology node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool. In this way, the public service can be separated from the intelligent agent application object, so that in the process of generating the intelligent agent application object, only the part related to the intelligent agent application object itself needs to be compiled and constructed, and the computing and storage resources occupied are relatively small, thereby realizing the rapid compilation and construction of the intelligent agent application object, thereby improving the generation efficiency of the intelligent agent application object.

[0063] In some embodiments, the service request is a request initiated by the first user under the first session. The intelligent application object generation method of the present application also includes: running the intelligent application object in a stateless mode, obtaining the output information of the intelligent application object in response to the service request; using the output information as a response result of the service request, and returning the response result to the terminal of the first user.

[0064] Among them, a session generally refers to all the contents of multiple rounds of interactions between the same user and the Agent application object for the same task, which may include information such as dialogue and Agent application object status. The stateless mode is a working mode in which state data is not saved. When the agent application object is run in the stateless mode, the state data is not saved in the agent application object. At this time, the agent application object is a stateless object. For example, when the agent application object is run in the stateless mode, the server can save the session state information during the session to the local database, so that the server can query the session state information from the local database at the next service request under the first session; or the server can carry the session state information during the session in the response result of the service request and return it to the user terminal. When the terminal initiates the next service request under the first session, it can carry the session state information in the service request and send it to the server.

[0065] Specifically, after obtaining the intelligent application object, the server can further determine the input information of the intelligent application object according to the service request, and then run the intelligent application object in a stateless mode, thereby obtaining the output information of the intelligent application object corresponding to the service request in the first session. The server can use the output information as the response result of the service request and return the response result to the terminal of the first user who initiated the service request.

[0066] It is understandable that after the first user obtains the response result, he can continue to initiate service requests under the first session. The server can cache the generated intelligent agent application object. When the service request under the first session is received again, the intelligent agent application object can be run again to obtain the response result.

[0067] In this embodiment, since the agent application object can be run in a stateless mode, the session state information under the first session can be separated from the Agent application object, so that the Agent application object can be reused between different users and different sessions.

[0068] In some embodiments, an intelligent agent application object is run in a stateless mode to obtain output information of the intelligent agent application object in response to a service request, including: determining input information of the intelligent agent application object; inputting the input information into the intelligent agent application object to run the intelligent agent application object, and obtaining output information of the intelligent agent application object in response to the service request; and determining session state information under the first session based on the input information and state information during the running of the intelligent agent application object.

[0069] Specifically, the intelligent agent application object is usually generated when the first service request is initiated under a new session. Since it is the first service request, the intelligent agent application object has no historical session state information under the session. Then the user input information is the input information of the intelligent agent application object. The user input information is carried in the service request. After receiving the service request, the server can extract the user input information from the service request. When running the intelligent agent application object, the server can input the user input information into the intelligent agent application object, thereby obtaining the output information of the intelligent agent application object for the service request.

[0070] The session state information under the first session includes data such as input information of each service request and state information of the intelligent agent application object during each operation. Therefore, after the server obtains output information for the current service request by running the intelligent agent application object, it can determine the session state information corresponding to the current service request based on the input information, state information of the intelligent agent application object during operation, etc. The server can associate the session state information with the session identifier of the first session and save it in the distributed cache. Since the session state information can be saved in the distributed cache, the intelligent agent application object is separated and decoupled from the session state information, realizing the stateless operation of the intelligent agent application object, thereby maximizing the reuse of the intelligent agent application object between different users and different sessions.

[0071] Exemplarily, the server may also determine the session state information under the first session according to the input information, the output information of the agent application object for the service request, and the state information of the agent application object during operation. Exemplarily, the distributed cache may be Redis, and of course may be other forms, which are not limited in this application.

[0072] In the above embodiment, since the session state information under the first session can be determined based on the input information and the output information, the session state information is associated with the session identifier of the first session and saved in the distributed cache, which not only realizes the stateless operation of the intelligent application object, but also better supports the sharing and management of state data.

[0073] In some embodiments, inputting input information into an intelligent agent application object to run the intelligent agent application object, and obtaining output information of the intelligent agent application object for a service request, includes: inputting input information into the intelligent agent application object; calling each initialized component in the intelligent agent application object to process the input information according to the topology representation graph, and obtaining output information of the intelligent agent application object for the service request;

[0074] When the called component is a component that uses public services in the public service pool, a service call request is sent to the public services in the public service pool referenced by the called component, and the processing of input information continues based on the response result of the service call request.

[0075] Specifically, during the generation process of the intelligent agent application object, when compiling the topological representation graph of the intelligent agent application, when the target component represented by the compiled topological node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool, so that in the obtained intelligent agent application object, the function of the initialized component corresponding to the topological node of this type uses the public service is realized through the public service. Based on this, in this embodiment, when running the intelligent agent application object, the server can input input information into the intelligent agent application object, call each initialized component in the intelligent agent application object to process the input information according to the topological representation graph, and obtain the output information of the intelligent agent application object for the service request. In this process, when a certain called component is a component that uses the public service in the public service pool, the server can access the public service used according to the access location of the public service used by the component recorded in the compilation process, that is, send a service call request to the public service, and after receiving the response result returned by the public service, the server continues to call the component and continues to participate in the processing of the input information based on the response result. It can be understood that for other components that do not need to use public services, the input information can be directly processed by the component.

[0076] For example, in the process of calling each initialized component, the dependency relationship between each topological node can be determined according to the connection relationship between each topological node in the topological representation diagram, and then the calling order of each node can be determined according to the dependency relationship, and the initialized components corresponding to each topological node can be called in sequence according to the calling order. In a specific application, the components corresponding to the topological nodes without dependency relationships can be called first. When there are multiple topological nodes that do not have dependent topological nodes, the calling order of these topological nodes can be randomly determined. Figure 4 As an example, assume that the topological representation diagram only includes Figure 4 For the topological nodes shown in the figure, the determined calling order can be tool A, tool B, tool C, large model, and intelligent agent.

[0077] In this embodiment, since each initialized component in the intelligent agent application object can be called to process input information according to the topological representation diagram, and when the called component is a component that uses public services in the public service pool, a service call request is sent to the public service in the public service pool referenced by the called component, and the processing of the input information is continued based on the response result of the service call request, the Agent application service can achieve efficient and stable services while minimizing resources, save a lot of computing, storage and network resources, and improve the response and concurrency capabilities of single-node Agent services.

[0078] In some embodiments, the intelligent agent application object generation method of the present application also includes: caching the intelligent agent application object, the topological representation map and the compilation parameters corresponding to the topological representation map, and establishing an association relationship between the intelligent agent application object, the topological representation map and the compilation parameters corresponding to the topological representation map.

[0079] The compilation parameters may be parameters required during the initialization of each component. For example, for an Agent component, the compilation parameters may be Agent parameters; for an LLM component, the compilation parameters may be LLM parameters; and for a tool component, the compilation parameters may be tool parameters.

[0080] Specifically, in this embodiment, for the intelligent agent application object that has been compiled and generated, the server can cache the intelligent agent application object, the topology representation map used when compiling and generating the intelligent agent application object, and the compilation parameters used in the compilation process of the topology representation map, and can establish an association between the intelligent agent application object, the topology representation map and the compilation parameters, so that when a service request is received under a new session, the server can first query whether there is a reusable intelligent agent application object in the cache based on the topology representation map and the compilation parameters. If so, it can be reused directly, thereby avoiding the time and resource consumption caused by multiple compilations.

[0081] In some embodiments, the service request is a request initiated by the first user in the first session, and the agent application object generation method provided by the present application further includes a response step for the newly initiated service request, referring to Figure 6 , including:

[0082] Step 602: In response to a service request newly initiated by the first user in the first session, a session identifier and user input information of the first session are obtained from the newly initiated service request.

[0083] Among them, the user input information is the information input by the user to prompt the intelligent application object to perform task processing. Exemplarily, the user input information can specifically be a question input by the user that the user expects the intelligent application object to answer. For example, in a legal consulting application scenario, the user input information can be a legal issue that the user wants to consult.

[0084] Specifically, the server generates an intelligent agent application object according to the service request initiated by the first user in the first session, and the intelligent agent application object can continue to be applied to the service request newly initiated by the first user in the first session. When creating the first session, the server can generate a session identifier for the first session, and the session identifier is used to uniquely identify the first session. The server can return the session identifier to the terminal of the first user, so that the terminal of the first user can carry the session identifier in the service request each time it initiates a service request during the first session. When the server receives the service request newly initiated by the first user in the first session, it can obtain the session identifier of the first session from the newly initiated service request, and the server can also obtain user input information from the newly initiated service request.

[0085] Step 604: Acquire session state information of the first session according to the session identifier.

[0086] Specifically, the state information of each service request under the first session may be stored in association with the session identifier of the first session, so that after the server obtains the session identifier from the service request, it can search for the session state information associated with it according to the session identifier.

[0087] Exemplarily, during the first session, the server can run the intelligent agent application object in a stateless mode, and store the session state information under the first session in a distributed cache in association with the session identifier corresponding to the first session, so that the server can search the session state information under the first session from the distributed cache according to the session identifier.

[0088] Exemplarily, during the first session, the server may run the agent application object in a stateful mode, and store the session status information of the first session in the agent application object in association with the session identifier corresponding to the first session, so that the server can find the session status information of the first session from the agent application object according to the session identifier.

[0089] Step 606: Determine input information of the agent application object based on the session state information and user input information.

[0090] Specifically, the server may concatenate the session state information and the user input information into strings to obtain the final input information of the intelligent agent application object.

[0091] Step 608: Input the determined input information into the agent application object to obtain a response result of the newly initiated service request.

[0092] Specifically, the server inputs the final input information of the intelligent agent application object into the intelligent agent application object, runs the intelligent agent application object, and obtains the output information of the intelligent agent application object for the newly initiated service request, and the output information is the response result of the newly initiated service request.

[0093] Exemplarily, in the process of running the intelligent agent application object, the server can call each initialized component in the intelligent agent application object to process input information according to the topology representation diagram, and obtain the output information of the intelligent agent application object for the newly initiated service request; wherein, when the called component is a component that uses public services in the public service pool, a service call request is sent to the public service in the public service pool referenced by the called component, and the server continues to participate in the processing of the input information based on the response result of the service call request.

[0094] In the above embodiment, by obtaining the session identifier and user input information of the first session from the newly initiated service request, obtaining the session status information of the first session based on the session identifier, and determining the input information of the intelligent agent application object based on the session status information and the user input information, the response result of the newly initiated service request can be determined through the cached intelligent agent application object, thereby improving the response efficiency for the newly initiated service request.

[0095] In some embodiments, the session state information under the first session is stored in a distributed cache, and the method further includes: saving a response result of a newly initiated service request in the distributed cache to update the session state information under the first session in the distributed cache; the updated session state information is used to determine a response result of a subsequent service request initiated by the first user under the first session.

[0096] In this embodiment, the intelligent agent application object runs in a stateless mode, and the session state information under the first session can be stored in the distributed cache. After obtaining the response result of the newly initiated service request, the server can also save the response result to the distributed cache to update the session state information under the first session in the distributed cache. When receiving a subsequent service request initiated by the first user in the first session, the server can obtain the first session identifier therefrom, and then query the latest updated session state information from the distributed cache according to the first session identifier, so that the final input information of the intelligent agent application object can be determined according to the latest session state information, and then the response result of the subsequent service request can be determined through the cached intelligent agent application object.

[0097] In the above embodiment, since the session state information can be stored in the distributed cache and the response result of the newly initiated service request is saved in the distributed cache, the stateless processing of the Agent application object is realized, the reusability and distributed horizontal scalability of the Agent application object are improved, and the overall service performance of the Agent service is improved.

[0098] In some embodiments, the method for generating an intelligent agent application object of the present application further includes: in response to a service request initiated by a second user in a second session, obtaining a target topology representation map and a target compilation parameter indicated by the service request initiated by the second user in the second session; when the target topology representation map is associated with the cached intelligent agent application object, Figure 1 The target compilation parameters are consistent with the compilation parameters associated with the cached intelligent agent application object, and the cached intelligent agent application object is used as the target intelligent agent application object under the second session; through the target intelligent agent application object, the response result of the service request initiated by the second user in the second session is determined.

[0099] The second user and the first user may be the same user or different users. The second session and the first session are different sessions. In the present application, the cached agent application object may be applied to a new session of the same user or to a new session of a different user.

[0100] Specifically, when receiving a service request initiated by the second user in the second session, the server can parse the service request to obtain the application scenario identifier, and then query the topology representation map corresponding to the application scenario identifier, and then compare the topology representation map with the topology representation maps associated with each currently cached intelligent agent application object. If the topology representation map is consistent with the topology representation map associated with any currently cached intelligent agent application object, Figure 1 The server further obtains the compilation parameters indicated by the service request, and compares the compilation parameters indicated by the service request with the compilation parameters associated with the intelligent agent application object that is consistent with the topological representation graph. If the compilation parameters indicated by the service request are consistent with the compilation parameters associated with the intelligent agent application object, the intelligent agent application object can be reused, that is, the intelligent agent application object can be used as the target intelligent agent application object in the second session, and then the response result of the service request initiated by the second user in the second session can be determined through the target intelligent agent application object.

[0101] Exemplarily, when comparing topological representation graphs, the server can calculate hash values ​​in the same way for the two topological representation graphs to be compared. If the calculated hash values ​​are consistent, it can be determined that the two topological representation graphs are consistent. Specifically, the two topological representation graphs to be compared can be converted into text description information. For example, the node name, node connection relationship, etc. can be described in text, and then the same hash algorithm is used to calculate the hash value corresponding to the text description information.

[0102] Exemplarily, the compilation parameters indicated by the service request may be parameters specified by the user when initiating the service request. In this case, the server may obtain the compilation parameters by parsing the service request; or the compilation parameters indicated by the service request may also be default compilation parameters. If the server fails to parse the compilation parameters from the service request, the default parameters set for the topology representation diagram may be used as the compilation parameters indicated by the service request.

[0103] Exemplarily, determining the response result of the service request initiated by the second user in the second session through the target agent application object can specifically be: determining the input information of the agent application object in the second session, inputting the input information into the agent application object, and running the agent application object in a stateless mode to obtain output information, which is the response result of the service request initiated by the second user in the second session.

[0104] In the above embodiment, when the server receives a new session request, if it determines that the target topology representation map and target compilation parameters indicated by the session request are consistent with the topology representation map and compilation parameters associated with a smart application object in the cache, the smart application object can be directly reused, thereby greatly saving the computer resources required for the intelligent application object compilation process.

[0105] In some embodiments, a topological representation graph is compiled to initialize components represented by compiled topological nodes to obtain initialized components, including: determining node dependencies between topological nodes in the topological representation graph based on connection relationships between topological nodes in the topological representation graph; determining a compilation order for each topological node based on the node dependencies between topological nodes; and compiling each topological node in the topological representation graph in sequence according to the compilation order to initialize components represented by compiled topological nodes to obtain initialized components.

[0106] In this embodiment, the topological representation graph may be a directed acyclic graph in which topological nodes are connected in a certain order, wherein the connection relationship between the topological nodes may represent the node dependency relationship between the topological nodes, i.e., the realization of the function of the component represented by one topological node needs to rely on the component represented by another topological node. In the topological representation graph of this embodiment, the topological nodes pointed to by the lines between the topological nodes in the topological representation graph are the nodes that need to rely on the upstream topological nodes, for example Figure 3 The agent node in the middle depends on the tool A node, tool B node and tool C node.

[0107] Specifically, in the process of compiling the topological representation graph, the server can determine the node dependency between each topological node in the topological representation graph according to the connection relationship between each topological node in the topological representation graph, and determine the compilation order of each topological node based on the node dependency between each topological node. For example, in the process of determining the compilation order, nodes without topological dependencies can be sorted first. If there are multiple topological nodes without topological dependencies, the compilation order of these topological nodes can be randomly determined. If a topological node has multiple upstream dependent nodes, the compilation order of the topological node is sorted after these dependent nodes. That is to say, for any two topological nodes, if there is no dependency between the two topological nodes, the order between the two topological nodes can be determined arbitrarily. If there is a node dependency between the two topological nodes, the compilation order of the dependent topological node is sorted before the other topological node. For example, taking Figure 4 As an example, assume that the topological representation diagram only includes Figure 4 For the topological nodes shown in the figure, the determined compilation order can be tool A, tool B, tool C, large model, and agent.

[0108] Furthermore, after determining the compilation order of each topological node, the server can compile each topological node in the topological representation diagram in sequence according to the compilation order. Each time a topological node is compiled, the component represented by the compiled topological node is initialized. During the initialization process, if the component represented by the topological node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool. Other functions are initialized according to the custom of the component. After the initialization is completed, the initialized component of the topological node is obtained.

[0109] In the above embodiment, since the compilation order of each topological node can be determined based on the node dependency relationship between each topological node, each topological node in the topological representation graph is compiled in sequence according to the compilation order to initialize the components represented by the compiled topological nodes to obtain initialized components, the accuracy of the topological representation graph compilation process can be improved.

[0110] In some embodiments, in response to a service request, a topology representation graph indicated by the service request is determined, including: in response to the service request, a topology representation graph and compilation parameters indicated by the service request are determined; the topology representation graph is compiled, and components represented by the compiled topology nodes are initialized to obtain initialized components, including: the topology representation graph is compiled according to the compilation parameters to initialize components represented by the compiled topology nodes to obtain initialized components.

[0111] The compilation parameters are parameters required for initialization of each component during the compilation process. The compilation parameters may be parsed from the service request, or may be default parameters corresponding to the topology representation diagram indicated by the service request.

[0112] Specifically, after receiving a service request, the server can determine the topology representation map and compilation parameters indicated by the service request by parsing the service request. During the compilation of the topology representation map, each time a topology node is compiled, the server initializes the component represented by the topology node according to the compilation parameters corresponding to the component represented by the topology node, thereby obtaining the initialized component corresponding to the topology node.

[0113] In the above embodiment, by determining the compilation parameters, compiling the topology representation graph according to the compilation parameters to initialize the components represented by the compiled topology nodes to obtain the initialized components, the compilation accuracy can be improved.

[0114] In some specific embodiments, the present application also provides an application scenario, in which the intelligent agent application of the present application is an intelligent agent application based on LLM.

[0115] The popularity of ChatGPT and GPT4 has made the public realize the potential of large language models (LLMs). In the field of education, LLMs are becoming a powerful assistant for students and teachers, providing personalized learning suggestions and instant Q&A services. In the business field, companies use LLMs to automate customer service and improve efficiency, while using natural language processing to analyze market trends and consumer sentiment. In the creative industry, writers and artists use LLMs to inspire inspiration and assist in creating new works. In programming and technical services, LLMs help developers debug code and even assist in writing programs. The impact of LLMs goes far beyond this. It is changing the way people obtain information and communicate, and even in professional fields such as law and medicine, LLMs are beginning to play a role in assisting analysis and decision-making. With the continuous advancement of technology, the application of LLMs will become more extensive, and its far-reaching impact will penetrate into every corner of society and reshape all aspects of work and life.

[0116] LLM can give program applications intelligence and provide capabilities such as intelligent analysis, planning, execution and reflection. By building Agent applications and combining LLM with tool libraries in the business field, LLM can autonomously analyze, think and plan based on user input questions, accurately call various tools to execute tasks at each stage, and reflect on the execution results of each stage and plan the next stage of actions. LLM runs autonomously and iteratively throughout the process without the need for human intervention until the final result is output. Agents based on LLM can more efficiently solve various business scenario problems, such as data search, analysis and insight, and autonomous execution of the entire link.

[0117] Agent applications have greatly expanded the application scenarios of LLM. How to build efficient Agent application services is an urgent problem to be solved. The current mainstream method is to connect various components and LLMs that Agent applications rely on through DAG graphs. Each node in the DAG graph represents various tools, LLMs and other objects. Then, the components in the DAG graph are compiled, and the LLM objects and component services are initialized. Finally, a runnable Agent object is obtained, which provides Agent application services as a whole. Since the request parameters of each Agent service may be different, this method requires recompiling and building the DAG graph to obtain a new Agent service object for different users, or even for different sessions of the same user. Although the same DAG graph can be used to build the corresponding Agent application service for different requests from different users, due to the large number of DAG compilations and constructions, when the number of requesting users is large, there is a large waste of service resources and a long DAG compilation and construction time.

[0118] Based on this, the embodiment of the present application proposes an intelligent agent application object generation method to address the problems of computing, storage and network resource waste and frequent DAG compilation and construction time-consuming in the current LLM Agent service framework. The method provides an Agent service framework with separated Agent application objects, public services, and Session states. The new Agent service framework can solve the computing, storage and network resource waste to a large extent, greatly reduce the DAG compilation and construction time, and significantly improve the Agent service responsiveness under a single node.

[0119] In the specific implementation, on the one hand, the application state and public services are separated from the Agent application object, the Agent application object is minimized, and the rapid DAG compilation and construction of the Agent application object is realized, so that the public service call is more stable and the user request is responded to more quickly; on the other hand, the state data related to the Agent application session is stored in the distributed cache, and the public services are centrally managed by a unified resource pool. The compiled and constructed Agent application objects are reused to a large extent between different users and different sessions, so that the Agent application service can provide efficient and stable services with minimized resources, save a lot of computing, storage and network resources, and improve the response and concurrency capabilities of single-node Agent services.

[0120] The basic structure of Agent is as follows Figure 3 As shown, Figure 3 The final node of the DAG graph is Agent, whose upstream depends on the service nodes and various tool nodes provided by LLM. Each tool will rely on database nodes, search and other service nodes. The whole is compiled and built into Agent application objects to provide external services. Agent application objects rely on their own status and external inputs, provide analysis, planning and decision-making based on LLM, and call the Tool that meets the requirements to perform specific tasks and obtain the task execution results as feedback.

[0121] refer to Figure 7 , which is a schematic diagram of the Agent application service framework in the related technology. Figure 7 The method shown in the figure implements Agent's external services. For different Session requests of different users, due to the differences in Agent application construction parameters, such as Agent parameters, LLM parameters and application tool parameters, it is necessary to compile Agent application objects independently for each Session based on Agent DAG. Each Agent application object will generate data under the current Session during operation, including user conversation data, Agent's own status and other data, collectively referred to as Session status, which needs to be saved inside the Agent application object. From the perspective of the service framework, it seems that each independent Agent application object provides services for different sessions of different users. In many cases, even different sessions of the same user need to recompile and build Agent application objects because there are differences in their Session status or Agent application construction parameters.

[0122] Depend on Figure 7It can be seen that in the related technology, each Agent application object is bound to the runtime data, which results in the inability of the compiled and built Agent to provide services for different Sessions. The differences in the construction parameters of different Agents result in the Agent application objects often needing to be recompiled and rebuilt, and the services such as LLM, Database, and Search Engine that consume a lot of network resources cannot be shared. The above problems result in the need to recompile and build the Agent application objects from scratch for different Sessions of each user, resulting in waste of various resources, inability to share services, and time-consuming multiple compilations and constructions of DAG graphs.

[0123] The technical solution proposed in this application can effectively solve the above-mentioned problem of frequent compilation and construction of Agent application objects, as well as the problem of reuse of Agent application objects, inability to share public service resources, and greatly reduce the time consumption of compiling and building Agent application objects.

[0124] By stripping the Session state from the Agent application object and storing it in a distributed cache, such as Redis, the Agent application object can be made stateless, and the Agent application object can be reused in different users and different Sessions when the Agent construction parameters are the same.

[0125] By grouping public services, such as LLM services, database connection services, search engine services and other shareable public services into a public service pool, the LLMs and tools under each Agent application object use unified public services to complete the corresponding request tasks, without the need to apply for resources for each Agent application object to complete such request tasks, thereby saving a lot of computing, storage and network resources.

[0126] After completing the above two steps, the compilation and construction of the Agent application object will become easier and faster. Only the part related to the Agent application object itself needs to be compiled and constructed, and the computing and storage resources occupied are relatively small, thereby realizing the rapid compilation and construction of the AgentDAG graph.

[0127] refer to Figure 8 , is a schematic diagram of the Agent service framework provided by the agent application object generation method of the present application in some embodiments. Compared with the Agent service framework in the related art, two main contents are added, namely:

[0128] 1. Session data cache: Use distributed cache, such as Redis, to store the session state information generated by Agent application objects of different sessions in the distributed cache, so that the Agent application objects are separated and decoupled from the Session data, and the Agent application objects are run in a stateless manner, so that the Agent application objects can be reused between different users and sessions to the greatest extent. Figure 8 In the example, the agent application object can be reused between session A and session C.

[0129] 2. Common Services Pool: Public service resource pool separates public services that occupy more computing, storage and network resources from Agent application objects to form independent services. The main advantages are: first, it greatly saves DAG compilation and construction time. Generally, database connection and network resource initialization are time-consuming, and separate calls have service stability guarantee issues; second, it saves a lot of computing, storage and network resources. Different Agents only reference objects in the resource pool during the compilation and construction process, and do not occupy them independently. They apply for them when needed and release them after use, thereby realizing the sharing of public service resources and greatly improving resource utilization efficiency.

[0130] After the Agent service framework is adjusted, the compilation and construction of the DAG graph and the Agent application object service process will change accordingly, which will be described in detail below.

[0131] refer to Fig. 9 , the specific compilation and construction of Agent application objects under the new Agent service framework is as follows Fig. 9 As shown, the specific steps include:

[0132] 1. First, determine whether the Agent's DAG graph has been compiled and built under the current compilation parameters. If it has, it can be reused and jump to step 8. Otherwise, adjust to step 2 and recompile and build.

[0133] 2. Topologically sort the DAG graph of the Agent application, parse the dependencies between nodes, and determine the compilation and construction order of each node. Generally, initialization starts from the nodes without upstream dependencies.

[0134] 3. Select nodes for initialization in turn according to the results of topological sorting. First, determine whether the node has been initialized. If so, jump directly to step 7.

[0135] 4. Determine whether the node initialization depends on public services, such as LLM requests, database connections, search engine services, etc. If so, jump to step 5; otherwise, jump to step 6.

[0136] 5. When the node is initialized, the public service object can be initialized by directly referencing the public service. There is no need to reinitialize the corresponding service. The other parts are performed according to the node custom initialization.

[0137] 6. Complete initialization according to node customization.

[0138] 7. Determine whether all nodes have completed initialization. If so, jump to step 8, otherwise jump to step 3.

[0139] 8. End the Agent application compilation and construction process and output the Agent application object.

[0140] In the new Agent service framework, the Agent application object caches the Session state information in the service process into the distributed cache. The Agent application object itself runs in a stateless state, and its output depends entirely on each external input. This stateless working mode allows the Agent application object to be reused between different users and Sessions, and the application service can be easily horizontally expanded to run on multiple nodes to support more user access. Fig.10 In some exemplary embodiments, the Agent application object service flow chart is as follows: Fig.10 As shown, the specific steps include:

[0141] 1. Parse the Agent service request to obtain the user's current Session ID and user input information.

[0142] 2. Extract session status information from the distributed cache based on the Session ID, including historical sessions, Agent running status, and other information.

[0143] 3. Combine and concatenate the session state information and the user's current input information to obtain the final input information, and use the input information as the input of the Agent application object.

[0144] 4. Run the Agent application object to process the final input information and obtain the execution result, that is, the output information.

[0145] 5. Update the cached session status information based on the output information.

[0146] 6. Return output information to the user's terminal.

[0147] 7. End.

[0148] In summary, the technical solution proposed in this application, by disassembling the Agent application DAG graph and stripping out the public services, significantly reduces the consumption of initializing various services during the DAG graph compilation and construction process, realizes the reuse of public services, improves service stability, and caches the compiled and constructed Agent application objects for reuse, saving computing, storage and network resources. In the process of Agent application object service, the execution results and status information are cached to realize the stateless processing of Agent application objects, improve the reusability and distributed horizontal scalability of Agent application objects, and improve the overall service performance of Agent services.

[0149] This application can be widely used in Agent application scenarios built based on LLM, such as medical, financial, transportation, consulting, big data and other application scenarios. Any scenario that requires LLM to build an Agent and call various tools to solve problems independently can adopt this solution to achieve more efficient implementation.

[0150] For example, in a legal consultation scenario, when a user initiates a legal consultation regarding a certain issue, it can trigger a new session to be opened in the server. The server generates an intelligent agent application object based on the topological representation diagram corresponding to the consultation scenario. After that, the user can have multiple rounds of dialogues with the intelligent agent application object regarding the issue. In each dialogue, the server saves the user's input information, the status information of the intelligent agent application object itself, and the output information of the intelligent agent application object and other session status information in a distributed cache. When receiving the user's input information for the next dialogue, the server obtains the user's session status information from the cache, combines the current input information to obtain the final input information of the intelligent agent application object, runs the intelligent agent application object in the session to obtain the output information and returns it to the user's terminal.

[0151] For example, in a medical data analysis scenario, the user can enter task description information, such as predicting the development trend of a certain disease, to trigger a new session in the server. The server generates an intelligent application object based on the topological representation graph corresponding to the medical scenario, and processes and analyzes massive amounts of medical data through the intelligent application object, thereby predicting the development trend of the disease and returning it to the user's terminal.

[0152] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0153] Based on the same inventive concept, the embodiment of the present application also provides an intelligent agent application object generation device for implementing the intelligent agent application object generation method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more intelligent agent application object generation device embodiments provided below can refer to the limitations of the intelligent agent application object generation method above, and will not be repeated here.

[0154] In some embodiments, Fig.11 As shown, an intelligent agent application object generation device 1100 is provided, comprising:

[0155] A topology representation map determining module 1102 is used to determine, in response to a service request, a topology representation map indicated by the service request, the topology representation map comprising a plurality of topology nodes, each topology node representing a component, and at least one component using a public service in a public service pool;

[0156] The topology representation graph compiling module 1104 is used to compile the topology representation graph to initialize the components represented by the compiled topology nodes to obtain the initialized components; wherein, when the target component represented by the compiled topology node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool;

[0157] The intelligent agent application object obtaining module 1106 is used to obtain the intelligent agent application object determined by the initialized components corresponding to each topological node in the topological representation graph in response to the completion of the compilation of the topological representation graph.

[0158] The above-mentioned intelligent agent application object generation device, in response to a service request, determines a topological representation graph indicated by the service request, the topological representation graph includes multiple topological nodes, each topological node represents a component, at least one component uses the public service in the public service pool, compiles the topological representation graph to initialize the component represented by the compiled topological node, and obtains the initialized component. In response to the completion of the compilation of the topological representation graph, an intelligent agent application object determined based on the initialized components corresponding to each topological node in the topological representation graph is obtained, wherein, when the target component represented by the compiled topological node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool. In this way, the public service is separated from the intelligent agent application object, so that in the process of generating the intelligent agent application object, only the part related to the intelligent agent application object itself needs to be compiled and constructed, and the computing and storage resources occupied are relatively small, thereby realizing the rapid compilation and construction of the intelligent agent application object, thereby improving the generation efficiency of the intelligent agent application object.

[0159] In some embodiments, the service request is a request initiated by the first user under the first session. The intelligent application object generation method of the present application also includes: an intelligent application object running module, which is used to run the intelligent application object in a stateless mode and obtain the output information of the intelligent application object for the service request; use the output information as a response result of the service request, and return the response result to the terminal of the first user.

[0160] In some embodiments, the intelligent agent application object running module is also used to: determine the input information of the intelligent agent application object; input the input information to the intelligent agent application object to run the intelligent agent application object, and obtain the output information of the intelligent agent application object in response to the service request; determine the session status information under the first session based on the input information and the status information during the running of the intelligent agent application object, and associate the session status information with the session identifier of the first session and save it in the distributed cache.

[0161] In some embodiments, the intelligent agent application object running module is also used to: input input information into the intelligent agent application object; call each initialized component in the intelligent agent application object to process the input information according to the topological representation diagram, and obtain the output information of the intelligent agent application object in response to the service request; wherein, when the called component is a component that uses public services in the public service pool, send a service call request to the public service in the public service pool referenced by the called component, and continue to participate in the processing of the input information based on the response result of the service call request.

[0162] In some embodiments, the intelligent agent application object generation device of the present application also includes: an intelligent agent application object caching module, which is used to cache the intelligent agent application object, the topological representation map and the compilation parameters corresponding to the topological representation map, and establish an association relationship between the intelligent agent application object, the topological representation map and the compilation parameters corresponding to the topological representation map.

[0163] In some embodiments, the service request is a request initiated by the first user in the first session. The intelligent agent application object generation device of the present application also includes: a service request response module, which is used to respond to the service request newly initiated by the first user in the first session, obtain the session identifier and user input information of the first session from the newly initiated service request; obtain the session status information under the first session according to the session identifier; determine the input information of the intelligent agent application object according to the session status information and the user input information; and input the determined input information into the intelligent agent application object to obtain a response result of the newly initiated service request.

[0164] In some embodiments, the intelligent application object generation device of the present application also includes: a response result caching module, which is used to save the response results of the newly initiated service request to the distributed cache to update the session status information under the first session in the distributed cache; the updated session status information is used to determine the response results of subsequent service requests initiated by the first user under the first session.

[0165] In some embodiments, the service request response module is further used to respond to the service request initiated by the second user in the second session, obtain the target topology representation map and target compilation parameters indicated by the service request initiated by the second user in the second session; when the target topology representation map is associated with the cached agent application object Figure 1 The target compilation parameters are consistent with the compilation parameters associated with the cached intelligent agent application object, and the cached intelligent agent application object is used as the target intelligent agent application object under the second session; through the target intelligent agent application object, the response result of the service request initiated by the second user in the second session is determined.

[0166] In some embodiments, the topology representation graph compilation module is also used to: determine the node dependency relationship between each topology node in the topology representation graph based on the connection relationship between each topology node in the topology representation graph; determine the compilation order of each topology node based on the node dependency relationship between each topology node; compile each topology node in the topology representation graph in sequence according to the compilation order to initialize the components represented by the compiled topology nodes to obtain initialized components.

[0167] In some embodiments, the topology representation map determination module is also used to determine the topology representation map and compilation parameters indicated by the service request in response to the service request; the topology representation map compilation module is also used to compile the topology representation map according to the compilation parameters to initialize the components represented by the compiled topology nodes to obtain initialized components.

[0168] In some embodiments, among the components represented by the multiple topological nodes, at least one component is a pre-trained large language model.

[0169] Each module in the above-mentioned intelligent agent application object generation device can be implemented in whole or in part by software, hardware and their combination. Each of the above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the corresponding operations of each of the above modules.

[0170] In some embodiments, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the intelligent agent application object generation method provided in the embodiment of the present application is implemented.

[0171] In some embodiments, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.13As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface, the display unit and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, the method for generating an intelligent agent application object provided in an embodiment of the present application is implemented. The display unit of the computer device 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 a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device casing, or an external keyboard, touchpad or mouse, etc.

[0172] Those skilled in the art will understand that Fig.12 , Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0173] In some embodiments, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above-mentioned intelligent agent application object generation method when executing the computer program.

[0174] In some embodiments, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-mentioned intelligent agent application object generation method are implemented.

[0175] In some embodiments, a computer program product is provided, including a computer program, which implements the steps of the above-mentioned intelligent agent application object generation method when executed by a processor.

[0176] 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, stored data, displayed data, 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 relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in this application can include at least one of non-volatile 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0178] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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 specification.

[0179] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for generating an intelligent agent application object, characterized in that: The method comprises: In response to a service request, determining a topology representation graph indicated by the service request, the topology representation graph comprising a plurality of topology nodes, each topology node representing a component, at least one of the components using a public service in a public service pool; Compiling the topology representation graph to initialize components represented by the compiled topology nodes to obtain initialized components; Wherein, when the target component represented by the compiled topological node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool; In response to the completion of compiling the topology representation graph, an intelligent agent application object determined based on the initialized components corresponding to each topology node in the topology representation graph is obtained.

2. The method according to claim 1, characterized in that The service request is a request initiated by the first user in the first session, and the method further includes: Running the agent application object in a stateless mode to obtain output information of the agent application object in response to the service request; The output information is used as a response result of the service request, and the response result is returned to the terminal of the first user.

3. The method according to claim 2, characterized in that The step of running the agent application object in a stateless mode and obtaining output information of the agent application object in response to the service request includes: Determining input information of the agent application object; Inputting the input information into the agent application object to run the agent application object, and obtaining output information of the agent application object for the service request; The session state information of the first session is determined according to the input information and the state information of the agent application object during operation, and the session state information is associated with the session identifier of the first session and saved in a distributed cache.

4. The method according to claim 3, characterized in that The step of inputting the input information into the agent application object to run the agent application object, and obtaining the output information of the agent application object in response to the service request, comprises: Inputting the input information into the agent application object; According to the topology representation graph, calling each initialized component in the agent application object to process the input information, and obtaining output information of the agent application object for the service request; When the called component is a component that uses public services in a public service pool, a service call request is sent to the public services in the public service pool referenced by the called component, and the processing of the input information continues based on the response result of the service call request.

5. The method according to claim 1, characterized in that The method further comprises: The agent application object, the topology representation map, and the compilation parameters corresponding to the topology representation map are cached, and an association relationship is established between the agent application object, the topology representation map, and the compilation parameters corresponding to the topology representation map.

6. The method according to claim 5, characterized in that The service request is a request initiated by the first user in the first session, and the method further includes: In response to a service request newly initiated by the first user in the first session, obtaining a session identifier and user input information of the first session from the newly initiated service request; Acquire session state information of the first session according to the session identifier; Determining input information of the agent application object according to the session state information and the user input information; The determined input information is input into the agent application object to obtain a response result of the newly initiated service request.

7. The method according to claim 6, characterized in that The session state information of the first session is stored in a distributed cache, and the method further includes: Saving the response result of the newly initiated service request in the distributed cache to update the session state information of the first session in the distributed cache; The updated session state information is used to determine a response result of a subsequent service request initiated by the first user in the first session.

8. The method according to claim 5, characterized in that The method further comprises: In response to a service request initiated by a second user in a second session, obtaining a target topology representation map and a target compilation parameter indicated by the service request initiated by the second user in the second session; When the target topology representation graph is consistent with the cached topology representation graph associated with the agent application object, and the target compilation parameters are consistent with the cached compilation parameters associated with the agent application object, the cached agent application object is used as the target agent application object under the second session; The response result of the service request initiated by the second user in the second session is determined through the target agent application object.

9. The method according to claim 1, characterized in that: The compiling the topology representation graph to initialize the components represented by the compiled topology nodes to obtain the initialized components includes: Determine the node dependency relationship between the topological nodes in the topological representation graph according to the connection relationship between the topological nodes in the topological representation graph; Determine the compilation order of each topology node based on the node dependency relationship between each topology node; The topological nodes in the topological representation graph are compiled in sequence according to the compilation order to initialize the components represented by the compiled topological nodes to obtain initialized components.

10. The method according to any one of claims 1 to 9, characterized in that The step of determining, in response to the service request, a topology representation graph indicated by the service request comprises: In response to the service request, determining a topology representation map and compilation parameters indicated by the service request; The compiling the topology representation graph and initializing the components represented by the compiled topology nodes to obtain the initialized components includes: The topology representation graph is compiled according to the compilation parameters to initialize the components represented by the compiled topology nodes to obtain initialized components.

11. The method according to any one of claims 1 to 9, characterized in that Among the components respectively represented by the multiple topological nodes, at least one component is a pre-trained large language model.

12. An intelligent agent application object generation device, characterized in that: The device comprises: A topology representation graph determination module, configured to determine, in response to a service request, a topology representation graph indicated by the service request, wherein the topology representation graph includes a plurality of topology nodes, each topology node represents a component, and at least one of the components uses a public service in a public service pool; A topology representation graph compiling module is used to compile the topology representation graph to initialize the components represented by the compiled topology nodes to obtain initialized components; wherein, when the target component represented by the compiled topology node uses the target public service in the public service pool, the function of the target component using the target public service is compiled by referencing the target public service in the public service pool; The intelligent agent application object obtaining module is used to obtain the intelligent agent application object determined by the initialized components corresponding to each topological node in the topological representation graph in response to the completion of compiling the topological representation graph.

13. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

14. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

Citation Information

Patent Citations

  • Service scheduling method and device, server and computer readable storage medium

    CN113434283A

  • APP modularization control system and method based on vehicle-mounted system

    CN113485680A

  • Intelligent agent construction and development method based on industry digitization

    CN114356300A

  • Topological relation graph generation method and device, electronic equipment and storage medium

    CN116405399A

  • Method for efficiently configuring and interacting public services in service bus

    CN117033033A

Cited By

  • Agent application object generation method and apparatus, and computer device and storage medium

    WO2026031781A1

  • Communication method, apparatus, and system

    WO2026170989A1