A large model application system based on adaptive intelligence
By introducing inference interfaces, vector databases and prompt word processing components into the large model application system, meta-agents are constructed and matched to the agent list, which solves the problem of poor adaptive requirements for agents in the existing technology and achieves the level of agents. The improvement and automatic calling have improved the intelligence level of large models.
Patent Information
- Application Number
- CN202410886571.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2044-07-03
AI Technical Summary
Existing agent-based large model technologies, especially open source implementations, are difficult to meet adaptive needs. The level of intelligence is not high enough. Agents that meet task requirements need to be preset, and the logic needs to be modified to perform different tasks.
A large model application system based on adaptive intelligence is designed, including a reasoning interface, a vector database and a prompt word processing component. It constructs a meta-agent through structured processing of task instructions input by the user, and matches the corresponding intelligence in the vector database. Agent, generate a list of agents, and automatically call agents that meet task requirements.
It improves the level of agents that use large models to solve practical problems. It can automatically retrieve and optimize prompts, clarify task goals and functions, and guide the output of large models. It avoids users from actively selecting agents and improves the ability to automatically call agents.
Smart Images

Figure CN118428400B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of natural language processing, and specifically to a large model application system based on adaptive intelligence. Background Art
[0002] Currently, the agent-based large model technologies that are publicly available are mainly divided into two types: closed source and open source. Closed source large model technologies such as OpenAI's GPT4 and Google's Gemini can call external tools at the same time while satisfying the output of the large model itself according to the user's input instructions. However, the mechanism has not been made public. Through research, it has been found that some open source large model technologies that implement similar functions often require the pre-setting of agents that meet the task requirements. The logic needs to be modified to perform different tasks, which does not meet the adaptive requirements and the intelligence level is not high enough. Summary of the invention
[0003] The purpose of this application is to provide a large model application system based on adaptive intelligence to solve the technical problems raised in the above background.
[0004] To achieve the above-mentioned purpose, the present application discloses the following technical solutions: a large model application system based on adaptive intelligence, including an inference interface, a vector database and a prompt word processing component;
[0005] The reasoning interface is configured to: receive user input, wherein the user input at least includes a task instruction;
[0006] The vector database is configured to: store agents and body data information of the agents, each of the agents having at least one function point;
[0007] The prompt word processing component is configured to: perform structured processing on the task instructions input by the user, parse the results of the structured processing, and construct a meta-agent based on the parsing results, wherein the meta-agent is composed of the required functional points corresponding to the parsing results, and generates an agent list after matching the corresponding agent in the vector database through the meta-agent, and inputs it into the large model, and the large model executes the task instructions based on reasoning, and finally outputs the execution results.
[0008] Preferably, the body data information at least includes the name, function description and calling path of each intelligent agent.
[0009] Preferably, the name and function description of the agent are vectorized data after semantic vectorization processing.
[0010] Preferably, the vector database is the milvus vector database, and the model used for vectorization processing is m3e-large.
[0011] Preferably, the prompt word processing component includes a prompt optimization module, a task parsing module and a result output module;
[0012] The prompt optimization module is configured to: perform structured processing on the user's input to clarify the task requirements, task instructions and output requirements corresponding to the input;
[0013] The task parsing module is configured to: parse the task requirements corresponding to the structured user input, determine whether to select an agent to execute the task instruction, and when it is necessary to select an agent, determine the function required to complete the task instruction, match the required function with the required function point, construct the meta-agent, and generate an agent list after matching the corresponding agent in the vector database through the meta-agent;
[0014] The result output module is configured to integrate the task requirements, the task instructions, the output requirements and the agent list, and input them into the big model. The big model executes the task instructions based on reasoning and finally outputs the execution results.
[0015] Preferably, the structured processing specifically includes:
[0016] Process the natural language input by the user to obtain the user's intention and expected results.
[0017] Preferably, the operation process of the large model application system based on adaptive intelligence includes the following steps:
[0018] S1: The system starts, the reasoning interface receives the user's input, and the prompt word processing component performs structured processing on the user's input;
[0019] S2: taking the structured corresponding task requirements as the input of the task parsing module to determine whether the intelligent agent needs to be called;
[0020] S3: If there is no need to call the intelligent agent, the user input after structured processing is directly used as the input of the large model to infer the final result;
[0021] S4: If an agent needs to be called, the task requirements are parsed to obtain the functions required to complete the task instructions;
[0022] S5: taking the acquired functions as input, after matching them with the required function points, constructing the meta-agent, and using the meta-agent to search and match in the vector database to obtain a corresponding agent list;
[0023] S6: Input the task requirements, the task instructions, the output requirements and the agent list into the result output module to obtain the final prompt word required to complete the task, and use the final prompt word as the input of the large model. After requesting the large model interface, the large model outputs the execution result corresponding to the user's input.
[0024] Beneficial effect: The large model application system based on adaptive intelligence of the present application utilizes prompt word processing components that meet different functions, combines meta-agents and vector databases, and organically combines them into a system that can automatically call agents that meet task requirements, thereby improving the level of agents that use large models to solve practical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0026] Figure 1 A structural block diagram of a large model application system based on adaptive intelligence provided in an embodiment of the present application;
[0027] Figure 2 A schematic diagram of the operation flow of a large model application system based on adaptive intelligence provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] The technical solutions in the embodiments of the present application are described clearly and completely below. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0029] In this article, the term "comprising" is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of more restrictions, the elements defined by the sentence "comprising..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0030] This embodiment discloses Figure 1 A large model application system based on adaptive intelligence is shown, including a reasoning interface, a vector database and a prompt word processing component.
[0031] Specific:
[0032] The reasoning interface is configured to: receive user input. It should be understood that the user input may be a set of natural languages, but the natural languages at least include language content corresponding to the task instructions. Otherwise, the natural languages input by the user are invalid content. Therefore, the user input at least includes the task instructions after being parsed by the natural language.
[0033] The vector database is configured to: store agents and body data information of the agents, each of the agents having at least one function point;
[0034] The prompt word processing component is configured to: perform structured processing on the task instructions input by the user, parse the results of the structured processing, and construct a meta-agent based on the parsing results, wherein the meta-agent is composed of the required functional points corresponding to the parsing results, and generates an agent list after matching the corresponding agent in the vector database through the meta-agent, and inputs it into the large model, and the large model executes the task instructions based on reasoning, and finally outputs the execution results.
[0035] In this embodiment, the volume data information at least includes the name, function description and call path of each agent. The name and function description of the agent are vectorized data after semantic vectorization processing. The vector database is the milvus vector database, and the model used for vectorization processing is m3e-large.
[0036] More specifically, the prompt word processing component includes a prompt optimization module, a task parsing module and a result output module;
[0037] The prompt optimization module is configured to: perform structured processing on the user's input to clarify the task requirements, task instructions and output requirements corresponding to the input;
[0038] The task parsing module is configured to: parse the task requirements corresponding to the structured user input, determine whether to select an agent to execute the task instruction, and when it is necessary to select an agent, determine the function required to complete the task instruction, match the required function with the required function point, construct the meta-agent, and generate an agent list after matching the corresponding agent in the vector database through the meta-agent;
[0039] The result output module is configured to integrate the task requirements, the task instructions, the output requirements and the agent list, and input them into the big model. The big model executes the task instructions based on reasoning and finally outputs the execution results.
[0040] The structured processing specifically includes:
[0041] Process the natural language input by the user to obtain the user's intention and expected results.
[0042] By the above, Figure 2 As shown in the figure (each template is described in detail below), the operation process of the large model application system based on adaptive intelligence includes the following steps:
[0043] S1: The system starts, the reasoning interface receives the user's input, and the prompt word processing component performs structured processing on the user's input;
[0044] S2: taking the structured corresponding task requirements as the input of the task parsing module to determine whether the intelligent agent needs to be called;
[0045] S3: If there is no need to call the intelligent agent, the user input after structured processing is directly used as the input of the large model to infer the final result;
[0046] S4: If an agent needs to be called, the task requirements are parsed to obtain the functions required to complete the task instructions;
[0047] S5: taking the acquired functions as input, after matching them with the required function points, constructing the meta-agent, and using the meta-agent to search and match in the vector database to obtain a corresponding agent list;
[0048] S6: Input the task requirements, the task instructions, the output requirements and the agent list into the result output module to obtain the final prompt word required to complete the task, and use the final prompt word as the input of the large model. After requesting the large model interface, the large model outputs the execution result corresponding to the user's input.
[0049] It should be noted that in the large model application system based on adaptive intelligence of the present application, Prompt is not limited to Chinese, and can be written in a suitable language according to the characteristics of the large model. In addition, one or more large model interfaces can be provided according to actual requirements. For example: 1) A certain large model is particularly suitable for optimizing Prompt, so it can be specially started as a large model interface for Prompt optimization; 2) A certain large model is good at code generation, so it can be specially started as a large model interface required for code generation in the intelligent agent.
[0050] Based on the above, the large model application system based on adaptive intelligence in this embodiment can automatically retrieve the available corresponding agents using meta-agents to complete the relevant tasks that require the use of agents, thereby avoiding the need for users to actively select the required agents. At the same time, it can automatically optimize and decompose the prompts for users to complete a task, making the task objectives and required functions clearer, and better guiding the output of the large model.
[0051] In order to explain the construction process of this system in detail and for the sake of simplicity, the daily work of R&D personnel is defined in this embodiment as: development document writing, R&D data analysis, literature retrieval, etc. To this end, the AI assistant needs to have functions that meet the above work requirements, and we can define descriptive information of these functions. According to the previous technical solution, we can know that when a user uses an AI assistant to perform a certain task, he may or may not use an agent. As shown in Table 1, it describes whether these three functions are associated with an agent, as well as a structured description of the associated agent. The structured description information includes the name of the agent (name), function description (function), parameters of the agent (parameters) and call path (path). This embodiment also configures a meta-agent separately, which is specifically used to retrieve the required agent in the agent vector library.
[0052] Table 1
[0053] Function Is it necessary to associate an agent? Structured Description of Agents Development documentation writing no none R&D data analysis yes {"name": "data_analysis","function": "Analyze the user's data input or uploaded files, generate corresponding analysis code, call the python interpreter, and give accurate data analysis results","parameters": (*args, **xargs),"path": ".. / agents / data_analysis.py"} Literature search yes {"name": "paper_searcher","function": "Analyze the user's search keywords and paper topics, call the paper search API, and return the title, URL and paper abstract of the relevant paper","parameters": (*args, **xargs),"path": ".. / agents / paper_searcher",} Meta-agent - {"name": "agent_searcher","function": "Analyze the functions required to complete the user's tasks, automatically retrieve the agents required to complete these functions, and return the agent list","parameters": (*args, **xargs),"path": ".. / agents / agent_searcher",}
[0054] To implement the aforementioned functional modules, this embodiment constructs the following Prompt templates respectively.
[0055] 1) Structured Prompt Template
[0056] """
[0057] Please structure the user's input and clarify the task requirements, task instructions, and output requirements. Output in the following format:
[0058] ```
[0059] ## Task background and requirements:
[0060] ## Task specific instructions:
[0061] ## Output requirements:
[0062] ```
[0063] Please note: You only need to structure and output the user's prompt, and do not answer the task questions in the user's input.
[0064] Output: Structured Prompt.
[0065] Input: {input}
[0066] """
[0067] 2) Task parsing prompt template
[0068] """
[0069] Please read the structured prompt for the large model input below, analyze the functions required to complete the tasks in the prompt, and output them in the following format.
[0070] Please note: You only need to follow the above instructions to output, and do not answer the task questions in the input.
[0071] Task analysis results: The list of functions you obtained from the analysis.
[0072] Please start!
[0073] Input: {Task Analysis Prompt}
[0074] """
[0075] 3) Meta-agent Prompt Template
[0076] """
[0077] Please analyze the following prompts about the structured task analysis for large models, and decide whether to call an agent to complete a specific task, and if so, what functions the agent needs to have. Based on your analysis, if you need to call an agent, call the agent_searcher agent.
[0078] Please note: You only need to follow the above instructions to output, and do not answer the task questions in the input.
[0079] Output in the following format:
[0080] Tool list: The list of agents you analyzed. If you do not need an agent, please set it as []
[0081] Please start!
[0082] Input: {agent retrieval results}
[0083] """
[0084] 4) ReAct Prompt Template
[0085] """
[0086] Answer the following questions to the best of your ability. You can use the following agents:
[0087] {List of Agents}
[0088] Use the following output format:
[0089] Question: Input question you must answer
[0090] Thought Process: You have to think about what to do
[0091] Take action: The action you want to take is one of the {agent list}
[0092] Action input: The input of the tool corresponding to the action taken
[0093] Observations: The results of taking action
[0094] The above process of thinking -> taking action -> action input -> observing results may be repeated 0 to multiple times
[0095] Thought Process: I now know the final answer
[0096] Final Answer: Final answer to the original input question
[0097] Please start!
[0098] Question: {Input hint}
[0099] """
[0100] In the task execution of the big model service, taking the retrieval of papers as an example, the process of the big model service task execution is explained: start the big model service, open the reasoning interface, and listen to the user's input. The specific process is as follows:
[0101] 1) Assume that the user input is:
[0102] """
[0103] Please help me search for the latest papers related to "machine learning" and output the paper title, URL and abstract.
[0104] """
[0105] First, fill the user input into the structured Prompt template as the input of the large model interface to obtain a structured task instruction Prompt, as shown in the following example:
[0106] ```
[0107] ## Task background and requirements: Retrieve papers on "machine learning"
[0108] ## Task specific instructions: Perform paper retrieval task with "machine learning" as the keyword
[0109] ## Output requirements: Paper search list (paper title, URL and abstract)
[0110] ```
[0111] 2) Fill the command prompt obtained in 1) into the task analysis prompt template as the input of the large model interface to obtain the task analysis result, as shown in the following example:
[0112] ```
[0113] ## Function: Paper retrieval
[0114] ## Keywords: Machine Learning
[0115] ```
[0116] 3) Analyze the task parsing results in 2) and fill them into the meta-agent prompt template as the input of the large model interface to get the result of whether the agent needs to be called and the collection of agents, as shown in the following example:
[0117] ```
[0118] ## Agent list: [
[0120] {
[0121] "name": "paper_searcher",
[0122] “function”: “Analyze the user’s search keywords and paper topics, call the paper search API, and return the title, URL and paper abstract of the relevant paper”,
[0123] “parameters”: (keywords=“machine learning”),
[0124] "path": ".. / agents / paper_searcher",
[0125] } ]
[0127] ```
[0128] 4) Fill the list of agents obtained in 3) as parameters into the ReAct Prompt template as the input of the large model interface to obtain the final result, as shown in the following example (due to paragraph limitations, only two results are shown):
[0129] ``` [
[0131] {
[0132] "link": "http: / / arxiv.org / abs / 2007.14206v1",
[0133] "publish": "2020-07-27T14:30:23Z",
[0134] "summary": "This paper introduces a machine learning potentialrepository that includes Pareto optimal machine learning potentials. It alsoshows the systematic development of accurate and fast machine learningpotentials for a wide range of elemental systems. As a result, many Paretooptimal machine learning potentials are available in the repository from awebsite. Therefore, the repository will help many scientists to performaccurate and fast atomistic simulations.",
[0135] "title": "Machine Learning Potential Repository"
[0136] },
[0137] {
[0138] "link": "http: / / arxiv.org / abs / 2201.09345v2",
[0139] "publish": "2022-01-23T19:09:22Z",
[0140] "summary": "We review recent work in machine learning aspects of conformal field theory and Lie algebra representation theory using neuralnetworks.",
[0141] "title": "Machine Learning Symmetry"
[0142] }, ]
[0144] ```
[0145] In the embodiments provided in the present application, it should be understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, code, or any appropriate combination thereof. For hardware implementation, the processor can be implemented in one or more of the following units: an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, other electronic units designed to implement the functions described herein, or a combination thereof. For software implementation, part or all of the processes of the embodiment can be completed by instructing the relevant hardware through a computer program. When implemented, the above program can be stored in a computer-readable storage medium or transmitted as one or more instructions or codes on a computer-readable storage medium. Computer-readable storage media include computer storage media and communication media, wherein the communication medium includes any medium that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that can be accessed by a computer. Computer-readable storage media can include, but are not limited to, RAM, ROM, EEPROM, CD-ROM or other optical disk storage, disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of an instruction or data structure and can be accessed by a computer.
[0146] Finally, it should be noted that the above is only a preferred embodiment of the present application and is not intended to limit the present application. Although the present application has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A large model application system based on adaptive intelligence, characterized in that: It includes reasoning interface, vector database and prompt word processing components; The reasoning interface is configured to: receive user input, wherein the user input at least includes a task instruction; The vector database is configured to: store agents and body data information of the agents, each of the agents having at least one function point; The prompt word processing component is configured to: perform structural processing on the task instruction input by the user, parse the result of the structural processing, and construct a meta-agent based on the parsing result, wherein the meta-agent is composed of the required functional points corresponding to the parsing result, and generate an agent list after matching the corresponding agent in the vector database through the meta-agent, and input it into the large model, wherein the large model executes the task instruction based on reasoning, and finally outputs the execution result; The prompt word processing component includes a prompt optimization module, a task analysis module and a result output module; The prompt optimization module is configured to: perform structured processing on the user's input to clarify the task requirements, task instructions and output requirements corresponding to the input; The task parsing module is configured to: parse the task requirements corresponding to the structured user input, determine whether to select an agent to execute the task instruction, and when it is necessary to select an agent, determine the function required to complete the task instruction, match the required function with the required function point, construct the meta-agent, and generate an agent list after matching the corresponding agent in the vector database through the meta-agent; The result output module is configured to: integrate the task requirements, the task instructions, the output requirements and the agent list, and input them into the big model, the big model executes the task instructions based on reasoning, and finally outputs the execution result; The operation process of the large model application system based on adaptive intelligence includes the following steps: S1: The system starts, the reasoning interface receives the user's input, and the prompt word processing component performs structured processing on the user's input; S2: taking the structured corresponding task requirements as the input of the task parsing module to determine whether the intelligent agent needs to be called; S3: If there is no need to call the intelligent agent, the user input after structured processing is directly used as the input of the large model to infer the final result; S4: If an agent needs to be called, the task requirements are parsed to obtain the functions required to complete the task instructions; S5: taking the acquired functions as input, after matching them with the required function points, constructing the meta-agent, and using the meta-agent to search and match in the vector database to obtain a corresponding agent list; S6: Input the task requirements, the task instructions, the output requirements and the agent list into the result output module to obtain the final prompt word required to complete the task, and use the final prompt word as the input of the large model. After requesting the large model interface, the large model outputs the execution result corresponding to the user's input.
2. The large model application system based on adaptive intelligence according to claim 1 is characterized in that: The body data information at least includes the name, function description and calling path of each intelligent body.
3. The large model application system based on adaptive intelligence according to claim 2 is characterized in that: The name and function description of the agent are vectorized data after semantic vectorization processing.
4. The large model application system based on adaptive intelligence according to claim 3 is characterized in that: The vector database is the milvus vector database, and the model used for vectorization processing is m3e-large.
5. The large model application system based on adaptive intelligence according to claim 1 is characterized in that: The structured processing specifically includes: Process the natural language input by the user to obtain the user's intention and expected results.
Citation Information
Patent Citations
Multi-agent cooperation system and strategy method suitable for industrial digitization
CN117649129A
