Intelligent agent application method and device based on large model, equipment and medium
By introducing chat record rewriting, document processing and natural language processing technologies in large model agent applications, the problem of accuracy of large models answering in different business scenarios is solved, and efficient, intelligent and easy-to-use intelligent services are achieved to meet the needs of the needs of large models. Diversified needs.
Patent Information
- Application Number
- CN202411171432.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-26
- Publication Date
- 2025-01-03
AI Technical Summary
Existing large models are difficult to meet the specific needs of different business scenarios, making it difficult to provide accurate answers in different business scenarios.
Through the large-model-based agent application method, the openness and sharing of Agent agents is realized, and chat records, document processing and intelligent reply mechanisms are used, and natural language processing and machine learning technology are combined to provide personalized services and flexible solutions.
Improve the response speed, understanding ability and scalability of the agent, provide efficient, intelligent and easy-to-use intelligent services, support online testing and API interface calls, reduce integration difficulty and cost, and promote the popularization of intelligent services. and development.
Smart Images

Figure CN119250226A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of AI, and in particular to a large model-based intelligent agent application method, device, equipment and medium. Background Art
[0002] With the rapid development of artificial intelligence technology, especially the breakthrough of deep learning technology, large-scale models have shown great application potential and value in many fields. These large-scale models can learn rich knowledge and representation capabilities through large-scale training data and complex neural network structures, providing a solid foundation for intelligent applications. The intelligent agent application method based on large models takes advantage of these advantages and aims to improve the response speed, understanding ability, personalized service and scalability of intelligent systems.
[0003] However, different business scenarios correspond to different business needs, and existing large models often cannot accurately answer specific business needs. Therefore, there is an urgent need for an agent application method based on a large model to realize the openness and sharing of agent agents to meet the needs of different business scenarios. Summary of the invention
[0004] In view of this, the embodiments of the present application provide an agent application method, device, equipment and medium based on a large model, which can realize the openness and sharing of Agent agents to meet the needs of different business scenarios.
[0005] The technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides an agent application method based on a large model, the method comprising:
[0007] In a second aspect, an embodiment of the present application further provides an intelligent agent application device based on a large model, the device comprising:
[0008] In the third aspect, an embodiment of the present application also provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to execute the large model-based intelligent agent application method described in any one of the first aspects.
[0009] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the large model-based intelligent agent application method described in any one of the first aspects is executed.
[0010] The embodiments of the present application have the following beneficial effects:
[0011] (1) Efficiency: Relying on the powerful computing power of the large model service platform, AI Agent can respond to user requests instantly, reduce waiting time, and improve user experience. When processing complex tasks or large amounts of data, efficiency ensures that the system can be completed quickly, avoiding resource waste and user dissatisfaction caused by long processing time.
[0012] (2) Intelligence: By integrating natural language processing and machine learning technologies, AI Agents can accurately capture user intent, reduce misunderstandings and incorrect responses, and improve service quality. Based on learning about user behavior and preferences, AI Agents can provide personalized service recommendations, enhancing user satisfaction and loyalty.
[0013] (3) Ease of use: The concise interface design and convenient operation process lower the user threshold, making it easy for non-professionals to get started. Ease of use promotes the popularization and application of AI Agents, allowing more people to enjoy the convenience brought by intelligent services.
[0014] (4) Scalability: Support for adding tool plug-ins and calling external services enables AI Agent to flexibly adapt to different scenarios and needs, maintaining the system's advancement and competitiveness. Scalability makes it possible for the system to be continuously upgraded and optimized, ensuring that AI Agent can keep up with the pace of technological development and meet the ever-changing needs of users.
[0015] (5) Online testing function: Supporting online testing function enables users and developers to quickly verify and optimize system functions and improve development efficiency and quality. Through online testing, potential problems in the system can be discovered and repaired in a timely manner, reducing errors and failures in actual applications.
[0016] (6) Open capabilities: Supporting API interface calls and JS embedded integration methods, allowing users to easily and efficiently connect to and use AI Agent capabilities, reducing integration difficulty and cost. Open capabilities encourage third-party developers to conduct secondary development and innovation based on AI Agent, enriching application scenarios and solutions, and promoting the development of intelligent services.
[0017] In summary, these beneficial effects jointly improve the overall performance and user experience of AI Agent, and bring users more efficient, intelligent, convenient, flexible and scalable intelligent services. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 is a flowchart of steps S101-S103 provided in an embodiment of the present application;
[0020] Figure 2 It is an Agent implementation logic diagram provided by the embodiment of the present application;
[0021] Figure 3 It is a plug-in execution logic diagram provided in an embodiment of the present application;
[0022] Figure 4 It is a flowchart of steps S401-S402 provided in an embodiment of the present application;
[0023] Figure 5 It is an Agent implementation flow chart provided in the embodiment of the present application;
[0024] Figure 6 is a schematic diagram of the structure of an intelligent agent application device based on a large model provided in an embodiment of the present application;
[0025] Figure 7 It is a schematic diagram of the composition structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0026] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0027] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it will be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0028] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0029] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0030] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0032] See also Figure 1 , Figure 1 is a flow chart of steps S101-S103 of the agent application method based on a large model provided in an embodiment of the present application, which will be combined with Figure 1 Steps S101-S103 are shown for explanation.
[0033] The above exemplary steps of the embodiments of the present application are described below respectively.
[0034] In step S101, in response to a question request for a first question, it is determined whether there is a chat record. If there is a chat record, the first question is rewritten based on the chat record to obtain a second question.
[0035] In step S102, it is determined whether the question request includes a question about a target document. If so, a target segment is recalled from the target document based on the second question, and a target prompt is constructed based on the recalled target segment and the second question, wherein the target document represents an external document.
[0036] In step S103, the reply type of the target prompt is determined. If the reply type is a function call, the first target information is determined based on the corresponding plug-in, and the first target information is returned to the big model; if the reply type is a content reply, the second target information is determined based on the target prompt, and the second target information is returned to the big model.
[0037] For examples, see Figure 2 , Figure 2 is the Agent implementation logic diagram provided by the embodiment of the present application, such as Figure 2 As shown in the figure, when the big model receives a question request for a certain question (first question), it first checks whether there is a chat record with the current user or a similar situation. If relevant chat records are detected, the intelligent body will use these historical information to rewrite the original question and generate a second question that is more accurate or more in line with the context. This rewriting helps reduce ambiguity and improve the accuracy of subsequent processing.
[0038] Next, the agent determines whether the question request explicitly points to a target document (such as a user manual, policy document, etc.). If the request involves a specific document, the agent will recall the relevant target fragment from the target document based on the rewritten second question. Based on the recalled target fragment and the second question, the agent constructs a targeted prompt. This prompt not only contains the specific content of the question, but also incorporates relevant information in the document.
[0039] If the reply type is a function call, it means that the user wants to perform a specific operation or query the status of a system. At this time, the agent will call the corresponding plug-in or service according to the requirements in the prompt, obtain the first target information (such as query results, operation feedback, etc.), and return it to the big model for further processing or directly display it to the user. For the content reply type, the agent directly generates the second target information (such as answers, explanations, etc.) based on the questions and context in the prompt, and returns it to the big model or directly presents it to the user.
[0040] The above approach effectively improves the agent's ability to handle complex problems by combining chat records, document processing, and intelligent reply mechanisms. It can not only optimize the processing of current questions based on the user's historical questions, but also provide more accurate and targeted replies by deeply analyzing the document content. In addition, by distinguishing reply types and flexibly calling plug-ins or services, this method further enhances the flexibility and practicality of the agent.
[0041] In some embodiments, rewriting the first question based on the chat record to obtain a second question includes:
[0042] Acquire the chat record, and select a preset number of recent sub-chat records from the chat record;
[0043] The sub-chat record, the first question and the prompt template are encapsulated to obtain the second question.
[0044] Here, the system needs to obtain the complete chat records of the user's current session or related sessions. These records may be stored in a database, file, or memory, depending on how the system is implemented. Since chat records may be very long and contain a lot of information that is not directly related to the current issue, the system needs to filter out the most relevant and recent sub-chat records. This is usually achieved by selecting a preset number of recent chat records (such as the most recent 5, 10, etc.). These sub-chat records should be able to reflect the topic, context, or focus of the user's current discussion.
[0045] Next, the system will encapsulate the selected sub-chat record, the first question, and the prompt template to generate the second question. The specific steps of the encapsulation process include:
[0046] Extract key information: Extract keywords, phrases, or sentences related to the first question from the subchat transcript. This information may directly answer part of the first question or provide necessary context for rephrasing the question.
[0047] Build the question framework: Use a prompt template as a base framework, which may define the basic structure and format of the question. The template may include placeholders for inserting key information extracted from the chat transcript or the user's first question.
[0048] Insert information: Insert the extracted key information and the first question into the corresponding position according to the template requirements. During the insertion process, some text processing may be required, such as removing duplicate information, adjusting word order, or replacing synonyms to ensure that the rewritten question is both accurate and fluent.
[0049] Generate the second question: After the above steps, the system will generate a rewritten second question. This question not only contains the user's original first question, but also incorporates the context information extracted from the chat history, making the question clearer and more specific.
[0050] The above method can effectively rewrite the first question based on the chat record to generate a more accurate and contextual second question. This will help improve the accuracy and efficiency of subsequent processing (such as document fragment recall, prompt construction and reply generation).
[0051] In some embodiments, determining whether the question request includes a question about a target document, and if so, recalling a target segment from the target document based on the second question includes:
[0052] determining whether the question request includes a question about a target document, and if so, determining the target document based on the second question;
[0053] determining at least one similar segment from the target document based on the second question;
[0054] A preset number of similar segments with the highest similarity are determined from the at least one similar segment to be the target segment.
[0055] Here, the system first needs to analyze the content of the query request to determine whether it clearly points to one or more specific target documents. This can be achieved by identifying keywords, phrases, or specific document identifiers (such as file names, document IDs, etc.) in the request. If the request contains enough information to clearly point to one or more target documents, the system considers the request to be for the target document.
[0056] After confirming that the question request is for the target document, the system needs to further determine the specific target document based on the rewritten second question. This may be because a user may have multiple documents, and certain specific words or contexts in the second question can help the system narrow down the scope to one or several documents. For example, if a specific project name or date is mentioned in the second question, the system may select documents containing this information as target documents.
[0057] Once the target documents are identified, the system needs to retrieve relevant content snippets from these documents based on the second question. This usually involves text search and matching algorithms such as keyword search, TF-IDF, BM25, etc. The system looks for text snippets in the target documents that are most similar to the second question. These snippets may contain answers, explanations, or contextual information directly related to the question.
[0058] After retrieving multiple similar fragments, the system needs to evaluate the similarity of these fragments with the second question, and select the preset number of fragments with the highest similarity as the final target fragments. The similarity evaluation can be based on a variety of factors, such as vocabulary matching, semantic similarity, fragment length, etc. The system may calculate a similarity score for each fragment and sort them according to the score. Then, the system will select the top N fragments with the highest scores (N is a preset number) as target fragments and return them to the subsequent processing flow.
[0059] The above method can accurately retrieve the content fragments most relevant to the user's question from a large number of documents, providing strong support for subsequent prompt construction and response generation.
[0060] In some embodiments, determining the first target information based on the corresponding plug-in and returning the first target information to the large model includes:
[0061] Determine whether the plug-in is automatically executed. If not, directly return JSON information to the user end;
[0062] If so, use the function corresponding to the plug-in to execute, and return the json information of successful execution to the large model, so that the large model can process the json information and return the optimized query result to the platform, so that the platform can reply.
[0063] Here, when the system finds the corresponding plug-in according to the user request, it first needs to determine whether the plug-in needs to be executed automatically. This depends on the configuration of the plug-in, the user's permissions, and the specific content of the request. If the plug-in is configured as non-automatic execution (i.e., manual intervention or confirmation is required), the system will not execute the plug-in immediately, but will directly return a JSON formatted data containing relevant information to the user end. This JSON information includes a description of the plug-in, content that requires user confirmation, or reasons why the plug-in cannot be executed automatically. If the plug-in is configured to be executed automatically, the system will call the function or method of the plug-in to perform the corresponding operation. This process may involve interaction with backend services, data processing or conversion, or even calling other APIs. During the execution process, the plug-in will generate some results or data based on user requests and its own logic. These results or data are formatted in JSON format for transmission and processing within the system.
[0064] Once the plugin is executed successfully and generates result information in JSON format, this information will be returned to the big model. The big model plays the role of an intermediate processing layer here, which is responsible for receiving the raw data from the plugin and further processing and analyzing it. The big model may use various algorithms and technologies (such as natural language processing, machine learning, etc.) to understand and interpret this data, and then generate more optimized and accurate query results or responses based on this data.
[0065] After being processed by the big model, the original JSON information is converted into more valuable and easier to understand optimized query results. These results may be direct answers to the original questions, relevant suggestions, or a series of related data and information. Finally, these optimized query results are returned to the platform (which may be the user's front-end interface, API caller, or other internal system). The platform will display these results to the user or perform other subsequent processing as needed. After receiving the optimized query results from the big model, the platform will be responsible for displaying these results to the user in an appropriate manner. This may involve displaying text results on the screen, playing audio or video, or presenting them to the user in other forms of interaction.
[0066] As an example, see Figure 3 , Figure 3 is a plug-in execution logic diagram provided in an embodiment of the present application, such as Figure 3 As shown in the figure, the user input question is the starting point of the whole process. The user asks the system a question. After receiving the user's question, the system uses a retrieval mechanism (which may be based on the retrieval enhanced generation model RAG, or other similar technologies) to find the plug-in description that best matches the user's question. This plug-in description will be used to call the corresponding plug-in in the subsequent steps. The system uses the assistant_code of the plug-in found to query the permission type (permissions_type) of the plug-in in the ai_assistant_tab table to understand the permission level required by the plug-in. Next, the system queries the plug-in code set that the user has access to based on the user's permission level. This is to ensure that the user can only access the plug-ins within their permission range. The system again uses the assistant_code of the plug-in and the permissions_type previously queried to perform permission verification in the plugin_authority_tab table. This step is to confirm whether the user really has the right to access the plug-in. If the plug-in passes the permission verification, the system will encapsulate the request model parameters according to the description of the plug-in and call the question-answering interface. This step is to prepare the parameters required to call the plug-in. The Q&A interface returns the interface code and parameters. The system determines the interface type of the plug-in based on this information, such as whether it is a RAG interface or a normal Q&A interface. The system prepares the call parameters based on the interface name and calls the corresponding interface. If the interface call is successful, the system may need to convert the format of the returned parameters to meet the needs of the front-end display, such as converting them into a card format. In some cases, the system will require the user to confirm the returned card twice to ensure the accuracy of the information. Finally, the system displays the processed card to the user, or performs further operations as needed, such as calling other interfaces.
[0067] In some embodiments, determining the second target information based on the target prompt and returning the second target information to the large model includes:
[0068] Generate text content based on the target prompt, wherein the text content includes an answer or a rhetorical question;
[0069] The text content is returned to the large model so that the large model replies with the text.
[0070] Here, the system needs to parse the target prompt input by the user to understand its intent, context, and possible needs. This usually involves natural language understanding (NLU) technologies such as intent recognition and entity recognition. Based on the parsing results, the system needs to generate corresponding text content as a response. This can be a direct answer to solve the user's problem or meet their needs; it can also be a rhetorical question to further clarify the problem, guide the conversation, or obtain more information. When generating text content, the system needs to ensure the accuracy, relevance, and fluency of the content. The generation process can be assisted by language models, knowledge bases, or rule sets, and necessary content verification and correction can be performed.
[0071] After receiving the text content, the big model will further process it based on its internal knowledge and algorithms. This includes tasks such as text classification, sentiment analysis, and entity linking. Based on the text content and context information, the big model will generate one or more response options. These responses may be extensions, corrections, or optimizations of the original text content, or they may be completely different new content.
[0072] In some embodiments, the agent corresponds to a graphical user interface, and the method further comprises:
[0073] In response to an access request for the large model, prompt information is displayed through the graphical user interface, where the prompt information is used to prompt the function of the agent.
[0074] Here, when there is an access request for a large model, displaying prompt information through a graphical user interface (GUI) is an important interactive link. The main purpose of this prompt information is to introduce or remind users of the functions of the agent so that users can better understand and use the services provided by the agent.
[0075] Prompt information can briefly summarize the main functions of the agent, such as answering questions, providing suggestions, performing tasks, etc. This helps new users quickly understand the scope of the agent's capabilities. For complex interaction processes or specific functions, prompt information can serve as an operation guide to help users understand how to correctly interact with the agent. Through timely and clear prompt information, the user's experience and satisfaction in the process of using the agent can be improved.
[0076] In some embodiments, see Figure 4 , Figure 4 is a flow chart of steps S401-S402 provided in the embodiment of the present application, which will be combined with Figure 4 Steps S401-S402 are shown for explanation.
[0077] In step S401, in response to a request to add a tool plug-in, the tool plug-in is added to the agent, wherein the tool plug-in is used to call an external service.
[0078] In step S402, a question and answer response is performed based on the tool plug-in.
[0079] Here, the system needs to be able to receive tool plug-in addition requests from users or administrators. This request may contain description information of the plug-in, installation package or link, configuration parameters, etc. Before adding a plug-in, the system needs to perform necessary verification and review. This includes checking the compatibility, security, and compliance with specific standards or specifications of the plug-in. Once the plug-in passes the verification and review, the system can install it on the intelligent agent and configure it as needed. This includes setting the startup parameters of the plug-in, the credentials for connecting to external services, and defining the interaction interface between the plug-in and other parts of the intelligent agent.
[0080] By adding tool plug-ins, the agent can easily integrate new functions and services without modifying its core code. This allows the agent to quickly adapt to changing needs and scenarios. High flexibility: Different tool plug-ins can be optimized and customized for different external services to provide more accurate and efficient answers. At the same time, users can also selectively enable or disable plug-ins according to their needs. The introduction of tool plug-ins allows the agent to be applied to a wider range of fields and scenarios, such as financial services, medical health, education and entertainment, etc. By calling different plug-ins, the agent can provide users with diversified services and support.
[0081] Below, the embodiments of the present application will be fully described.
[0082] See also Figure 5 , Figure 5 is an Agent implementation flow chart provided in the embodiment of the present application, such as Figure 5As shown in the figure, the user question is the starting point of the whole process. The user asks the AI assistant a question. The AI assistant first extracts key information from the user question to form one or more prompts. These prompts are used to guide the subsequent processing. Using the extracted prompts, the AI assistant initiates a retrieval request to the knowledge base. This knowledge base may contain a large number of predefined answers or related information for quick response to common questions. If the knowledge base retrieval returns multiple possible answers or related information, the AI assistant will further assemble or filter to form more accurate answer candidates. In some cases, the AI assistant may need to interact with external services (such as LLM reasoning service) through HTTP requests to obtain more in-depth answers or perform specific tasks. The AI assistant will try to use a large language model (LLM) for reasoning to answer the user's question. LLM can understand and generate natural language text to provide meaningful answers. If LLM reasoning cannot solve the problem directly, the AI assistant will call the FunctioCall function to execute specific code or scripts. These codes may be used to handle complex data analysis, calculations, or call external APIs. After the FunctioCall function is called, the corresponding code will be executed. The execution result will be used for subsequent processing or answer generation. Update prompt words: Based on the results of code execution or other information, the AI assistant may update or generate new prompt words for more in-depth processing or answers. In the process, there are multiple conditional branch points. These branch points are used to determine the next operation based on the current state or result. For example, if LLM reasoning successfully solves the problem, the result is directly output; if it fails, the code is attempted to be executed or other operations are performed. The AI assistant will parse the execution results or retrieval results to extract useful information or parameters. Key parameters or information are extracted from the parsed results to generate the final answer or perform subsequent operations. Throughout the process, RAG (which may stand for rules and policies) tools play a key role. They provide AI assistants with rules and policy guidance for handling problems to ensure that the process can proceed smoothly. In addition to the tools and functions such as LLM reasoning and FunctioCall mentioned above, AI assistants may also use other tools and modules to perform specific tasks or operations. Finally, the AI assistant will generate and output one or more answers to the user. These answers may be based on the results of LLM reasoning, the results of code execution, or the results of knowledge base retrieval.
[0083] In summary, the embodiments of the present application have the following beneficial effects:
[0084] (1) Efficiency: Relying on the powerful computing power of the large model service platform, AI Agent can respond to user requests instantly, reduce waiting time, and improve user experience. When processing complex tasks or large amounts of data, efficiency ensures that the system can be completed quickly, avoiding resource waste and user dissatisfaction caused by long processing time.
[0085] (2) Intelligence: By integrating natural language processing and machine learning technologies, AI Agents can accurately capture user intent, reduce misunderstandings and incorrect responses, and improve service quality. Based on learning about user behavior and preferences, AI Agents can provide personalized service recommendations, enhancing user satisfaction and loyalty.
[0086] (3) Ease of use: The concise interface design and convenient operation process lower the user threshold, making it easy for non-professionals to get started. Ease of use promotes the popularization and application of AI Agents, allowing more people to enjoy the convenience brought by intelligent services.
[0087] (4) Scalability: Support for adding tool plug-ins and calling external services enables AI Agent to flexibly adapt to different scenarios and needs, maintaining the system's advancement and competitiveness. Scalability makes it possible for the system to be continuously upgraded and optimized, ensuring that AI Agent can keep up with the pace of technological development and meet the ever-changing needs of users.
[0088] (5) Online testing function: Supporting online testing function enables users and developers to quickly verify and optimize system functions and improve development efficiency and quality. Through online testing, potential problems in the system can be discovered and repaired in a timely manner, reducing errors and failures in actual applications.
[0089] (6) Open capabilities: Supporting API interface calls and JS embedded integration methods, allowing users to easily and efficiently connect to and use AI Agent capabilities, reducing integration difficulty and cost. Open capabilities encourage third-party developers to conduct secondary development and innovation based on AI Agent, enriching application scenarios and solutions, and promoting the development of intelligent services.
[0090] In summary, these beneficial effects jointly improve the overall performance and user experience of AI Agent, and bring users more efficient, intelligent, convenient, flexible and scalable intelligent services.
[0091] Based on the same inventive concept, the embodiment of the present application also provides a large model-based intelligent agent application device corresponding to the large model-based intelligent agent application method in the first embodiment. Since the principle of solving the problem by the device in the embodiment of the present application is similar to the above-mentioned large model-based intelligent agent application method, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be repeated.
[0092] like Figure 6 As shown, Figure 6 600 is a schematic diagram of the structure of an intelligent agent application device 600 based on a large model provided in an embodiment of the present application. The intelligent agent application device 600 based on a large model includes:
[0093] A rewriting module 601 is used to respond to a question request for a first question, determine whether there is a chat record, and if there is a chat record, rewrite the first question based on the chat record to obtain a second question;
[0094] A recall module 602 is used to determine whether the question request includes a question for a target document, and if so, recall a target segment from the target document based on the second question, and construct a target prompt based on the recalled target segment and the second question, wherein the target document represents an external document;
[0095] Determination module 603 is used to determine the reply type of the target prompt. If the reply type is a function call, the first target information is determined based on the corresponding plug-in, and the first target information is returned to the large model; if the reply type is a content reply, the second target information is determined based on the target prompt, and the second target information is returned to the large model.
[0096] Those skilled in the art should understand that Figure 6 The implementation functions of each unit in the large-model-based intelligent agent application device 600 shown can be understood by referring to the relevant description of the aforementioned large-model-based intelligent agent application method. Figure 6 The functions of each unit in the large model-based intelligent agent application device 600 shown can be implemented by a program running on a processor or by a specific logic circuit.
[0097] In a possible implementation, the rewriting module 601 rewrites the first question based on the chat record to obtain a second question, including:
[0098] Acquire the chat record, and select a preset number of recent sub-chat records from the chat record;
[0099] The sub-chat record, the first question and the prompt template are encapsulated to obtain the second question.
[0100] In a possible implementation, the recall module 602 determines whether the question request includes a question about the target document, and if so, recalls the target segment from the target document based on the second question, including:
[0101] determining whether the question request includes a question about a target document, and if so, determining the target document based on the second question;
[0102] determining at least one similar segment from the target document based on the second question;
[0103] A preset number of similar segments with the highest similarity are determined from the at least one similar segment to be the target segment.
[0104] In a possible implementation manner, the determination module 603 determines the first target information based on the corresponding plug-in and returns the first target information to the large model, including:
[0105] Determine whether the plug-in is automatically executed. If not, directly return JSON information to the user end;
[0106] If so, use the function corresponding to the plug-in to execute, and return the json information of successful execution to the large model, so that the large model can process the json information and return the optimized query result to the platform, so that the platform can reply.
[0107] In a possible implementation manner, the determination module 603 determines the second target information based on the target prompt, and returns the second target information to the large model, including:
[0108] Generate text content based on the target prompt, wherein the text content includes an answer or a rhetorical question;
[0109] The text content is returned to the large model so that the large model replies with the text.
[0110] In a possible implementation, the agent corresponds to a graphical user interface, and the recall module 601 further includes:
[0111] In response to an access request for the large model, prompt information is displayed through the graphical user interface, where the prompt information is used to prompt the function of the agent.
[0112] In a possible implementation manner, the determination module 603 further includes:
[0113] In response to a request to add a tool plug-in, add the tool plug-in to the agent, wherein the tool plug-in is used to call an external service;
[0114] Conduct question and answer responses based on the tool plug-in.
[0115] The above-mentioned intelligent agent application device based on the large model has the following beneficial effects:
[0116] (1) Efficiency: Relying on the powerful computing power of the large model service platform, AI Agent can respond to user requests instantly, reduce waiting time, and improve user experience. When processing complex tasks or large amounts of data, efficiency ensures that the system can be completed quickly, avoiding resource waste and user dissatisfaction caused by long processing time.
[0117] (2) Intelligence: By integrating natural language processing and machine learning technologies, AI Agents can accurately capture user intent, reduce misunderstandings and incorrect responses, and improve service quality. Based on learning about user behavior and preferences, AI Agents can provide personalized service recommendations, enhancing user satisfaction and loyalty.
[0118] (3) Ease of use: The concise interface design and convenient operation process lower the user threshold, making it easy for non-professionals to get started. Ease of use promotes the popularization and application of AI Agents, allowing more people to enjoy the convenience brought by intelligent services.
[0119] (4) Scalability: Support for adding tool plug-ins and calling external services enables AI Agent to flexibly adapt to different scenarios and needs, maintaining the system's advancement and competitiveness. Scalability makes it possible for the system to be continuously upgraded and optimized, ensuring that AI Agent can keep up with the pace of technological development and meet the ever-changing needs of users.
[0120] (5) Online testing function: Supporting online testing function enables users and developers to quickly verify and optimize system functions and improve development efficiency and quality. Through online testing, potential problems in the system can be discovered and repaired in a timely manner, reducing errors and failures in actual applications.
[0121] (6) Open capabilities: Supporting API interface calls and JS embedded integration methods, allowing users to easily and efficiently connect to and use AI Agent capabilities, reducing integration difficulty and cost. Open capabilities encourage third-party developers to conduct secondary development and innovation based on AI Agent, enriching application scenarios and solutions, and promoting the development of intelligent services.
[0122] In summary, these beneficial effects jointly improve the overall performance and user experience of AI Agent, and bring users more efficient, intelligent, convenient, flexible and scalable intelligent services.
[0123] like Figure 7 As shown, Figure 7 The present invention provides a schematic diagram of the structure of an electronic device 700, wherein the electronic device 700 includes:
[0124] A processor 701, a storage medium 702 and a bus 703, wherein the storage medium 702 stores machine-readable instructions executable by the processor 701. When the electronic device 700 is running, the processor 701 communicates with the storage medium 702 via the bus 703, and the processor 701 executes the machine-readable instructions to perform the steps of the large model-based intelligent agent application method described in the embodiment of the present application.
[0125] In actual application, the components in the electronic device 700 are coupled together via the bus 703. It is understood that the bus 703 is used to realize the connection and communication between these components. In addition to the data bus, the bus 703 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 7 Various buses are labeled as bus 703.
[0126] The above electronic device has the following beneficial effects:
[0127] (1) Efficiency: Relying on the powerful computing power of the large model service platform, AI Agent can respond to user requests instantly, reduce waiting time, and improve user experience. When processing complex tasks or large amounts of data, efficiency ensures that the system can be completed quickly, avoiding resource waste and user dissatisfaction caused by long processing time.
[0128] (2) Intelligence: By integrating natural language processing and machine learning technologies, AI Agents can accurately capture user intent, reduce misunderstandings and incorrect responses, and improve service quality. Based on learning about user behavior and preferences, AI Agents can provide personalized service recommendations, enhancing user satisfaction and loyalty.
[0129] (3) Ease of use: The concise interface design and convenient operation process lower the user threshold, making it easy for non-professionals to get started. Ease of use promotes the popularization and application of AI Agents, allowing more people to enjoy the convenience brought by intelligent services.
[0130] (4) Scalability: Support for adding tool plug-ins and calling external services enables AI Agent to flexibly adapt to different scenarios and needs, maintaining the system's advancement and competitiveness. Scalability makes it possible for the system to be continuously upgraded and optimized, ensuring that AI Agent can keep up with the pace of technological development and meet the ever-changing needs of users.
[0131] (5) Online testing function: Supporting online testing function enables users and developers to quickly verify and optimize system functions and improve development efficiency and quality. Through online testing, potential problems in the system can be discovered and repaired in a timely manner, reducing errors and failures in actual applications.
[0132] (6) Open capabilities: Supporting API interface calls and JS embedded integration methods, allowing users to easily and efficiently connect to and use AI Agent capabilities, reducing integration difficulty and cost. Open capabilities encourage third-party developers to conduct secondary development and innovation based on AI Agent, enriching application scenarios and solutions, and promoting the development of intelligent services.
[0133] In summary, these beneficial effects jointly improve the overall performance and user experience of AI Agent, and bring users more efficient, intelligent, convenient, flexible and scalable intelligent services.
[0134] The embodiment of the present application also provides a computer-readable storage medium, which stores executable instructions. When the executable instructions are executed by at least one processor 701, the large model-based intelligent agent application method described in the embodiment of the present application is implemented.
[0135] In some embodiments, the storage medium can be a magnetic random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface storage, an optical disk, or a compact disc read-only memory (CD ROM); it can also be various devices including one or any combination of the above memories.
[0136] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0137] As an example, executable instructions may, but do not necessarily, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, for example, in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (for example, files storing one or more modules, subroutines, or code portions).
[0138] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0139] The computer-readable storage medium has the following advantages:
[0140] (1) Efficiency: Relying on the powerful computing power of the large model service platform, AI Agent can respond to user requests instantly, reduce waiting time, and improve user experience. When processing complex tasks or large amounts of data, efficiency ensures that the system can be completed quickly, avoiding resource waste and user dissatisfaction caused by long processing time.
[0141] (2) Intelligence: By integrating natural language processing and machine learning technologies, AI Agents can accurately capture user intent, reduce misunderstandings and incorrect responses, and improve service quality. Based on learning about user behavior and preferences, AI Agents can provide personalized service recommendations, enhancing user satisfaction and loyalty.
[0142] (3) Ease of use: The concise interface design and convenient operation process lower the user threshold, making it easy for non-professionals to get started. Ease of use promotes the popularization and application of AI Agents, allowing more people to enjoy the convenience brought by intelligent services.
[0143] (4) Scalability: Support for adding tool plug-ins and calling external services enables AI Agent to flexibly adapt to different scenarios and needs, maintaining the system's advancement and competitiveness. Scalability makes it possible for the system to be continuously upgraded and optimized, ensuring that AI Agent can keep up with the pace of technological development and meet the ever-changing needs of users.
[0144] (5) Online testing function: Supporting online testing function enables users and developers to quickly verify and optimize system functions and improve development efficiency and quality. Through online testing, potential problems in the system can be discovered and repaired in a timely manner, reducing errors and failures in actual applications.
[0145] (6) Open capabilities: Supporting API interface calls and JS embedded integration methods, allowing users to easily and efficiently connect to and use AI Agent capabilities, reducing integration difficulty and cost. Open capabilities encourage third-party developers to conduct secondary development and innovation based on AI Agent, enriching application scenarios and solutions, and promoting the development of intelligent services.
[0146] In summary, these beneficial effects jointly improve the overall performance and user experience of AI Agent, and bring users more efficient, intelligent, convenient, flexible and scalable intelligent services.
[0147] In the several embodiments provided in the present application, it should be understood that the disclosed methods and electronic devices can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0148] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0149] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0150] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a platform server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0151] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A large model-based intelligent agent application method, characterized in that: The method comprises: In response to a question request for the first question, determining whether there is a chat record, and if there is a chat record, rewriting the first question based on the chat record to obtain a second question; determining whether the question request includes a question about a target document, and if so, recalling a target segment from the target document based on the second question, and constructing a target prompt based on the recalled target segment and the second question, wherein the target document represents an external document; Determine the reply type of the target prompt. If the reply type is a function call, determine the first target information based on the corresponding plug-in, and return the first target information to the large model. If the reply type is a content reply, determine the second target information based on the target prompt, and return the second target information to the large model.
2. The method according to claim 1, characterized in that The rewriting of the first question based on the chat record to obtain the second question includes: Acquire the chat record, and select a preset number of recent sub-chat records from the chat record; The sub-chat record, the first question and the prompt template are encapsulated to obtain the second question.
3. The method according to claim 1, characterized in that Determining whether the question request includes a question about the target document, and if so, recalling a target segment from the target document based on the second question, including: determining whether the question request includes a question about a target document, and if so, determining the target document based on the second question; determining at least one similar segment from the target document based on the second question; A preset number of similar segments with the highest similarity are determined from the at least one similar segment to be the target segment.
4. The method according to claim 1, characterized in that: The determining the first target information based on the corresponding plug-in and returning the first target information to the large model includes: Determine whether the plug-in is automatically executed. If not, directly return JSON information to the user end; If so, use the function corresponding to the plug-in to execute, and return the json information of successful execution to the large model, so that the large model can process the json information and return the optimized query result to the platform, so that the platform can reply.
5. The method according to claim 1, characterized in that: The determining the second target information based on the target prompt and returning the second target information to the large model comprises: Generate text content based on the target prompt, wherein the text content includes an answer or a rhetorical question; The text content is returned to the large model so that the large model replies with the text.
6. The method according to claim 1, characterized in that The agent corresponds to a graphical user interface, and the method further comprises: In response to an access request for the large model, prompt information is displayed through the graphical user interface, where the prompt information is used to prompt the function of the agent.
7. The method according to claim 1, characterized in that The method further comprises: In response to a request to add a tool plug-in, add the tool plug-in to the agent, wherein the tool plug-in is used to call an external service; Conduct question and answer responses based on the tool plug-in.
8. An intelligent agent application device based on a large model, characterized in that: The device comprises: a rewriting module, configured to, in response to a question request for a first question, determine whether there is a chat record, and if there is a chat record, rewrite the first question based on the chat record to obtain a second question; a recall module, configured to determine whether the question request includes a question for a target document, and if so, recall a target segment from the target document based on the second question, and construct a target prompt based on the recalled target segment and the second question, wherein the target document represents an external document; A determination module is used to determine the reply type of the target prompt. If the reply type is a function call, the first target information is determined based on the corresponding plug-in, and the first target information is returned to the large model; if the reply type is a content reply, the second target information is determined based on the target prompt, and the second target information is returned to the large model.
9. An electronic device, characterized in that: include: A processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium via the bus, and the processor executes the machine-readable instructions to execute the large model-based intelligent agent application method as described in 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 large model-based intelligent agent application method as described in any one of claims 1 to 7 is executed.
Citation Information
Cited By
Intelligent financial engineering quantitative research and reproduction method and related assembly
CN120258995A
An intelligent financial engineering quantitative research and reproduction method and related components
CN120258995B
A method, apparatus, equipment and medium for generating ship technical specifications.
CN122674637A
