Intelligent agent interaction method and device based on task self-feedback
Through the agent interaction method based on task self-feedback, using a large language model to judge user intentions and act as a task AI assistant, the problem of unstable interaction of AI Agent in multi-task scenarios is solved, and the stability and efficiency of task execution are improved.
Patent Information
- Application Number
- CN202411344574.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2025-02-18
Smart Images

Figure CN119476344A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical fields of artificial intelligence and natural language processing, and in particular to an intelligent agent interaction method and device based on task self-feedback. Background Art
[0002] An intelligent agent is an agent that acts in an intelligent way; the agent perceives the environment, takes actions autonomously to achieve goals, and can improve its performance by learning or acquiring knowledge [streamlined process - Agent: P (perception) → P (planning) → A (action)]. The technical evolution of AI Agent has gone through multiple stages, from rule-based design, reinforcement learning-based methods, to current solutions based on pre-trained large models. Each stage has promoted the continuous improvement of AI Agent's perception, understanding and action capabilities. With the increasing maturity of large-scale language models (LLMs), such as LLama / Gemini / Qwen, natural language processing has made significant progress, enabling machines to understand and generate human language, thus completely changing many tasks of natural language understanding (NLU) and natural language generation (NLG). At the same time, AI Agents based on large language models (LLMs) use LLMs for memory retrieval, decision reasoning, and action sequence selection, pushing the intelligence of Agents to a new height, marking the progress of artificial intelligence from simple rule matching and computational simulation to a higher level of autonomous intelligence. In practical applications, current AI Agents may face challenges such as scenario and task complexity, domain specificity, and data quality and diversity. They cannot handle multiple tasks well in multiple domains and scenarios, and these tasks often require multiple rounds of interaction to complete. At the same time, due to the limitations of multiple scenarios and domains, AI Agents for corresponding scenarios are required to complete them.
[0003] In theory, AI Agents are capable of handling multiple tasks in multiple scenarios and requiring multiple rounds of interaction. However, in practical applications, they may face challenges such as scenario and task complexity, domain specificity, and data quality and diversity. To overcome these challenges, corresponding solutions need to be adopted to enhance the capabilities and performance of AI Agents, including:
[0004] Rule-enhanced mode: The decision maker determines the type of question the user is asking, and pre-sets some rule modules based on the question type to determine whether multiple rounds of interaction are required. This logic requires the user to clearly indicate their intention to jump to exit the current question logic.
[0005] Multi-agent mode: For multi-scenario and multi-task mode, corresponding agents are built for different scenarios. If a task in a multi-round interactive mode is required, the preset logic needs to be informed to the agent. For a single-scenario mode with multiple tasks, it is necessary to preset the division of labor and cooperation among multiple agents. At each stage, an agent is required to supervise the cooperation between agents through multiple rounds of dialogue until they reach a consensus and determine that the task has been successfully completed.
[0006] The above solution lacks a module to actively end multiple rounds of interaction, and requires user prompts to exit. At the same time, due to the instability of LLMs, AI Agents sometimes become unstable when generating content or performing tasks, such as generating outrageous content or behaviors that do not meet requirements. This stability problem affects the user experience to a certain extent. Summary of the invention
[0007] The present invention provides an intelligent agent interaction method and device based on task self-feedback.
[0008] According to a first aspect of the present disclosure, a method for agent interaction based on task self-feedback is provided. The method comprises:
[0009] Receive user questions input by users;
[0010] Determining user intent based on the user question;
[0011] Based on the user intention, at least one task and a corresponding key field are determined; the task is sent to the agent for execution, so that the agent executes the task according to the task prompt to obtain an execution result; the task prompt is determined from the user question according to the key field;
[0012] Based on the execution result of the agent and the corresponding key fields, it is determined that the task is completed, and the corresponding execution result is returned to the user.
[0013] According to the above aspects and any possible implementation manner, an implementation manner is further provided, wherein determining the user intention based on the user question includes:
[0014] The user question is provided to a large language model to perform intent understanding on the user input and determine the user intent.
[0015] According to the above aspect and any possible implementation, a further implementation is provided, wherein determining a task prompt from the user question according to the key field includes:
[0016] Based on the pre-trained NLP natural language processing model, the key fields are used as output targets to extract information from the user's question;
[0017] The information extracted from the user's question is used as a corresponding task prompt.
[0018] According to the above aspects and any possible implementation, an implementation is further provided, wherein the NLP natural language processing model is trained by the following steps:
[0019] Obtain a text sample and a target recognition task for the text sample; the text sample carries one or more text tags; any text tag is used to indicate an entity annotation result of the text sample under a corresponding recognition task;
[0020] Performing entity recognition processing on the text sample based on the target recognition task to obtain an entity recognition result of the text sample under the target recognition task;
[0021] Determine a target text label from one or more text labels carried by the text sample, and determine the entity labeling result of the text sample under the target recognition task from the target text label, wherein the target text label is a label corresponding to a recognition task consistent with the target recognition task;
[0022] Based on the entity recognition results of the text sample under the target recognition task and the entity labeling results under the target recognition task, the text processing model is trained; the trained text processing model is used to perform keyword extraction processing of the text under the corresponding recognition task.
[0023] According to the above aspects and any possible implementation, an implementation is further provided.
[0024] There are multiple key fields; the step of determining that the task is completed based on the execution result of the agent and the corresponding key fields includes:
[0025] The execution result of the agent is matched with the corresponding key fields. If the execution result already contains the information corresponding to the multiple key fields, then the task is completed, otherwise the task is not completed.
[0026] According to the above aspects and any possible implementation, an implementation is further provided.
[0027] If the task is not completed, at least one round of interaction with the user is performed based on the large language model, and the task prompt is updated to enter a new round of task execution.
[0028] According to the above aspects and any possible implementation, an implementation is further provided.
[0029] The number of the intelligent agent is one, and the intelligent agent performs multiple tasks.
[0030] According to a second aspect of the present disclosure, an agent interaction device based on task self-feedback is provided. The device comprises:
[0031] A question receiving module, used for receiving user questions input by users;
[0032] An intention determination module, used to determine the user's intention based on the user's question;
[0033] A prompt generation module is used to determine at least one task and a corresponding key field based on the user intention; send the task to the agent for execution, so that the agent executes the task according to the task prompt to obtain an execution result; the task prompt is determined from the user question according to the key field;
[0034] The task execution module is used to determine the completion of the task based on the execution result of the agent and the corresponding key fields, and return the corresponding execution result to the user.
[0035] According to a third aspect of the present disclosure, an electronic device is provided, which includes a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the program, the method described above is implemented.
[0036] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect of the present disclosure is implemented.
[0037] The embodiment of the present disclosure provides an intelligent agent interaction method and device based on task self-feedback. The large language model is used as the main agent to judge the user's intention and determine the task. The large language model is then used to act as the AI assistant for the task. The information required for the task is designed in advance, and the scene AI assistant is used to complete the filling of this information. Once the AI assistant detects that the necessary information for the task has been filled, it will feedback to the main agent to end the task. If not, it will feedback to the main agent to continue asking. In this way, the interaction of intelligent agents in various application scenarios can be completed by the method of task self-feedback.
[0038] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0040] Figure 1 A flow chart of an agent interaction method based on task self-feedback according to an embodiment of the present disclosure is shown;
[0041] Figure 2 A schematic diagram of intelligent agent interaction based on task self-feedback according to an embodiment of the present disclosure is shown;
[0042] Figure 3 A block diagram of an intelligent agent interaction device based on task self-feedback according to an embodiment of the present disclosure is shown;
[0043] Figure 4 A schematic block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0044] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0045] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0046] The present disclosure proposes a method of intelligent agent interaction based on task self-feedback to solve the problem that AI Agent completes the corresponding task through multiple rounds of interaction in a multi-task scenario and actively exits the task mode and enters the next task. The Agent judges and starts the task according to the user's intention. It can not only let the AI Agent judge whether to continue the task through task self-feedback, but also solve the misjudgment caused by the instability of LLMs, and proposes a method for setting LLMs system prompts to make LLMs play the role of AI assistants for different tasks, saving the resource problems caused by multiple AI Agents. The core idea of this method is that the large language model acts as the main agent to judge the task intention, and then uses the large language model to play the role of the task AI assistant, designs the information required for the task structure in advance, and completes the filling of this information through the scene AI assistant. Once the AI assistant detects that the necessary information of the task has been filled, it will feedback to the main agent to end the task. If not, it will feedback to the main agent and continue to ask. In this way, the main agent can accurately judge the required task type through task self-feedback, and cooperate through multiple rounds of dialogue until they reach a consensus and determine that the task has been successfully completed.
[0047] Combine the following Figure 1 and Figure 2 , the embodiments of the present disclosure are described in detail.
[0048] Figure 1 The flowchart of the agent interaction method 100 based on task self-feedback according to an embodiment of the present disclosure is shown. The method 100 includes:
[0049] Step 110: receiving a user question input by a user.
[0050] In some embodiments, for example, when the user input is: I'd like to book a ticket from Beijing to Shanghai.
[0051] Step 120: Determine the user intention based on the user question.
[0052] In some embodiments, determining the user intent based on the user question includes: providing the user question to a large language model to perform intent understanding of the user input to determine the user intent.
[0053] In some embodiments, user intent refers to the purpose and need behind the user's statement, such as checking the weather, booking a flight, booking a hotel, etc. For example, the system prompt is set using the capabilities of large-scale language models (LLMs), and LLMs act as an intent classifier to determine the intent behind the prompt input by the user (the prompt here can be understood as the user's input statement). The following is an example of setting a system prompt for intent classification:
[0054] You are an AI assistant designed to recognize and respond to userintents within a hotel application.Your task is to identify the user's intentbased on their request and return it in a JSON format.The possible intentsinclude:
[0055] 1.Weather:When the user expresses a desire to ask about the weather.
[0056] 2.Book Plane Ticket:When the user wants to book a flight.
[0057] 3.Book Hotel:When the user expresses a desire to reserve a hotelroom.
[0058] 6.other:When the user does not match any of the above intents.
[0059] Example JSON Responses:
[0060] If the user says, "I want to book a room." return{"intent":"book_hotel"}.
[0061] If the user says, "I'd like to book a ticket from Beijing toShanghai." return{"intent":"book_plane_ticket"}.
[0062] If the user says, "I wonder what the weather will be like in Beijingtomorrow." return{"intent":"weather"}.
[0063] Based on the identified intent, proceed with the appropriate actions to fulfill the user's request.
[0064] For example, if the preset tasks include checking weather, booking air tickets, booking hotels, etc., the intents can be divided into weather, book_plane_ticket, book_hotel, and other. Assume that in one embodiment, the user intent is book_plane_ticket and the task is to book air tickets. Of course, there may be multiple intents, i.e., booking air tickets and hotels, etc.
[0065] Step 130, based on the user intention, determine at least one task and corresponding key fields; send the task to the agent for execution, so that the agent executes the task according to the task prompt and obtains the execution result.
[0066] In some embodiments, the task prompt is determined from the user's question based on the key field. It includes: based on a pre-trained NLP natural language processing model, taking the key field as the output target, extracting information from the user's question; using the information extracted from the user's question as the corresponding task prompt. The task prompt is a prompt word that instructs the agent to collect information consistent with the key field. If the large language model does not end the interaction early during the interaction process, the task prompt corresponds to the key field one by one. If it ends early, the task prompt is only a part of the key field, but an additional verification link is added during and after the key field to ensure the integrity of the interaction.
[0067] In some embodiments, the NLP natural language processing model is trained through the following steps: obtaining a text sample and a target recognition task for the text sample; the text sample carries one or more text tags; any text tag is used to indicate an entity annotation result of the text sample under a corresponding recognition task; performing entity recognition processing on the text sample based on the target recognition task to obtain an entity recognition result of the text sample under the target recognition task; determining a target text tag from one or more text tags carried by the text sample, and determining an entity annotation result of the text sample under the target recognition task from the target text tag, wherein the target text tag is a tag corresponding to a recognition task that is consistent with the target recognition task; performing model training processing on the text processing model based on the entity recognition result of the text sample under the target recognition task and the entity annotation result under the target recognition task; the trained text processing model is used to perform keyword extraction processing of the text under the corresponding recognition task.
[0068] In some embodiments, based on the user intention, at least one corresponding task is determined; based on the preset correspondence between the tasks and the key fields, multiple key fields corresponding to the tasks are determined.
[0069] For example, if the user intent is book_plane_ticket, that is, booking a flight, then you need to try to collect the information required to complete the task, that is, the key fields, based on the booking task. For example, taking the booking task as an example, the corresponding intent is book_plane_ticket, the task is booking a flight, and the information required for the task is departure time (departure_date), departure place (origin), and destination (destination). The Json format is as follows:
[0070] {"type":"book_ticket","departure_date":"YYYY-MM-DD","origin":"","destination":""}
[0071] The user says "Please help me book tomorrow's flight ticket from Beijing to Shanghai.". If the current time is 2024-09-11, the key information "destination = Shanghai", "origin = Beijing", and "departure_date = 2024-09-12" can be extracted from tomorrow corresponding to 2024-09-12. The corresponding format is: {"type":"book_ticket","departure_date":"2024-09-12","origin":"Beijing","destination":"Shanghai","flight_no":""}.
[0072] Here you need to set the system prompt to inform LLMs of the role they need to play and the functions they need to perform in this task scenario, as shown below:
[0073] You are an AI assistant designed to help users with flightbooking.Your task is to collect all necessary information from the user to complete the booking.The required details include:
[0074] Departure Date:The date on which the user wants to fly.
[0075] Origin Location:The city or airport where the flight will begin.
[0076] Destination:The city or airport where the user wants to travel.
[0077] flight number:The number of the flight booked.
[0078] Instructions:
[0079] If the user does not provide all the required information(departuredate,Origin location,destination),continue asking specific questions togather this information.
[0080] Ensure that all required fields are filled before proceeding.
[0081] If the user is unclear or provides incomplete information,askclarifying questions until the information is complete.
[0082] Example Interactions:
[0083] If the user says,"I want to book a flight,"ask for the departuredate,Origin location,and destination.
[0084] If the user says,"I need a flight from New York to Los Angeles,"askfor the departure date.
[0085] Your goal is to ensure that all necessary details are collected tocomplete the flight booking,and the current dateis 2024-09-11.
[0086] In some embodiments, according to the task type, a corresponding task prompt is set to inform LLMs to act as an AI assistant in the task mode, saving the resource problems caused by multiple AI Agents, and the AI assistant is required to collect the necessary information in the task mode and present it in Json format. At the same time, after collecting the key field information, the Agent needs to be informed that the collection has been completed. For example, taking the task of booking a flight as an example, the information required for the corresponding task is departure time (departure_date), departure place (origin), and destination (destination). Then it is necessary to collect the specific content corresponding to these three information from the user's question as a task prompt, that is, it is necessary to guide the agent in the subsequent completion of the task of booking a flight, and it is necessary to combine the information such as which day to depart and where to fly to complete the flight booking. If these three are not collected, it is necessary to interact with the user until all this information is collected. Of course, due to the instability of LLMs, it may not be possible to collect the above three key information, but it is considered to be collected and handed over to the agent to perform the task, so a post-processing process is also set up later. It can also be performed while collecting and verifying, and there is no specific restriction here.
[0087] Step 140, based on the execution result of the agent and the corresponding task prompt, determine that the task is completed, and return the corresponding execution result to the user.
[0088] In some embodiments, the determination of the completion of the task based on the execution result of the agent and the corresponding key fields includes: matching the execution result of the agent with the corresponding key fields, if the execution result contains information corresponding to the multiple key fields, then the task is completed, otherwise the task is not completed. If the task is not completed, then based on at least one round of interaction with the user based on the large language model, and updating the task prompt, a new round of task execution is entered.
[0089] The following two examples are used to illustrate this: if the user is asking about the weather, the intention is determined to be weather. Here, the Agent calls the weather query task based on the weather intention. The necessary fields for the weather query task are date and location. However, the user only provides location and the date is missing. The response of the query task module is as follows. At the same time, the Agent is informed that the task needs to be interacted again. Whether to continue the interaction is reflected in the json string. Here, the response received by the Agent is, and the user request is replied according to the is_continued status.
[0090]
[0091] AI:`Intent:weahter`The location of the weather enquiry has been received. Please provide the date of enquiry.
[0092] The Agent detects the is_continued field in the information returned by the weather query assistant. If it is True, it will continue in the task mode. If it is False, it will exit the task.
[0093] User:I'd like to know what the weather will be like tomorrow.
[0094] The prompt described by the user in this round contains a date, but it is not a date in the standard format. It needs to be converted to the standard format. Since the current time has been mentioned in the corresponding task system prompt (for example, the current time is 2024-09-11), the weather query assistant converts tomorrow to 2024-09-12. The two necessary fields have been collected, so the Agent is informed that the collection has been completed and the Agent is informed to end the task.
[0095] In some embodiments, the preset task prompts and the required fields corresponding to the tasks are displayed in json format. In order to prevent the instability of existing LLMs from causing the task interaction to end without collecting the corresponding fields, it is necessary to add a post-processing process. On this basis, in the interaction process in the task mode, it is necessary to detect the json string in the response result returned by the large model (the response result returned by the large model includes the interaction information and the json string of information required for the task contained in the user's question). If there is no such information, the agent is informed to continue asking and feedback the missing field information. If the collection is completed, the agent is informed that the task can be ended. Specifically, the task is judged whether the field collection is completed and whether the task function is called normally. If the field collection is completed and the task is successfully called, the is_continued in the returned result field is set to false, and the agent is informed that the task has been completed, that is, the task mode is actively jumped out. The user starts other tasks in the next round, and it is necessary to judge its intention to assign it to the corresponding task.
[0096] For example, after the weather query task described above has been completed, the Agent clears the intent data and the historical context data of the task and starts the next round of task interaction.
[0097] For example, taking the weather query above as an example, it is necessary to check whether the two necessary fields are actually collected. The agent calls the weather query API to obtain weather information based on the two necessary fields of the weather query task, as described below
[0098]
[0099]
[0100] AI:`Intent:weahter`Thanks, the information you provided has been received. The weather is as follow.
[0101]
[0102] For another example, taking the above-mentioned flight booking as an example, the required fields are departure date, departure place, destination, and flight number. In this task scenario, these three necessary fields need to be collected before the flight booking function can be performed. The corresponding field format is {"type":"book_ticket","departure_date":"","origin":"","destination":"","flight_n o":""}. The post-processing needs to detect whether the necessary fields LLMs such as origin, destination, departure date, flight_no are filled. If not, the missing information needs to be informed to the user, and the user needs to provide the missing information. Specifically, as shown below:
[0103] User:I'd like to book a flight.
[0104] According to the user's stated intention of book_plane_ticket, the corresponding task type is booking a plane ticket. The necessary fields for the corresponding task are: origin, destination, departure date, flight_no, etc. The task of booking a plane ticket is relatively complex. It is necessary to collect the time, origin, and destination in two steps to query the ticket, and then confirm the flight information based on the query results.
[0105] AI:`Intent:book_plane_ticket`To assist you better,could you pleasespecify the departure date,origin and destination.
[0106] User:Please help me book tomorrow's flight ticket from Beijing toShanghai.
[0107] The information collected in this round of user-provided information is as follows:
[0108] {"type":"book_ticket","departure_date":"2024-09-12","origin":"Beijing","destination":"Shanghai","flight_no":""}
[0109] AI:`Intent:book_plane_ticket`Thanks,according to the information you provided,I found the following flights:CZ8889,CA8680,etc.Please confirm the flight.
[0110] User:OK,book me this flight CA8680.
[0111] The information collected in this step is as follows:
[0112] {"type":"book_ticket","departure_date":"2024-09-12","origin":"Beijing","destination":"Shanghai","flight_no":"CA8680"}
[0113] AI:`Intent:book_plane_ticket`Thanks,I've already booked your flight,this is your booking id:xxxxxxxxx.
[0114] Here, the air ticket booking task has been completed. According to the field information, the air ticket query and booking are carried out through multiple rounds of interaction with the user, and the final booking task is completed, and feedback is given to the Agent to end the interaction of the task.
[0115] In some embodiments, Figure 2As shown, the number of the agent is one, and the agent can perform multiple tasks. Therefore, even in a multi-round interaction mode, there is no need for multiple agents to work together, and there is no need for an agent to supervise the cooperation between agents through multi-round dialogues at each stage.
[0116] Based on the above implementation, in another implementation provided by the present disclosure, if the sentence is not within the above explicit intent (weather, booking air tickets, booking hotels), it is determined that the intent is other, and the corresponding task type is currently set as a general dialogue task, such as: Which is the highest mountain in the world?, the intent is other, and a general dialogue task needs to be called to answer. Or inform the staff that a new task needs to be added.
[0117] Based on the above implementation, in another implementation provided by the present disclosure, it is also possible to automatically determine whether the key information collected by the large language model is sufficient based on the key fields during the agent's task execution. If not, the user interaction is automatically performed to generate new task prompts for the agent to perform the task. This belongs to the accompanying verification process in the process. It is also designed to prevent the instability problem of existing LLMs from causing the task interaction to end before the corresponding fields of the task are collected.
[0118] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0119] The above is an introduction to the method embodiment. The following is a further explanation of the scheme disclosed in the present invention through an apparatus embodiment.
[0120] Figure 3 FIG. 4 shows a block diagram of the XX device 300 according to an embodiment of the present disclosure. Figure 3 As shown, the device 300 includes:
[0121] The question receiving module 310 is used to receive a user question input by a user;
[0122] An intention determination module 320, configured to determine the user's intention based on the user's question;
[0123] A prompt generating module 330 is used to determine at least one task and a corresponding key field based on the user intention; send the task to the agent for execution, so that the agent executes the task according to the task prompt to obtain an execution result; the task prompt is determined from the user question according to the key field;
[0124] The task execution module 340 is used to determine the completion of the task based on the execution result of the agent and the corresponding key fields, and return the corresponding execution result to the user.
[0125] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0126] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0127] Figure 4 A schematic block diagram of an electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0128] The electronic device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in the ROM 402 or a computer program loaded from the storage unit 408 into the RAM 403. In the RAM 403, various programs and data required for the operation of the electronic device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An I / O interface 405 is also connected to the bus 404.
[0129] Multiple components in the electronic device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the electronic device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0130] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as method 100. For example, in some embodiments, the method 100 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the method 100 described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the method 100 in any other appropriate manner (e.g., by means of firmware).
[0131] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0132] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0133] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0134] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0135] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0136] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0137] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0138] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. An agent interaction method based on task self-feedback, characterized in that: include: Receive user questions input by users; Determining user intent based on the user question; Based on the user intent, determining at least one task and a corresponding key field; Sending the task to the agent for execution, so that the agent can execute the task according to the task prompt and obtain the execution result; The task prompt is determined from the user's question based on the key field; Based on the execution result of the agent and the corresponding key fields, it is determined that the task is completed, and the corresponding execution result is returned to the user.
2. The method according to claim 1, characterized in that Determining the user intention based on the user question includes: The user question is provided to a large language model to perform intent understanding on the user input and determine the user intent.
3. The method according to claim 1, characterized in that Determining a task prompt from the user's question according to the key field includes: Based on the pre-trained NLP natural language processing model, the key fields are used as output targets to extract information from the user's question; The information extracted from the user's question is used as a corresponding task prompt.
4. The method according to claim 3, characterized in that The NLP natural language processing model is trained by the following steps: Obtain a text sample and a target recognition task for the text sample; the text sample carries one or more text tags; any text tag is used to indicate an entity annotation result of the text sample under a corresponding recognition task; Performing entity recognition processing on the text sample based on the target recognition task to obtain an entity recognition result of the text sample under the target recognition task; Determine a target text label from one or more text labels carried by the text sample, and determine the entity labeling result of the text sample under the target recognition task from the target text label, wherein the target text label is a label corresponding to a recognition task consistent with the target recognition task; Based on the entity recognition results of the text sample under the target recognition task and the entity labeling results under the target recognition task, the text processing model is trained; the trained text processing model is used to perform keyword extraction processing of the text under the corresponding recognition task.
5. The method according to claim 1, characterized in that There are multiple key fields; The step of determining the task completion based on the execution result of the agent and the corresponding key field includes: The execution result of the agent is matched with the corresponding key fields. If the execution result already contains the information corresponding to the multiple key fields, then the task is completed, otherwise the task is not completed.
6. The method according to claim 5, characterized in that If the task is not completed, at least one round of interaction with the user is performed based on the large language model, and the task prompt is updated to enter a new round of task execution.
7. The method according to any one of claims 1 to 6, characterized in that The number of the intelligent agent is one, and the intelligent agent performs multiple tasks.
8. An intelligent agent interaction device based on task self-feedback, characterized in that: include: A question receiving module, used for receiving user questions input by users; An intention determination module, used to determine the user's intention based on the user's question; A prompt generation module, used to determine at least one task and corresponding key fields based on the user intention; Sending the task to the agent for execution, so that the agent can execute the task according to the task prompt and obtain the execution result; The task prompt is determined from the user's question based on the key field; The task execution module is used to determine the completion of the task based on the execution result of the agent and the corresponding key fields, and return the corresponding execution result to the user.
9. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-7.
Citation Information
Cited By
Bill service processing method and device based on intelligent agent
CN119917296A
Interaction method and device based on agent cooperation, agent and storage medium
CN120654731A