Method and device for waking up intelligent agent and readable storage medium

Through semantic understanding of user input and using the agent warehouse to automatically match the agent, the problem of manual awakening of the agent in the existing technology is solved, and the function of automatically awakening multiple agents is realized, which improves the flexibility of the system and User experience.

CN119473416APending Publication Date: 2025-02-18CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411578473.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-06
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing method of awakening agents requires manual agent wake-up operation and can only wake up one agent per wake-up operation, which has the problem of insufficient flexibility.

Method used

By obtaining the content input by the user, semantic understanding is carried out to obtain keywords, the pre-built agent warehouse is used to match the corresponding agent, and the agent is marked in a specific character form in the dialog box to wake up.

Benefits of technology

It realizes that multiple large language model agents are automatically awakened based on user input content, which enhances the flexibility and adaptability of the system, brings users a better user experience, and improves the competitiveness of large language models in the market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473416A_ABST
    Figure CN119473416A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for waking up an agent and a readable storage medium, and relates to the technical field of artificial intelligence, and the method comprises the steps: obtaining the content inputted by a user; performing semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword; obtaining at least one agent matched with the at least one keyword through a pre-constructed agent warehouse; and waking up the at least one agent. According to the method, the device and the readable storage medium, the problems that an existing agent awakening method needs manual agent awakening operation, only one agent can be awakened in each awakening operation, and flexibility is insufficient can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method, device and readable storage medium for waking up an intelligent entity. Background Art

[0002] With the development of artificial intelligence technology, AI Agent technology is gradually becoming an indispensable force in solving complex tasks, especially playing a key role in reasoning, planning and tool calling. Compared with the zero-sample prompts of the previous Large Language Model (LLM), AI Agent allows users to perform more complex interactions and task coordination. The AI ​​Agent system has built-in control mechanisms such as planning, looping, and reflection, which make full use of the model's inherent reasoning ability to achieve full-process processing from the beginning to the end of the task. In addition, AI Agents are also able to call tools, plug-ins, and execute functions, which makes them capable of more general work.

[0003] AI Agents are entities driven by language models that are able to plan and take actions in multiple iterations to execute goals. Agent architectures can consist of a single agent or multiple agents collaborating to solve problems. Multi-agent architectures involve two or more agents, each of which can use the same language model or a different set of language models, have access to the same tools or different tools, and each agent typically has its own character personality.

[0004] Agent awakening (selection) refers to awakening or activating an agent in a dormant or idle state when needed to perform a specific task, respond to an event, or provide a service. However, the existing method of awakening an agent requires manual awakening of the agent, and each awakening operation can only awaken one agent, which has the problem of insufficient flexibility. Summary of the invention

[0005] The technical problem to be solved by the present invention is to provide a method, device and readable storage medium for waking up an intelligent agent in view of the above-mentioned deficiencies in the prior art, so as to solve the problem that the existing method for waking up an intelligent agent requires manual intelligent agent waking-up operation and each waking-up operation can only wake up one intelligent agent, resulting in insufficient flexibility.

[0006] In a first aspect, the present invention provides a method for waking up an agent, the method comprising:

[0007] Get the user input;

[0008] Performing semantic understanding on the content input by the user to obtain a semantic understanding result including at least one keyword;

[0009] Acquire at least one agent matching the at least one keyword through a pre-built agent warehouse;

[0010] The at least one agent is awakened.

[0011] Furthermore, the obtaining of the content input by the user specifically includes:

[0012] Add listening events to the dialog box of the preset interface to monitor the user's interactive behavior;

[0013] The content input by the user is obtained through the monitoring event.

[0014] Furthermore, before obtaining the content input by the user, the method further includes:

[0015] The agent warehouse is constructed according to the functions of multiple agents.

[0016] Furthermore, the constructing of the agent warehouse according to the functions of the plurality of agents specifically includes:

[0017] determining functions of the plurality of agents;

[0018] Designing each of the plurality of intelligent agents as a modular structure, wherein each module is responsible for a different function;

[0019] Defining each functional module of each of the plurality of agents, and generating agent retrieval code, function call code and content output conversion code;

[0020] The agent retrieval code, function call code and content output conversion code are integrated to complete the construction of the agent warehouse.

[0021] Furthermore, the semantic understanding of the content input by the user to obtain a semantic understanding result containing at least one keyword specifically includes:

[0022] Performing word segmentation on the content input by the user to obtain a word segmentation result;

[0023] Performing entity recognition and intent recognition on the word segmentation results;

[0024] The at least one keyword is obtained according to the results of the entity recognition and the intent recognition.

[0025] Furthermore, the acquiring at least one agent matching the at least one keyword through the pre-built agent warehouse specifically includes:

[0026] The at least one keyword is matched with a keyword corresponding to a function of each of the multiple agents through the agent warehouse to obtain the at least one agent matching the at least one keyword.

[0027] Further, waking up the at least one intelligent agent specifically includes:

[0028] The at least one intelligent agent is marked in the dialog box in the form of specific characters to wake up the at least one intelligent agent.

[0029] In a second aspect, the present invention provides a device for waking up an intelligent agent, the device comprising:

[0030] An input content acquisition module is used to acquire the content input by the user;

[0031] A semantic understanding module, connected to the input content acquisition module, for performing semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword;

[0032] An agent acquisition module, connected to the semantic understanding module, for acquiring at least one agent matching the at least one keyword through a pre-built agent warehouse;

[0033] An intelligent agent awakening module is connected to the intelligent agent acquisition module and is used to awaken the at least one intelligent agent.

[0034] In a third aspect, the present invention provides a device for waking up an intelligent agent, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to implement the method for waking up an intelligent agent described in the first aspect.

[0035] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for waking up an intelligent agent as described in the first aspect above is implemented.

[0036] The present invention provides a method, device and readable storage medium for waking up an intelligent agent. First, the content input by the user is obtained; then, semantic understanding is performed on the content input by the user to obtain a semantic understanding result containing at least one keyword; then, at least one intelligent agent matching the at least one keyword is obtained through a pre-built intelligent agent warehouse; finally, the at least one intelligent agent is awakened. The present invention can automatically wake up multiple large language model intelligent agents according to the content input by the user, which not only enhances the flexibility and adaptability of the system and brings a better user experience to the user, but also helps to improve the competitiveness of the large language model in the market, and solves the problem that the existing method for waking up an intelligent agent requires manual intelligent agent awakening operation and each awakening operation can only awaken one intelligent agent, which has insufficient flexibility. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 This is a flow chart of a method for waking up an intelligent agent according to Embodiment 1 of the present invention;

[0038] Figure 2 This is a diagram of the expected effect of a method for waking up an intelligent agent according to an embodiment of the present invention;

[0039] Figure 3 An operation flow chart of a method for waking up an intelligent agent according to an embodiment of the present invention;

[0040] Figure 4 A flowchart of specific implementation steps of a method for waking up an intelligent agent according to an embodiment of the present invention;

[0041] Figure 5 This is a schematic diagram of the structure of a device for waking up an intelligent agent according to Embodiment 2 of the present invention;

[0042] Figure 6 This is a schematic diagram of the structure of a device for waking up an intelligent agent according to Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0043] In order to enable those skilled in the art to better understand the technical solution of the present invention, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings.

[0044] It should be understood that the specific embodiments and drawings described herein are only used to explain the present invention rather than to limit the present invention.

[0045] It can be understood that, in the absence of conflict, the various embodiments of the present invention and the various features in the embodiments can be combined with each other.

[0046] It can be understood that, for the convenience of description, the drawings of the present invention only show the parts related to the present invention, while the parts irrelevant to the present invention are not shown in the drawings.

[0047] It can be understood that each unit and module involved in the embodiments of the present invention may correspond to only one physical structure, or may be composed of multiple physical structures, or multiple units and modules may be integrated into one physical structure.

[0048] It can be understood that the terms "first", "second", etc. in the embodiments of the present invention are used to distinguish different objects, or to distinguish different processing of the same object, rather than to describe a specific order of objects.

[0049] It can be understood that, without conflict, the functions and steps marked in the flowcharts and block diagrams of the present invention may occur in an order different from that marked in the drawings.

[0050] It is understood that the flowcharts and block diagrams of the present invention illustrate the possible architectures, functions, and operations of the systems, devices, equipment, and methods according to the various embodiments of the present invention. Each box in the flowchart or block diagram may represent a unit, module, program segment, or code, which contains executable instructions for implementing the specified functions. Moreover, each box or combination of boxes in the block diagram and flowchart may be implemented by a hardware-based system that implements the specified functions, or may be implemented by a combination of hardware and computer instructions.

[0051] It can be understood that the units and modules involved in the embodiments of the present invention can be implemented by software or hardware. For example, the units and modules can be located in a processor.

[0052] Application Overview

[0053] Agent awakening (selection) refers to awakening or activating an agent in a dormant or idle state when needed to perform specific tasks, respond to events, or provide services.

[0054] At present, the main technical means of awakening intelligent agents include:

[0055] (1) Voice-based wake-up, that is, users can wake up the agent through voice or specific keywords. For example, users can say "Hey Siri" or "Alexa" to activate Apple's Siri assistant or Amazon's Alexa smart assistant.

[0056] (2) Identifier-based wakeup, that is, users can wake up the agent by entering a key identifier during the conversation. For example, the GPTs and Kimi+ platforms have introduced methods to wake up other agents in the form of @ during the conversation.

[0057] However, the limitations of existing technologies mainly include the following two aspects:

[0058] 1) The agent wake-up operation needs to be performed manually. Regardless of whether the agent is woken up using a voice command or an identifier, the user needs to actively issue a voice command or manually enter a wake-up identifier to wake up the agent.

[0059] 2) Each wake-up operation can only wake up one agent. Although many intelligent AI (Artificial Intelligence) platforms integrate multiple large language model agents, users can only switch and wake up a single agent when using it, and can only select one agent for dialogue at a time.

[0060] In summary, the existing method of waking up the intelligent agent requires manual intelligent agent waking up operation and each waking up operation can only wake up one intelligent agent, which has the problem of insufficient flexibility.

[0061] In response to the above technical problems, the idea of ​​this application is to provide a method, device and readable storage medium for waking up an intelligent agent, which can automatically wake up multiple large language model intelligent agents according to the content input by the user. This not only enhances the flexibility and adaptability of the system, brings a better user experience, but also helps to improve the competitiveness of the large language model in the market.

[0062] After introducing the basic principles of the present application, various non-limiting embodiments of the present application will be described in detail with reference to the accompanying drawings.

[0063] Embodiment 1:

[0064] This embodiment provides a method for waking up an intelligent agent, such as Figure 1 As shown, the method includes:

[0065] Step S101: Obtain content input by the user;

[0066] In this embodiment, the user enters the question he wants to ask in the dialog box of the preset interface, such as "I want to travel to Yunnan", and the multi-agent system obtains the content input by the user.

[0067] Optionally, obtaining the content input by the user specifically includes:

[0068] Add listening events to the dialog box of the preset interface to monitor the user's interactive behavior;

[0069] The content input by the user is obtained through the monitoring event.

[0070] In this embodiment, in order to achieve synchronous operation of user input and agent wake-up, a listening event is added to the dialog box of the preset interface to monitor the interaction between the user and the multi-agent system, so as to capture the content of the user input when the user interacts with the dialog box.

[0071] Optionally, before obtaining the content input by the user, the method further includes:

[0072] The agent warehouse is constructed according to the functions of multiple agents.

[0073] In this embodiment, Autogpt can be used to realize the development of AI Agent with high general compatibility, and combined with the function call and CoT (content output conversion) of the large model, various professional AI Agent development can be realized, such as accommodation, catering, check-in points, schedules, etc. At the same time, when developing the AI ​​Agent, the functions and keywords of the AI ​​Agent are configured in the description, and then the AI ​​Agent is put on the shelf in the intelligent agent warehouse.

[0074] It should be noted that Autogpt is an open source application based on GPT-4, and can also be regarded as a framework for automatically generating language models for building autonomous and intelligent AI agents.

[0075] Optionally, constructing the agent warehouse according to the functions of multiple agents specifically includes:

[0076] determining functions of the plurality of agents;

[0077] Designing each of the plurality of intelligent agents as a modular structure, wherein each module is responsible for a different function;

[0078] Defining each functional module of each of the plurality of agents, and generating agent retrieval code, function call code and content output conversion code;

[0079] The agent retrieval code, function call code and content output conversion code are integrated to complete the construction of the agent warehouse.

[0080] In this embodiment, the step of building an agent warehouse may include:

[0081] 1. Determine the functions of the AI ​​Agent

[0082] Taking the "travel assistant" agent as an example, we must first clarify the functional requirements of the travel assistant agent, such as:

[0083] 1) Travel planning: Help users plan their journey.

[0084] 2) Destination recommendation: Select travel destination based on user preferences.

[0085] 3) Accommodation Guide: Provides accommodation advice and information about travel destinations.

[0086] 4) Attractions recommendation: Recommend attractions and activities near the user’s destination. ......

[0088] 2. Design the modular architecture of AI Agent

[0089] The AI ​​Agent is designed as a modular structure, each module is responsible for different functions, and Autogpt can help generate the basic code of these modules (i.e., the agent retrieval code). For example:

[0090] 1) Travel planning module: Make travel plans based on user needs and destination recommendations.

[0091] 2) Information retrieval module: retrieve information about the destination, such as accommodation, attractions, etc. from the Internet or database. ......

[0093] 3. Use Autogpt to generate function calls and content output conversions

[0094] 1) Function call: define the various functional modules of the AI ​​Agent and generate function call code. Autogpt can generate the code for calling functions based on the input description and examples to ensure that the various modules can work together.

[0095] 2) Content Output Transformation (CoT): AI Agents may need to convert processed results into a specific format or language to respond to the needs of users or other systems. Autogpt can help generate the code for these conversion logics, ensuring that the output conforms to the expected format and structure.

[0096] For example, the processed result can be in json format:

[0097]

[0098] Then you need to process the result, for example, output it as "jiudian1, 100 yuan / night, location in XXXX...".

[0099] 4. Integrate and optimize generated code

[0100] The generated code needs to be integrated and optimized to ensure the collaboration and compatibility between modules. The code generated by Autogpt may need to be further adjusted and expanded to adapt to specific application scenarios and performance requirements. Specifically, the code generated in the previous steps is integrated together (for example, the agent retrieval code, function call code, and content output conversion code are integrated together), so that the agent warehouse is built.

[0101] Step S102: semantically understand the content input by the user to obtain a semantic understanding result containing at least one keyword;

[0102] In this embodiment, the user's intention can be understood more accurately through semantic understanding, and a semantic understanding result containing at least one keyword can be obtained.

[0103] Optionally, performing semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword specifically includes:

[0104] Performing word segmentation on the content input by the user to obtain a word segmentation result;

[0105] Performing entity recognition and intent recognition on the word segmentation results;

[0106] The at least one keyword is obtained according to the results of the entity recognition and the intent recognition.

[0107] In this embodiment, the content input by the user is decomposed into words and their parts of speech are marked (for details, please refer to the ICTCLAS Chinese part-of-speech tagging set), and the word segmentation library and part-of-speech tagging library in Python can be used. Then, the NER model is used to identify entities such as geographic location, date and time, and names in the user input, which can be completed through a pre-trained model or a rule-based method, and then the user's main intention is determined, such as travel planning and accommodation query, so as to obtain at least one keyword.

[0108] For example, the input content is "I want to travel to Yunnan", from which the location entity "Yunnan" and the intention "travel" are identified, then at least one keyword includes the two keywords "Yunnan" and "travel".

[0109] Step S103: Acquire at least one agent matching the at least one keyword through a pre-built agent warehouse.

[0110] In this embodiment, the agent warehouse has full-text search capabilities, and the multi-agent system extracts keywords from user input and synchronizes them to the agent warehouse, and the agent warehouse automatically selects multiple agents based on the keywords.

[0111] Optionally, the acquiring at least one agent matching the at least one keyword through a pre-built agent warehouse specifically includes:

[0112] The at least one keyword is matched with a keyword corresponding to a function of each of the multiple agents through the agent warehouse to obtain the at least one agent matching the at least one keyword.

[0113] In this embodiment, the keyword is matched with the functional keyword of each agent in the agent warehouse, so as to obtain the at least one matching agent.

[0114] In an optional implementation, the acquiring at least one agent matching the at least one keyword through a pre-built agent warehouse specifically includes:

[0115] The content input by the user is converted into a vector representation based on a pre-trained language model, and similarity matching is performed with the pre-trained data or knowledge base in the agent warehouse to obtain a matching agent;

[0116] Convert the content input by the user into professional prompt words of a large model according to the at least one keyword and the matching intelligent agent;

[0117] The at least one intelligent agent that needs to be awakened is obtained through the professional prompt word.

[0118] In this embodiment, the professional prompt word may be matched with a keyword corresponding to the function of each of the plurality of intelligent agents to obtain the at least one intelligent agent.

[0119] For example, a user inputs "I want to travel to Yunnan", and at least one keyword includes "Yunnan" and "travel". Assuming that the matching intelligent agents include "travel assistant", and the functional requirements of "travel assistant" include destination recommendations, the prompt word can be optimized to "travel destination", that is, the professional prompt word can include "travel destination", and the multi-agent system then wakes up the "travel assistant" according to the professional prompt word so that the "travel assistant" can perform corresponding searches.

[0120] Step S104: Wake up the at least one intelligent agent.

[0121] Specifically, the at least one intelligent agent is marked in the dialog box in the form of specific characters to wake up the at least one intelligent agent.

[0122] In this embodiment, the specific character form can be set according to the actual situation, for example, the specific character form can be #. For example, the user enters "I want to travel to Yunnan" in the dialog box, and the multi-agent system automatically extracts the keywords entered by the user, and searches in the agent warehouse simultaneously to achieve the effect of automatically selecting the agent, and then automatically adds annotations in the dialog box, such as "I want to travel to Yunnan#Travel Assistant##Yunnan Accommodation Guide##Yunnan Check-in Point Guide#". Among them, the travel assistant, Yunnan accommodation guide and Yunnan check-in point guide are three agents, and two #s mark one agent, that is, the system automatically selects 3 suitable agents according to the user's input.

[0123] In this embodiment, after waking up at least one agent, each awakened agent can search for the user's question and display the result. Alternatively, the user can also modify the matching result of the automatic matching agent, add or delete the corresponding agent.

[0124] It should be noted that in order to solve the problem that the prior art cannot automatically wake up multiple agents at the same time, the present invention provides a method for waking up an agent, which can automatically wake up multiple large language model agents based on semantic understanding. The method can automatically select multiple large language model agents according to the content input by the user, and mark the selected agents in the dialog box in the form of "#AgentA##AgentB#". Through this method, the flexibility and adaptability of the system can be enhanced, which can bring better user experience and help improve the competitiveness of the large language model in the market.

[0125] In a specific embodiment, a method for automatically waking up multiple large language model agents based on semantic understanding is provided. By using this method, the intelligent question-answering system can automatically wake up matching agents for retrieval based on the content input by the user. The following takes "I want to travel to Yunnan" as an example to explain in detail the implementation methods and key technical solutions of this method in each step.

[0126] 1. Expected results:

[0127] like Figure 2 As shown in the figure, the user enters the question he wants to ask in the dialog box, such as "I want to travel to Yunnan", the system will automatically extract the keywords entered by the user, and search in the intelligent agent warehouse at the same time to achieve the effect of automatically selecting intelligent agents, and then automatically add annotations in the dialog box, such as "I want to travel to Yunnan#Travel Assistant##Yunnan Accommodation Guide##Yunnan Check-in Point Guide#". Among them, the travel assistant, Yunnan accommodation guide and Yunnan check-in point guide are three intelligent agents, and two #s mark one intelligent agent, that is, the system will automatically select 3 suitable intelligent agents according to the user's input.

[0128] 2. Operation process

[0129] The operation flow of the method for waking up the agent is as follows Figure 3 As shown, the user inputs the question he wants to ask, and the system extracts keywords from the user input and synchronizes them to the agent warehouse. The agent warehouse automatically selects multiple agents based on the keywords, and the multiple agents retrieve the user's question.

[0130] 3. Specific implementation steps

[0131] The specific implementation steps of the method for waking up the intelligent agent are as follows: Figure 4 As shown, including:

[0132] Step S1: Build an agent warehouse

[0133] This step mainly uses Autogpt to develop AI Agents with high general compatibility, and combines the function call (function call) and CoT (content output conversion) of the large model to realize the development of various professional AI Agents, such as accommodation, catering, check-in points, schedules and other plug-ins. At the same time, when developing the plug-in, the function and keywords of the plug-in are configured in the description, and then the plug-in is put on the plug-in library of the large model and its own intelligent body warehouse.

[0134] 1. Determine the functions and interfaces of the AI ​​Agent (taking the "Travel Assistant" agent as an example)

[0135] First, we need to clarify the functional requirements of the travel assistant agent, such as:

[0136] 1) Travel planning: Help users plan their journey.

[0137] 2) Destination recommendation: Select travel destination based on user preferences.

[0138] 3) Accommodation Guide: Provides accommodation advice and information about travel destinations.

[0139] 4) Attractions recommendation: Recommend attractions and activities near the user’s destination. ......

[0141] 2. Design the modular architecture of AI Agent

[0142] The AI ​​Agent is designed as a modular structure, with each module responsible for different functions. Autogpt can help generate the basic code of these modules (i.e., agent retrieval code) or optimize existing code, for example:

[0143] 1) Travel planning module: Make travel plans based on user needs and destination recommendations.

[0144] 2) Information retrieval module: retrieve information about the destination, such as accommodation, attractions, etc. from the Internet or database. ......

[0146] 3. Use Autogpt to generate function calls and content output conversions

[0147] 1) Function call: Define the various functional modules of the AI ​​Agent and generate function call code. Autogpt can generate the code for calling functions based on the input description and examples to ensure that the various modules can work together.

[0148] The input description refers to the input of the function. For example, if you want to write a "destination accommodation guide search function", the input description is "destination"; if you want to write a "destination restaurant search function", the input description can also be "destination". This input is customizable and depends on what kind of function you want to generate when building the intelligent agent.

[0149] For example, calling the information retrieval module generated by Autogpt to retrieve the accommodation guide information of the destination, the code can be as follows:

[0150] def retrieve_accommodation_guide(destination):

[0151] #Call the information retrieval module generated by Autogpt to retrieve the accommodation guide information of the destination

[0152] accommodation_guide=

[0153] autogpt_retrieve_accommodation_guide(destination)returnaccommodation_guide

[0154] 2) Content Output Transformation (CoT): AI Agents may need to convert processed results into a specific format or language to respond to the needs of users or other systems. Autogpt can help generate the code for these conversion logics, ensuring that the output conforms to the expected format and structure.

[0155] For example, to convert the accommodation guide information generated by Autogpt into text format, the code can be as follows:

[0156] def format_accommodation_guide(accommodation_guide):

[0157] #Convert the accommodation guide information generated by Autogpt into text format

[0158] formatted_guide=

[0159] autogpt_format_to_text(accommodation_guide)

[0160] return formatted_guide

[0161] 4. Integrate and optimize generated code

[0162] The generated code needs to be integrated and optimized to ensure the collaboration and compatibility between modules. The code generated by Autogpt may need to be further adjusted and extended to adapt to specific application scenarios and performance requirements.

[0163] Specifically, the codes generated in the previous steps are integrated together (for example, the agent retrieval code, function call code, and content output conversion code are integrated together), so that the agent warehouse is built.

[0164] Step S2: Understanding user input

[0165] The main purpose of this step is to obtain information such as intent, entities, and keywords from the content input by the user. The main technologies used are NLP (Natural Language Processing) and various libraries for processing Chinese semantics. The following are NLP technology applications to achieve this goal:

[0166] 1. Word segmentation and part-of-speech tagging

[0167] Decompose the text input by the user into words and mark their parts of speech (for details, please refer to the ICTCLAS Chinese part-of-speech tagging set). You can use the word segmentation library and part-of-speech tagging library in Python, such as jieba and NLTK (Natural Language):

[0168] import jieba.posseg as pseg

[0169] #User Input

[0170] user_input="I want to travel to Yunnan"

[0171] #Word segmentation and part-of-speech tagging

[0172] words = pseg.cut(user_input)

[0173] 2. Named Entity Recognition (NER)

[0174] Using the NER model to identify entities such as geographic locations, dates, and names in user input can be done through pre-trained models or rule-based methods. For example, taking simple rule matching as an example:

[0175]

[0176] 3. Intent Recognition:

[0177] Identify the user's primary intent, such as travel planning, accommodation search.

[0178]

[0179]

[0180] Step S3: Matching retrieval agent

[0181] By understanding user input, combining keyword matching of the agent warehouse with vector retrieval and other means, multiple keyword semantics and agent matching functions are realized. For example, when the user inputs "I want to travel to Yunnan", "Yunnan" is parsed as a geographic location entity, and the agent can recommend suitable accommodation and travel plans based on this information.

[0182] 1. Keyword matching:

[0183] Use a predefined list of keywords or phrases to match against user input to quickly identify the topic and scope of user needs.

[0184] 2. Vector search:

[0185] Based on pre-trained language models, such as BERT or GPT, user input (such as I want to travel to Yunnan) is converted into a vector representation and similarity is matched with the pre-trained data or knowledge base in the warehouse.

[0186]

[0187]

[0188] Implicit optimization of prompt words: According to the keywords obtained in step S3 and the extracted agents, the user's input is converted into advanced and complex large-model professional prompt words through prompt word optimization, and the agents that need to be summoned are clearly awakened through prompt words. For example, if the user inputs "I want to travel to Yunnan", the prompt words are optimized to "travel destination", "recommended tourist attractions", etc. These prompt words help the system recognize the user's intention, wake up the travel suggestion agent, and provide relevant travel suggestions and information.

[0189] Step S4: Presenting output

[0190] The search results are marked in the dialog box in the form of "#AgentA##AgentB#" to realize the operation of waking up multiple large language model agents at the same time, and then users can directly use these agents for question and answer operations.

[0191] It should be noted that in order to further achieve the effect of automatic selection of intelligent agents, when changes in user input are detected, the full-text search capability is automatically used to synchronize the user keywords with the intelligent agent warehouse search.

[0192] It should be noted that when matching key information with index information in the agent warehouse, in addition to using a relatively simple string matching algorithm, in order to improve the accuracy of the matching results, you can also use the TF-IDF algorithm based on word frequency, the cosine similarity algorithm based on the vector space model, and the semantic-based word embedding model. If the TF-IDF algorithm is used, it is necessary to calculate the word frequency and inverse document frequency of the keywords in the document, and then combine them into a comprehensive matching score. If the cosine similarity algorithm is used, the cosine similarity between the query vector and the document vector can be calculated. If the word embedding model is used, the cosine similarity or other similarity measures between word vectors can be used.

[0193] It should be noted that the method for waking up an agent provided by the present invention has the following characteristics:

[0194] a) A method for adding monitoring events to the user interface dialog box is proposed to monitor the interaction between the user and the large language model agent, and dynamically adjust the selection and configuration of the agent based on the user's feedback and behavior, thus achieving the synchronization of user input and agent wake-up;

[0195] b) In order to improve the robustness and effectiveness of intelligent AI systems, the present invention provides a method for simultaneously waking up multiple large language model agents, and solves the problem that only one agent can be selected at a time in a multi-agent system by constructing an agent warehouse with full-text retrieval capabilities.

[0196] c) Different from the traditional working mode of manually selecting an agent and sending a question and then using a large language model, the present invention innovatively proposes to add a semantic understanding function at the user input stage, thereby achieving the effect of automatically waking up the agent based on the user input.

[0197] The method for waking up an agent provided in an embodiment of the present invention first obtains the content input by the user; then performs semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword; then obtains at least one agent matching the at least one keyword through a pre-built agent warehouse; and finally wakes up the at least one agent. The present invention can automatically wake up multiple large language model agents based on the content input by the user, which not only enhances the flexibility and adaptability of the system and brings a better user experience to the user, but also helps to improve the competitiveness of the large language model in the market, and solves the problem that the existing method for waking up an agent requires manual agent wake-up operation and each wake-up operation can only wake up one agent, which has insufficient flexibility.

[0198] Embodiment 2:

[0199] like Figure 5As shown, this embodiment provides a device for waking up an intelligent agent, which is used to execute the method for waking up an intelligent agent, including:

[0200] An input content acquisition module 11 is used to acquire content input by a user;

[0201] A semantic understanding module 12, connected to the input content acquisition module 11, is used to perform semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword;

[0202] An agent acquisition module 13, connected to the semantic understanding module 12, for acquiring at least one agent matching the at least one keyword through a pre-built agent warehouse;

[0203] The agent awakening module 14 is connected to the agent acquiring module 13 and is used to awaken the at least one agent.

[0204] Optionally, the input content acquisition module 11 includes:

[0205] A monitoring event adding unit is used to add a monitoring event in a dialog box of a preset interface to monitor the user's interactive behavior;

[0206] The monitoring content acquisition unit is used to acquire the content input by the user through the monitoring event.

[0207] Optionally, the device further comprises:

[0208] The intelligent agent warehouse construction module is used to construct the intelligent agent warehouse according to the functions of multiple intelligent agents.

[0209] Optionally, the agent warehouse construction module includes:

[0210] a function determination unit, configured to determine the functions of the plurality of agents;

[0211] A modular design unit, used for designing each of the plurality of intelligent agents into a modular structure, wherein each module is responsible for a different function;

[0212] A function module definition unit, used to define each function module of each of the plurality of agents, and generate an agent retrieval code, a function call code and a content output conversion code;

[0213] The code integration unit is used to integrate the agent retrieval code, function call code and content output conversion code to complete the construction of the agent warehouse.

[0214] Optionally, the semantic understanding module 12 includes:

[0215] A word segmentation unit, used to segment the content input by the user to obtain a word segmentation result;

[0216] An entity and intent recognition unit, used to perform entity recognition and intent recognition on the word segmentation result;

[0217] A keyword acquisition unit is used to acquire the at least one keyword according to the results of the entity recognition and the intent recognition.

[0218] Optionally, the agent acquisition module 13 is specifically used for:

[0219] The at least one keyword is matched with a keyword corresponding to a function of each of the multiple agents through the agent warehouse to obtain the at least one agent matching the at least one keyword.

[0220] Optionally, the agent awakening module 14 is specifically used for:

[0221] The at least one intelligent agent is marked in the dialog box in the form of specific characters to wake up the at least one intelligent agent.

[0222] Embodiment 3:

[0223] refer to Figure 6 This embodiment provides a device for waking up an intelligent agent, including a memory 21 and a processor 22. The memory 21 stores a computer program, and the processor 22 is configured to run the computer program to execute the method for waking up the intelligent agent in Example 1.

[0224] The memory 21 is connected to the processor 22. The memory 21 may be a flash memory, a read-only memory or other memory. The processor 22 may be a central processing unit or a single-chip microcomputer.

[0225] Embodiment 4:

[0226] This embodiment provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method for waking up an intelligent agent in the above-mentioned embodiment 1 is implemented.

[0227] The computer-readable storage medium includes volatile or non-volatile, removable or non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, computer program modules or other data). Computer-readable storage media include, but are not limited to, RAM (Random Access Memory), ROM (Read-Only Memory), EEPROM (Electrically Erasable Programmable read only memory), flash memory or other memory technology, CD-ROM (Compact Disc Read-Only Memory), digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer.

[0228] In summary, the method, device and readable storage medium for waking up an agent provided by the embodiments of the present invention first obtain the content input by the user; then perform semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword; then obtain at least one agent matching the at least one keyword through a pre-built agent warehouse; and finally wake up the at least one agent. The present invention can automatically wake up multiple large language model agents according to the content input by the user, which not only enhances the flexibility and adaptability of the system and brings a better user experience to the user, but also helps to improve the competitiveness of the large language model in the market, and solves the problem that the existing method for waking up an agent requires manual agent wake-up operation and each wake-up operation can only wake up one agent, which has insufficient flexibility.

[0229] It is to be understood that the above embodiments are merely exemplary embodiments used to illustrate the principles of the present invention, but the present invention is not limited thereto. For those of ordinary skill in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A method for waking up an intelligent agent, characterized in that: The method comprises: Get the user input; Performing semantic understanding on the content input by the user to obtain a semantic understanding result including at least one keyword; Acquire at least one agent matching the at least one keyword through a pre-built agent warehouse; The at least one agent is awakened.

2. The method according to claim 1, characterized in that The obtaining of the content input by the user specifically includes: Add listening events to the dialog box of the preset interface to monitor the user's interactive behavior; The content input by the user is obtained through the monitoring event.

3. The method according to claim 1, characterized in that Before obtaining the content input by the user, the method further includes: The agent warehouse is constructed according to the functions of multiple agents.

4. The method according to claim 3, characterized in that The step of constructing the agent warehouse according to the functions of multiple agents specifically includes: determining functions of the plurality of agents; Designing each of the plurality of intelligent agents as a modular structure, wherein each module is responsible for a different function; Defining each functional module of each of the plurality of agents, and generating agent retrieval code, function call code and content output conversion code; The agent retrieval code, function call code and content output conversion code are integrated to complete the construction of the agent warehouse.

5. The method according to claim 1, characterized in that The performing semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword specifically includes: Performing word segmentation on the content input by the user to obtain a word segmentation result; Performing entity recognition and intent recognition on the word segmentation results; The at least one keyword is obtained according to the results of the entity recognition and the intent recognition.

6. The method according to claim 3, characterized in that The step of obtaining at least one agent matching the at least one keyword through a pre-built agent warehouse specifically includes: The at least one keyword is matched with a keyword corresponding to a function of each of the multiple agents through the agent warehouse to obtain the at least one agent matching the at least one keyword.

7. The method according to claim 2, characterized in that The waking up the at least one intelligent agent specifically comprises: The at least one intelligent agent is marked in the dialog box in the form of specific characters to wake up the at least one intelligent agent.

8. A device for waking up an intelligent agent, characterized in that: The device comprises: An input content acquisition module is used to acquire the content input by the user; A semantic understanding module, connected to the input content acquisition module, for performing semantic understanding on the content input by the user to obtain a semantic understanding result containing at least one keyword; An agent acquisition module, connected to the semantic understanding module, for acquiring at least one agent matching the at least one keyword through a pre-built agent warehouse; An intelligent agent awakening module is connected to the intelligent agent acquisition module and is used to awaken the at least one intelligent agent.

9. A device for waking up an intelligent agent, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to implement the method for waking up an intelligent agent according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for waking up an intelligent agent according to any one of claims 1 to 7 is implemented.