[go: up one dir, main page]

CN119828579A - Multi-agent-based automatic processing system and PLC automatic programming system - Google Patents

Multi-agent-based automatic processing system and PLC automatic programming system Download PDF

Info

Publication number
CN119828579A
CN119828579A CN202411706518.7A CN202411706518A CN119828579A CN 119828579 A CN119828579 A CN 119828579A CN 202411706518 A CN202411706518 A CN 202411706518A CN 119828579 A CN119828579 A CN 119828579A
Authority
CN
China
Prior art keywords
agent
working
target
module
agents
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202411706518.7A
Other languages
Chinese (zh)
Inventor
万璁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kyland Technology Co Ltd
Original Assignee
Kyland Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kyland Technology Co Ltd filed Critical Kyland Technology Co Ltd
Priority to CN202411706518.7A priority Critical patent/CN119828579A/en
Publication of CN119828579A publication Critical patent/CN119828579A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses an automatic processing system based on multiple intelligent agents and a PLC automatic programming system, and belongs to the technical field of artificial intelligence. The system comprises a distributing agent and a plurality of working agents, wherein the distributing agent is used for acquiring a problem input by a user, analyzing the problem to determine a target working agent suitable for solving the problem, routing the problem to the target working agent, and the working agent is used for solving the received problem to obtain an answer corresponding to the problem and returning the answer to the distributing agent. According to the application, the multi-agent framework for managing the large model is built, so that the distribution function and the working function of the agents are separated, the modularization of the system is realized, the system can flexibly cope with various application requirements without modifying the whole flow in a large scale, the customization and maintenance cost of the requirements are reduced, and the processing efficiency of an automatic process is improved.

Description

Multi-agent-based automatic processing system and PLC automatic programming system
Technical Field
The application belongs to the technical field of artificial intelligence, and particularly relates to an automatic processing system based on multiple intelligent agents and a PLC automatic programming system.
Background
With the advent of large models (Large Language Model, LLM), the traditional natural language processing field was improved to a new height by virtue of its superior semantic understanding and language generating capabilities. At present, various large IT companies strive to propose large models of themselves, and various applications based on the large models, such as spring bamboo shoots after rain, emerge and iterate rapidly.
In the field of large model application, one technical direction is to develop an application framework taking a large model as a capability base by only utilizing the thinking logic capability and the semantic understanding capability of the large model. In the related art, the application architecture of the large model adopts a single-chain structure, that is, the processing flow of tasks or data is linear, and each link depends on the output of the previous link from one link to the next.
However, as application requirements increase, single-chain constructs may be difficult to extend, as each new requirement may require modification to existing flows, resulting in increased customization and maintenance costs.
Disclosure of Invention
The present application aims to solve at least one of the technical problems existing in the prior art. Therefore, the application provides an automatic processing system and a PLC automatic programming system based on multiple intelligent agents, so that the required customization and maintenance cost is reduced, and the processing efficiency of an automatic process is improved.
In a first aspect, the present application provides an automated processing system based on multiple agents, comprising a distribution agent and a plurality of working agents;
the distribution agent is used for acquiring a problem input by a user, analyzing the problem to determine a target working agent suitable for solving the problem, and routing the problem to the target working agent;
And the working intelligent agent is used for solving the received questions to obtain answers corresponding to the questions, and returning the answers to the distribution intelligent agent.
According to the multi-agent-based automatic processing system, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and as new requirements appear, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole flow in a large scale, the customization and maintenance cost of the requirements is reduced, and the processing efficiency of an automatic process is improved.
According to one embodiment of the application, different working agents correspond to different first functional descriptions;
the analyzing the problem to determine a target working agent suitable for solving the problem comprises:
And comparing the problems with first function descriptions corresponding to the working agents to determine the target working agent.
In this embodiment, by carefully comparing the content of the problem with the functional descriptions of the respective working agents, the system can quickly identify and select the working agent most suitable for solving a particular problem, so that the problem is handled by the working agent having the corresponding expertise and resources, and the success rate of problem solving is also improved.
According to one embodiment of the application, the analyzing the problem to determine a target working agent suitable for solving the problem comprises:
analyzing the problem to split the problem into a plurality of sub-problems;
Target working agents suitable for solving the respective sub-problems are determined separately.
In this embodiment, by splitting the complex problem into multiple sub-problems, the system can more carefully understand the original needs of the user, refine the broad or multidimensional problem into a more specific query, facilitate more accurate matching with the professional field, enable the sub-problems to be solved by the most suitable working agent, and improve the profession and pertinence of the problem processing.
According to one embodiment of the application, the routing the problem to the target working agent comprises:
And under the condition that the answer corresponding to the previous sub-question is obtained, the answer corresponding to the next sub-question and the previous sub-question is routed to the target working agent corresponding to the next sub-question.
In this embodiment, by routing the answer of the previous sub-question as an information context to the corresponding target working agent along with the next sub-question, such continuous information flow ensures consistency of the problem solution, so that the solution of the sub-question can be performed on the basis of the previous step, and a dynamic knowledge accumulation process is constructed, so that the whole problem solution process is more intelligent and efficient.
According to one embodiment of the application, the distribution agent is further configured to:
Analyzing the answer to judge whether the problem is solved, and returning the answer to the user under the condition that the problem is solved.
In the embodiment, the answer is deeply analyzed by the distribution agent, whether the problem is solved or not is judged according to the analysis, the strict monitoring and quality control of the problem solving process are realized, and when the problem is satisfactorily solved, the answer is returned to the user, so that the user satisfaction is improved, and the reliability of the system is enhanced.
According to one embodiment of the application, the distribution agent is further configured to:
in the event that the problem is not addressed, analyzing the problem and the answer to re-determine a target working agent suitable for solving the problem, routing the problem to the re-determined target working agent.
In this embodiment, by analyzing the problem and the existing answers, the distributing agent can identify the cause of the problem not being solved, possibly because the profession of the working agent is not in line or the answer is insufficient, thereby pertinently selecting a more suitable agent for processing, and improving the flexibility and accuracy of the problem solving.
According to one embodiment of the application, the working agent comprises at least one functional module;
the received problem is solved to obtain an answer corresponding to the problem, which comprises the following steps:
and sending the questions to the functional module to obtain answers output by the functional module.
In this embodiment, by integrating at least one functional module within the working agent, the working agent is allowed to perform specialized processing for a specific type of problem, so that the problem can be deeply analyzed and solved in its required specialized field, and the accuracy and efficiency of problem solving are improved.
According to an embodiment of the present application, the sending the question to the functional module to obtain an answer output by the functional module includes:
In the case that the working agent includes a plurality of functional modules, the questions are analyzed to determine a target functional module suitable for solving the questions, and the questions are sent to the target functional module to obtain answers output by the target functional module.
In this embodiment, by integrating a plurality of functional modules within the working agent and intelligently selecting the most appropriate functional module to handle based on the nature of the problem, the problem can be properly directed to modules with corresponding specialized capabilities, resulting in a deeper and accurate solution.
According to one embodiment of the application, different functional modules correspond to different second functional descriptions;
The analyzing the problem to determine a target function module suitable for solving the problem includes:
And comparing the problem with second function descriptions corresponding to the function modules to determine the target function module.
In this embodiment, the capability of the functional module is provided with a clear definition through the second functional description, and by comparing the problem with the second functional descriptions of the respective functional modules, the working agent can quickly and accurately identify the functional module most suitable for solving the problem, so that the problem can be processed by the functional module with the corresponding expertise and resource, and the expertise and accuracy of the problem processing are significantly improved.
According to one embodiment of the application, the problem is related to programming.
In a second aspect, the application provides a PLC automatic programming system based on multiple agents, which comprises a distribution agent and a plurality of working agents, wherein the plurality of working agents comprise working agents related to PLC codes, working agents related to online searching and working agents related to file searching;
the distribution agent is used for acquiring a problem input by a user, analyzing the problem to determine a target working agent suitable for solving the problem, and routing the problem to the target working agent;
And the working intelligent agent is used for solving the received questions to obtain answers corresponding to the questions, and returning the answers to the distribution intelligent agent.
According to the PLC automatic programming system based on the multiple intelligent agents, the distribution function and the working function of the intelligent agents are separated by constructing the multiple intelligent agent framework for managing the large model, the distribution intelligent agents are responsible for the receiving and preliminary analysis of problems, the multiple intelligent agents comprise the intelligent agents related to PLC codes, the intelligent agents related to online searching and the intelligent agents related to file searching, the intelligent agents are focused on the solution of specific problems, the modularization of the system is realized, and as new requirements appear, new intelligent agents can be simply added or the existing intelligent agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole process in a large scale, the customization and maintenance cost of the requirements are reduced, and the processing efficiency of PLC automatic programming is improved.
According to one embodiment of the application, different working agents correspond to different first functional descriptions;
the analyzing the problem to determine a target working agent suitable for solving the problem comprises:
And comparing the problems with first function descriptions corresponding to the working agents to determine the target working agent.
According to one embodiment of the application, the working agent comprises at least one functional module, the functional module of the working agent related to the PLC codes comprises at least one of a PLC code information module, a PLC code generation module, a PLC code checking module and a document retrieval module, the functional module of the working agent related to the online search comprises an online retrieval module, and the functional module of the working agent related to the online search comprises at least one of a document summarization module and a document retrieval module.
According to one embodiment of the application, the PLC code generation module comprises a RAG model, wherein the RAG model comprises a retrieval module and a generation module;
The retrieval module is used for retrieving target information from related example codes, a PLC standard motion library and related documents of the PLC codes according to user input;
and the generation module is used for generating a PLC code according to the user input and the target information.
In the embodiment, the RAG technology enables the large model to have more knowledge to deal with the problems in the specific field by retrieving relevant information from a wide document database without retraining the model, makes up for the short plates with insufficient knowledge of the large model in the professional field, and increases knowledge to the large model by supplementing a large amount of relevant information of the problems, thereby greatly improving the quality of answers.
According to an embodiment of the present application, the solving the received question to obtain an answer corresponding to the question includes:
In the case that the working agent includes a plurality of functional modules, the questions are analyzed to determine a target functional module suitable for solving the questions, and the questions are sent to the target functional module to obtain answers output by the target functional module.
According to one embodiment of the application, different functional modules correspond to different second functional descriptions;
The analyzing the problem to determine a target function module suitable for solving the problem includes:
And comparing the problem with second function descriptions corresponding to the function modules to determine the target function module.
According to one embodiment of the present application, the functional module is further configured to receive the question, retrieve target information associated with the question from a pre-constructed file data set through a RAG technology, input the question and the target information into a large model, and obtain an answer output by the large model.
The above technical solutions in the embodiments of the present application have at least one of the following technical effects:
According to the multi-agent-based automatic processing system, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and as new requirements appear, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole flow in a large scale, the customization and maintenance cost of the requirements is reduced, and the processing efficiency of an automatic process is improved.
Further, in some embodiments, by carefully comparing the content of the problem with the functional descriptions of the individual working agents, the system is able to quickly identify and select the working agent that is most suitable for solving a particular problem, so that the problem is addressed to the working agent with the corresponding expertise and resources, and the success rate of problem resolution is also improved.
Further, in some embodiments, by splitting the complex problem into multiple sub-problems, the system can more carefully understand the original needs of the user, refine the problem in a wide or multi-dimensional manner into a more specific query, facilitate more accurate matching with the professional field, enable the sub-problems to be solved by the most suitable working agent, and improve the profession and pertinence of the problem processing.
Further, in some embodiments, by routing answers to a previous sub-question as an information context to a corresponding target working agent along with a subsequent sub-question, such continuous information flow ensures consistency of the problem resolution, such that the resolution of the sub-question can be performed on a previous step basis, creating a dynamic knowledge accumulation process that makes the overall problem resolution process more intelligent and efficient.
Furthermore, in some embodiments, through the deep analysis of the answer by the distribution agent, and judging whether the problem is solved according to the analysis, the strict monitoring and quality control of the problem solving process are realized, and when the problem is solved satisfactorily, the answer is returned to the user, so that the user satisfaction is improved and the reliability of the system is enhanced.
Further, in some embodiments, by analyzing the questions and existing answers, the distributing agent can identify the cause of the unresolved questions, perhaps because the expertise of the working agent is not compatible or the answer is inadequate, thereby purposefully selecting a more appropriate agent to handle, improving the flexibility and accuracy of the problem resolution.
Still further, in some embodiments, by integrating at least one functional module within the working agent, the working agent is allowed to specialize in dealing with a particular type of problem, so that the problem can be deeply analyzed and solved in the required specialized area, thereby improving the accuracy and efficiency of the problem solution.
Still further, in some embodiments, by integrating multiple functional modules within the working agent and intelligently selecting the most appropriate functional module to handle based on the nature of the problem, the problem can be properly directed to modules with corresponding specialized capabilities, resulting in deeper and accurate solutions.
Still further, in some embodiments, the ability to provide a clear definition of the functional module through the second functional description, and by comparing the problem with the second functional descriptions of the respective functional modules, the working agent can quickly and accurately identify the functional module that is most suitable for solving the problem, thereby enabling the problem to be handled by the functional module with the corresponding expertise and resources, and significantly improving the expertise and accuracy of the problem handling.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a multi-agent based automated processing system provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a multi-agent based PLC automated programming system provided by an embodiment of the present application;
FIG. 3 is a schematic diagram of a data processing procedure of a functional module according to an embodiment of the present application;
FIG. 4 is a schematic flow chart of an automated multi-agent-based processing method according to an embodiment of the present application;
FIG. 5 is a second flow chart of an automated multi-agent-based processing method according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an automated multi-agent-based processing apparatus according to an embodiment of the present application;
FIG. 7 is a schematic diagram of a multi-agent-based automated processing unit according to a second embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions of the embodiments of the present application will be clearly described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which are obtained by a person skilled in the art based on the embodiments of the present application, fall within the scope of protection of the present application.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
At present, in the application field of large models, two main technical directions are that 1, the large models are continuously trained, the model capacity is directly improved, the original capacity of the models is used for completing various scene tasks, 2, the large models are not trained, and only the thinking logic capacity and the semantic understanding capacity of the large models are utilized to develop an application framework taking the large models as capacity bases.
In the 1 st technical direction, since the parameters of the large model are in billions and billions, the training cost is high, which is not bearable by common companies, and as the large model capacity iterates to date, each main stream large model is excellent in thinking logic capacity and semantic understanding capacity and has little difference, the main capacity difference is represented by knowledge depth and breadth, and the difference of the large model can be compensated by the aid of external technology such as retrieval enhancement generation (RETRIEVAL-Augmented Generation, RAG), namely the technical direction 2.
In technical direction 2, the currently mainstream large model application framework includes an open source langchain framework, which provides a set of simple interfaces, and can quickly build large model applications, such as chat with a large model, information inquiry, and the like.
However, the framework has many limitations that the framework only supports some specific large models, but the support for other models is not comprehensive enough, and many interfaces of the framework are specially developed for the customization of the PGT (Prompt-based Generation and Transformation based on the generation and conversion of hints) models, and cannot be directly migrated to other models. The main capability of the framework is represented by the simplicity and rapidity of the single-chain construction, but if the manner in which the single chain is developed is tailored to specific requirements, the maintenance and customization costs will increase as the requirements increase.
The application considers that if a multi-agent framework for managing a large model can be built, the distribution function and the working function of the agents are separated, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of specific problems, the modularization of the system is realized, and as new demands appear, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application demands, and the problems of the prior art that maintenance and customization costs are increased along with the increase of the demands are expected to be solved.
The multi-agent-based automatic processing system and the PLC automatic programming system provided by the embodiment of the application are described in detail below through specific embodiments and application scenes thereof with reference to the accompanying drawings.
As shown in fig. 1, a multi-agent based automated processing system may include a distribution agent and a plurality of working agents.
In the embodiment of the application, an Agent (Agent) is a system capable of sensing its environment and making decisions based on the sensed information to achieve a specific goal. In the field of artificial intelligence, an agent may be any form of software or hardware.
In an embodiment of the application, the distribution agent may be used to obtain a user-entered question, analyze the question to determine a target work agent suitable for solving the question, and route the question to the target work agent.
In some embodiments, the back engine that distributes the agents may be a large model that functions not only as simple data processing, but through its powerful understanding and analysis capabilities, in-depth analysis of the user input questions. The analysis process involves semantic understanding of the problem, contextual relevance, and possibly intent recognition. The large model can identify key elements of the problem through advanced natural language processing capability of the large model, and can be matched with the existing knowledge and information base, so that the working agent most suitable for solving the problem is determined. This process can be seen as an intelligent routing mechanism, where a large model acts as the "brain" of the distributing agent, responsible for assigning questions to the most appropriate working agent. Such allocation is not only based on the surface text of the problem, but may also take into account the complexity, expertise, and historical processing data of the problem so that the problem can be most effectively handled.
For example, if a user's problem relates to a problem with the automated programming of a programmable logic controller (Programmable Logic Controller, PLC), the large model may identify terms and concepts related to the PLC programming and assign the problem to the working agent related to the PLC programming. If the problem requires information from the internet, the large model will forward the problem to the working agent associated with the online search. For problems that require retrieval of a particular file or document, the large model may assign tasks to the working agents associated with the file retrieval.
In some embodiments, the distribution agent may also classify the problem by keyword recognition, topic modeling, or predefined classification rules, categorize the problem into one or more related fields or topics, may also identify key entities in the problem, such as names of people, places, times, proper nouns, etc., may also identify the intent of the problem using natural language processing techniques, obtain targets or needs behind the user's question, such as seeking information, solving the problem, or performing tasks, may also analyze contextual information in the problem to determine a particular context of the problem, including historical interactions of the user, current environmental status, or other related information, etc. And then matching the capability of each working agent according to the analysis result of the problems. Wherein, different working agents can have specific functions or field characteristics, and the analysis result is matched with the capability of each working agent, so that the working agent which is most suitable for processing the problem is found. For example, the distributing agent may acquire function or domain feature information corresponding to each of the working agents, and then determine the working agent with the highest degree of matching as the working agent most suitable for handling the problem by matching the analysis result with the function or domain feature information.
Of course, in some embodiments, the distributing agent may also consider the current loading situation of each agent and select a working agent that is both effective in handling the problem and not overloaded.
In an embodiment of the application, a multi-agent based automated processing system includes a plurality of working agents. And under the condition that the working intelligent agent receives the questions, the working intelligent agent solves the questions to obtain answers corresponding to the questions, and returns the answers to the distribution intelligent agent.
In some embodiments, the back engine of the working agent may also be a large model, each working agent may have a large model optimized specifically for a particular domain or task, so that the distribution large model may use the appropriate working agent to handle the problem according to different problem types and complexities, thereby improving the accuracy and efficiency of the solution. For example, if a working agent is responsible for processing scientific questions, a large model behind the working agent may be trained to understand and answer professional questions in the scientific field, including but not limited to physics, chemistry, biology, etc., which may contain a large body of scientific literature, experimental data, and theoretical frameworks, thereby enabling deep and accurate scientific solutions.
If a working agent is focused on handling technical problems, such as programming or software engineering related problems, a large model behind the working agent, which can contain a large number of codebooks, technical documents and best practices, can be trained to understand and answer problems in the areas of programming language, software development processes, algorithm optimization, etc., enabling it to provide specialized technical solutions.
The large models used by the working agents and the distribution agents may be different, with the distribution agents being more focused on understanding and classifying the problem and the working agents being more focused on in-depth solutions in particular areas. The working agent can call the big model behind the working agent to answer the question, and the corresponding answer is obtained. Such calls may be in real-time or may be based on preset rules and logic. In some cases, the distributing agent may split the question and distribute the split question to different working agents, respectively, to integrate knowledge of multiple domains to provide a comprehensive answer. The multi-model cooperation mechanism enables the whole system to be more flexible and powerful, and can handle more complex and diversified problems.
In some embodiments, the process of the working agent in solving the problem may include performing deep analysis on the problem, such as semantic understanding, intention recognition, and key information extraction on the problem, according to the content of the problem, the working agent accesses a built-in knowledge base or an external data source thereof, retrieves related information, and uses the retrieved related information and built-in logic reasoning capability, such as a problem solving algorithm, a decision tree, a rule engine, and the like, the working agent may generate an answer to the problem. After generating the answer, the working agent may need to verify the accuracy and relevance of the answer, for example, through an internal verification mechanism or consistency check with a knowledge base. Of course, the working agent can optimize the answer according to the requirements and the context of the user, so as to meet the actual requirements of the user.
In some embodiments, the multi-agent based automated processing system may adapt to different large models, and the engine that distributes the agents and the working agents may be different large models. For example, custom langchain interface classes can be developed to meet the access formats of different large models, or large model interfaces can be packaged in call classes supported by langchain to enable adaptation of various large models. The large models can be domestic large models, such as Kimi, a religion, a meaning thousand questions and the like, or foreign large models, such as GPT (GENERATIVE PRE-trained Transformer), paLM (Pathways Language Model) and the like, and the embodiment of the application is not limited to the domestic large models.
In some embodiments, the multi-agent based automated processing system may be applied to any scenario, such as a programmable logic controller (Programmable Logic Controller, PLC) automated programming scenario, a medical consultation and diagnosis assistance scenario, a data analysis and report generation scenario, a traffic and navigation scenario, etc., or other scenarios.
The problems input by the user can be different for different application scenes, for example, in the PLC automatic programming scene, the problems of the user are related to programming, for example, the problems can be 'generating a demand code', 'inquiring code related information', and the like, so that the function related to the automatic generation of the PLC code is realized. Of course, for other application scenarios, problems are associated with those application scenarios as well.
According to the multi-agent-based automatic processing system, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and as new requirements appear, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole flow in a large scale, the customization and maintenance cost of the requirements is reduced, and the processing efficiency of an automatic process is improved.
In some embodiments, different working agents correspond to different first function descriptions;
analyzing the problem to determine a target working agent suitable for solving the problem, comprising:
and comparing the problems with the first function descriptions corresponding to the working agents to determine the target working agent.
In this embodiment, the first function description is an explanation of the functions or capabilities of the working agents, and different working agents correspond to different first function description information, for example, the description information of the working agents may be "provide real-time weather information and forecast", "provide multilingual translation service", etc.
In one example, as shown in fig. 2, in a programmable logic controller (Programmable Logic Controller, PLC) automated programming scenario, PLC code-related work agents, online search-related work agents, and file retrieval-related work agents may be included.
The working agent associated with the PLC code is focused on answering questions related to PLC programming and code generation. The back engine of the working agent can be a large model, such as ChatGPT, which can be trained in advance to understand and execute specific grammars and logic of the PLC programming language, so that the PLC code can be generated or optimized quickly according to the complex PLC programming requirements described by the natural language, the possibility of the PLC coding error can be reduced, and the development speed can be increased. Accordingly, the first function description information corresponding to the PLC code-related working agent may be "an assistant focusing on the PLC code-related task" according to the function of the PLC code-related working agent.
The back engine of the online search related working agent may be based on AGENTIC RAG (RETRIEVAL-Augmented Generation, search enhancement generation) large models that may be equipped with a series of tools, which are software components or services associated with a particular document or data source, that are capable of retrieving, processing, and generating information from the respective data source, such as language segmentation tools, information synthesis tools, web search tools, and the like. The large model is capable of receiving user queries and determining appropriate course of action, coordinating the different tools, and together accomplishing an efficient task, such as retrieving, processing, and generating information from multiple data sources. Accordingly, according to the functions of the online search related working agent, the first function description information corresponding to the online search related working agent may be "an assistant focusing on the online search task"
The back engine of the file retrieval related working agent may be a large model similar to MRKL architecture, and the file retrieval related working agent may integrate the large model with external tools to solve complex problems, including building modules and routers, and routing natural language queries. The working intelligent agent can store and recall information, simulate short-term and long-term memory of human beings to support multi-round dialogue and task completion, and can quickly access user characteristics and service data stored in a database to realize efficient file retrieval and information provision. Accordingly, according to the function of the document retrieval related working agent, the first function description information corresponding to the document retrieval related working agent may be "an assistant focusing on document retrieval related".
The first function descriptions corresponding to the working agents may be stored in a database in advance in association, and after receiving the questions input by the user, the distributing agents may call the data in the database to compare the questions with the first function descriptions corresponding to the respective working agents, thereby determining the target working agent. Or after receiving the user input, the distributing agent obtains the corresponding first function description from each working agent.
In some embodiments, the distributing agent may also input the questions and the first function descriptions corresponding to the respective working agents into a large model through which the questions are analyzed to determine target working agents suitable for solving the questions.
In some embodiments, the distributing agent may extract keywords of the problem, match the keywords with the first function descriptions corresponding to the respective working agents, or calculate semantic similarity, for example, the similarity or the matching degree between the problem keywords and the respective first function descriptions may be evaluated by cosine similarity, jaccard similarity. And taking the working agent corresponding to the first function description with the highest matching degree as a target working agent.
Of course, in calculating the similarity or matching degree, weights may be assigned to different keywords to reflect the importance of the keywords in determining the target working agent. The weights may be determined based on factors such as the complexity of the problem, the expertise of the agent, and the like. According to the matching degree and the weight, calculating a comprehensive score for each working agent to measure the capacity of solving the problem, and selecting the working agent with the highest comprehensive score as the target working agent.
In this embodiment, by carefully comparing the content of the problem with the functional descriptions of the respective working agents, the system can quickly identify and select the working agent most suitable for solving a particular problem, so that the problem is handled by the working agent having the corresponding expertise and resources, and the success rate of problem solving is also improved.
In some embodiments, analyzing the problem to determine a target working agent suitable for solving the problem includes:
analyzing the problem to split the problem into a plurality of sub-problems;
Target working agents suitable for solving the respective sub-problems are determined separately.
In this embodiment, for some complex problems, distributing agents requires splitting the problem into multiple sub-problems, and then determining an appropriate working agent for each sub-problem.
For example, a user presents a problem related to travel planning in that "I plan for Italian travel the next month, need to know visa requirements, local weather, travel budget, and cultural custom. After the distribution agent analyzes the problem, the problem can be split into four sub-problems, namely visa requirements, local weather, travel budget and cultural custom. And then comparing each sub-problem with the first function description corresponding to each working agent to determine the target working agent corresponding to each sub-problem. For example, for visa requirements, the corresponding target work agent may be determined to be the work agent providing visa information, for local weather, the corresponding target work agent may be determined to be the work agent providing real-time and predictive weather information, for travel budgets, the corresponding target work agent may be determined to be the work agent providing financial planning and budgeting advice, and for cultural custom, the corresponding target work agent may be determined to be the work agent providing cultural and custom information.
In this embodiment, by splitting the complex problem into multiple sub-problems, the system can more carefully understand the original needs of the user, refine the broad or multidimensional problem into a more specific query, facilitate more accurate matching with the professional field, enable the sub-problems to be solved by the most suitable working agent, and improve the profession and pertinence of the problem processing.
In some embodiments, routing the problem to the target work agent includes:
And under the condition that the answer corresponding to the previous sub-question is obtained, the answer corresponding to the next sub-question and the previous sub-question is routed to the target working agent corresponding to the next sub-question.
In this embodiment, for some complex questions, after splitting the question into multiple sub-questions, the answers to some of the sub-questions need to rely on the answers to other sub-questions. For example, the problem posed by the user is that "please refer to the relevant code standard document first and then generate the demand code in combination with the document content", and after the distributing agent analyzes the problem, the problem can be split into two sub-problems, namely, refer to the relevant code standard document and generate the demand code in combination with the referred document content.
As shown in fig. 2, it may be determined that the target working agent corresponding to the reference code standard document is the working agent related to file retrieval, and the target working agent corresponding to the demand code generated in combination with the reference document content is the working agent related to the PLC code. The distributing agent can firstly route the reference related code standard document to the working agent related to file retrieval to obtain an answer returned by the working agent related to file retrieval, and then route the answer and the reference document content combined to generate a demand code to the working agent related to the PLC code together to obtain a final result fed back by the working agent related to the PLC code.
In this embodiment, by routing the answer of the previous sub-question as an information context to the corresponding target working agent along with the next sub-question, such continuous information flow ensures consistency of the problem solution, so that the solution of the sub-question can be performed on the basis of the previous step, and a dynamic knowledge accumulation process is constructed, so that the whole problem solution process is more intelligent and efficient.
In some embodiments, the distribution agent is further to:
Analyzing the answer to judge whether the problem is solved, and returning the answer to the user under the condition that the problem is solved.
In this embodiment, the distributing agent is not only responsible for routing and coordination in the process of solving the problem, but also plays the role of analyzing and judging the solution so as to improve the accuracy of solving the problem.
In particular, the distributing agent may check whether the answer contains all necessary information required for the question, for example, if the user asks about the method of use of a certain product, the answer should include every step of use of the product. The information in the answer may also be verified to ensure that it is correct, for example, by comparison with a reliable data source or by verification using a built-in knowledge base. It is also possible to check whether the information in the answer is logically consistent or includes a place of paradox. Of course, the intent of the user's question can be analyzed by natural language processing techniques and whether the answer satisfies the intent can be determined, and the distribution agent can also input the question and the answer into a large model, and determine whether the question is resolved by the large model. The manner how the distributing agent can judge whether the problem is solved is not limited in the embodiment of the application.
In the embodiment, the answer is deeply analyzed by the distribution agent, whether the problem is solved or not is judged according to the analysis, the strict monitoring and quality control of the problem solving process are realized, and when the problem is satisfactorily solved, the answer is returned to the user, so that the user satisfaction is improved, and the reliability of the system is enhanced.
In some embodiments, the distribution agent is further to:
in the event that the problem is not addressed, the problem and the answer are analyzed to redefine the target work agent suitable for solving the problem, and the problem is routed to the redefined target work agent.
In this embodiment, in the case where the problem is not solved, it may be that the selected target working agent is not appropriate, the distributing agent may analyze the problem and the answer, and determine a specific aspect of the problem not being solved, and redetermine the target working agent corresponding to the problem according to the analysis result.
For example, assume that the user's question is "how to plant organic tomatoes at home. The distribution agent can evaluate whether the answer is comprehensive, including steps specific to organic planting, such as using natural fertilizers, etc. If the answer is not comprehensive enough, the distributing agent may consider the problem to be unresolved. For example, distributing an agent to analyze the "organic" keyword in a question, considering that the first answer is not described for "organic", may decide to re-route the question to a working agent focusing on organic agriculture.
In this embodiment, by analyzing the problem and the existing answers, the distributing agent can identify the cause of the problem not being solved, possibly because the profession of the working agent is not in line or the answer is insufficient, thereby pertinently selecting a more suitable agent for processing, and improving the flexibility and accuracy of the problem solving.
In some embodiments, the working agent comprises at least one functional module;
solving the received problem to obtain an answer corresponding to the problem, including:
And sending the questions to the functional module to obtain answers output by the functional module.
In this embodiment, the working agent may include one or more functional modules, with different functional modules being responsible for handling a particular type of task or problem. When a problem is received by the working agent, the problem can be sent to a corresponding functional module for processing according to the type and the content of the problem.
As shown in FIG. 2, the function modules of the working agent related to the PLC codes can comprise a PLC code information module, a PLC code generation module, a PLC code checking module and a document retrieval module, the function modules of the working agent related to the online search can comprise an online retrieval module, and the function modules of the working agent related to the file search can comprise a document summarization module and a document retrieval module.
In this embodiment, the PLC code information module is responsible for storing and providing information related to PLC programming, such as instruction sets, programming specifications, error codes, etc., to provide references and assistance in the programming process. For example, a user needs to write a PLC program for controlling the start and stop of the motor, and after the PLC code information module obtains the user's requirement, the PLC code information module can provide an instruction set and a programming specification of a specific PLC model, and how to control the motor using a specific input/output module.
The PLC code generation module can adopt a similar Simulink-PLC code generation technology, and can use PLCcoder tool boxes to configure IDE, code storage positions and variable storage positions of code application by establishing a controller model and defining an input-output interface and internal variables, so as to finally generate the PLC code. For example, a user designs a control flow chart, and needs to convert the control flow chart into a PLC code, and after the PLC code generation module obtains the flow chart and related parameters input by the user, the corresponding ladder logic and the PLC code can be generated.
The PLC code checking module is responsible for checking whether the generated PLC code accords with programming standards and logic or not, and ensuring the correctness and safety of the code. For example, a user has written a piece of PLC code, needs to confirm whether there are syntax errors and logic errors, submits the code to a PLC code verification module, which analyzes the code and indicates potential problems, such as undefined tags or logic conflicts.
The document retrieval module is used for retrieving and accessing the module for storing the PLC project documents and related technical materials so as to quickly find out the required documents in the programming and maintenance process. For example, during debugging, a user encounters an error code and can query using a document retrieval module that can retrieve an internal or external document library based on the user's query to provide relevant technical documents and solutions.
The online retrieval module is responsible for retrieving relevant information from the internet to answer the user's query. The online search module can collect real-time information by utilizing a network search engine, so that the capability of the system for processing dynamic query is improved. For example, users need to know the latest PLC technology trend, and the online search module can collect the latest industry news, technical articles and forum discussions through the web search engine to provide a comprehensive information overview.
The document summarization module may be an AI (ARTIFICIAL INTELLIGENCE ) like PDF summarization tool that can summarize long PDF, word, or other formatted files, provide a user with a summary of content using an accurate text recognition function, and allow the user to ask specific questions through chat. For example, the user needs to quickly learn about a technical document of a large project, and after uploading the technical document, the document summarization module can analyze the document content and extract key information and abstracts so that the user quickly grasps the core content of the document.
The document retrieval module may be used to retrieve and access stored project documents and related technical material in order to quickly find a desired document when needed. For example, the user may need to review past project cases, and the document retrieval module may retrieve relevant documents from a document library based on keywords or attributes provided by the user and provide the documents to the user.
When the working agent receives the questions, the questions can be sent to the functional modules to obtain answers output by the functional modules.
Taking the problem of processing a PLC code information module in a working intelligent agent related to the PLC code as an example, the problem input by a user is "carrying out functional description on the input code", and the PLC code information module can call a large model to process the problem of the user so as to obtain an answer output by the large model. Of course, in the PLC automation programming scenario, since the PLC code is a code with strong specificity in the industrial field, specific application area and complex grammar, each large industrial manufacturer regards the PLC code developed by itself as privacy, and almost no code with open source and reference value is visible in the market, which directly results in a programming language with far less capability of the large model in the PLC code generation field. Thus, it is far from sufficient if code satisfying an industrial scenario is generated solely by means of the native capabilities of a large model.
In some embodiments, the PLC code generation module comprises a RAG model, wherein the RAG model comprises a retrieval module and a generation module;
the retrieval module is used for retrieving target information from related example codes, a PLC standard motion library and related documents of the PLC codes according to user input;
And the generation module is used for generating a PLC code according to the user input and the target information.
In this embodiment, as shown in fig. 3, the target information related to the question, such as a related code, a related grammar standard, a related standard library, etc., may be retrieved in a file dataset constructed using a retrieval enhancement generation (RETRIEVAL-Augmented Generation, RAG) technique, and then the retrieved target information is fed as input to a large model along with the question input by the user, including the question (template), and the large model generates an answer in combination with the retrieved related information.
In this embodiment, the RAG is a model architecture that combines information retrieval and text generation, aimed at enhancing the effect of natural language processing tasks. The RAG model is typically composed of two main components, a retrieval module that uses information retrieval techniques, such as conventional search algorithms, or modern neural network-based retrieval techniques, etc., to find documents or segments from a large document library that are relevant to the input query, and a generation module that generates a natural language response from the large model based on the retrieved information.
As shown in fig. 3, the user input may be a prompt or question, for example, the user entered a question or requirement regarding PLC programming. The input may be formatted or pre-processed so that the model can be better understood and processed. In fig. 3, the retrieval module of the RAG model may include related example codes, PLC standard motion libraries, and PLC code related documents. The related example codes can comprise a pre-constructed code library or database, the example PLC codes related to the user input can be retrieved from the related example codes, the standardized programming modes, function blocks or logic structures and the like can be stored in the PLC standard motion library, the standardized programming modes, function blocks or logic structures and the like related to the user input can be retrieved from the PLC standard motion library, the technical documents or reference materials related to the PLC programming can be stored in the PLC code related documents, and more accurate code generation can be provided by retrieving the PLC code related documents. And generating corresponding PLC codes by combining the retrieved related information and user input.
In the embodiment, the RAG technology enables the large model to have more knowledge to deal with the problems in the specific field by retrieving relevant information from a wide document database without retraining the model, makes up for the short plates with insufficient knowledge of the large model in the professional field, and increases knowledge to the large model by supplementing a large amount of relevant information of the problems, thereby greatly improving the quality of answers.
In the embodiment, at least one functional module is integrated inside the working intelligent agent, so that the working intelligent agent is allowed to perform specialized processing on a specific type of problem, the problem can be deeply analyzed and solved in the required specialized field, and the accuracy and efficiency of problem solving are improved.
In some embodiments, the sending the questions to the functional module to obtain answers output by the functional module includes:
in the case where the working agent includes a plurality of functional modules, the questions are analyzed to determine a target functional module suitable for solving the questions, and the questions are sent to the target functional module to obtain answers output by the target functional module.
In this embodiment, the working agent may analyze a problem inputted by a user through a large model, and then determine a functional module most suitable for solving the problem according to the analysis result.
In this embodiment, by integrating a plurality of functional modules within the working agent and intelligently selecting the most appropriate functional module to handle based on the nature of the problem, the problem can be properly directed to modules with corresponding specialized capabilities, resulting in a deeper and accurate solution.
In some embodiments, different functional modules correspond to different second functional descriptions;
analyzing the problem to determine a target functional module suitable for solving the problem, comprising:
and comparing the problems with the second function descriptions corresponding to the functional modules to determine the target functional module.
In this embodiment, the second function description is an explanation of functions or capabilities possessed by the functional modules, and different functional modules may be corresponded to different second function description information, for example, the description information of the functional modules may be "PLC code generation related module", "module for summarizing documents", or the like.
The second function descriptions corresponding to the function modules can be stored in a database in a pre-associated mode, and after the problem is received, the working agent can call the data in the database to compare the problem with the second function descriptions corresponding to the function modules, so that the target working module is determined. Or after receiving the problem, the working intelligent agent acquires the corresponding second function description from each function module.
In some embodiments, the working agent may also input the questions and the second function descriptions corresponding to the respective function modules into a large model from which the questions are analyzed to determine a target function module suitable for solving the questions.
In some embodiments, the working agent may extract keywords of the problem, match the keywords with the second function descriptions corresponding to the respective function modules, or calculate semantic similarity, for example, the similarity or the matching degree between the keywords of the problem and the respective second function descriptions may be evaluated by cosine similarity, jaccard similarity. And taking the function module corresponding to the second function description with the highest matching degree as a target function module.
Of course, in the process of calculating the similarity or the matching degree, weights may be allocated to different keywords to reflect the importance of the keywords in determining the target functional module. The weights may be determined based on factors such as the complexity of the problem, the expertise of the agent, and the like. And calculating a comprehensive score for each functional module according to the matching degree and the weight so as to measure the capacity of solving the problem, and selecting the functional module with the highest comprehensive score as a target functional module.
In this embodiment, the capability of the functional module is provided with a clear definition through the second functional description, and by comparing the problem with the second functional descriptions of the respective functional modules, the working agent can quickly and accurately identify the functional module most suitable for solving the problem, so that the problem can be processed by the functional module with the corresponding expertise and resource, and the expertise and accuracy of the problem processing are significantly improved.
The embodiment of the application also provides a PLC automatic programming system based on multiple agents, as shown in fig. 1 and 2, the PLC automatic programming system based on multiple agents can comprise a distribution agent and a plurality of working agents, wherein the plurality of working agents comprise working agents relevant to PLC codes, working agents relevant to online searching and working agents relevant to file searching;
Distributing agents for obtaining the questions entered by the user, analyzing the questions to determine a target work agent suitable for solving the questions, and routing the questions to the target work agent;
And the working intelligent body is used for solving the received questions to obtain answers corresponding to the questions, and returning the answers to the distribution intelligent body.
The back engine that distributes the agent may be a large model by which the problem entered by the user is analyzed and then the working agent that is most suitable for solving the problem is determined based on the analysis results. For example, if the problem inputted by the user is "generate demand code", it can be determined that the working agent most suitable for solving the problem is the working agent related to the PLC code.
In some embodiments, the back engine of the working agent may also be a large model, and the large model used by the working agent and the distribution agent may be different large models. The working agent may invoke a large model to solve the problem, resulting in a corresponding answer. If the work agent associated with the PLC code receives the problem "generate demand code" sent by the distribution agent, a large model may be invoked to generate the PLC code.
In some embodiments, the multi-agent based automated processing system may adapt to different large models, and the engine that distributes the agents and the working agents may be different large models. For example, custom langchain interface classes can be developed to meet the access formats of different large models, or large model interfaces can be packaged in call classes supported by langchain to enable adaptation of various large models. The large models can be domestic large models, such as Kimi, a religion, a meaning thousand questions and the like, or foreign large models, such as GPT (GENERATIVE PRE-trained Transformer), paLM (Pathways Language Model) and the like, and the embodiment of the application is not limited to the domestic large models.
According to the PLC automatic programming system based on the multiple intelligent agents, the distribution function and the working function of the intelligent agents are separated by constructing the multiple intelligent agent framework for managing the large model, the distribution intelligent agents are responsible for the receiving and preliminary analysis of problems, the multiple intelligent agents comprise the intelligent agents related to PLC codes, the intelligent agents related to online searching and the intelligent agents related to file searching, the intelligent agents are focused on the solution of specific problems, the modularization of the system is realized, and as new requirements appear, new intelligent agents can be simply added or the existing intelligent agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole process in a large scale, the customization and maintenance cost of the requirements are reduced, and the processing efficiency of PLC automatic programming is improved.
In some embodiments, different working agents correspond to different first function descriptions;
analyzing the problem to determine a target working agent suitable for solving the problem, comprising:
and comparing the problems with the first function descriptions corresponding to the working agents to determine the target working agent.
In this embodiment, the first function description is an explanation of a function or capability possessed by the working agent, and different working agents correspond to different first function description information. As shown in fig. 2, the first function description information corresponding to the working agent related to the PLC code may be "an assistant focusing on the task related to the PLC code", the first function description information corresponding to the working agent related to the online search may be "an assistant focusing on the task related to the online search", and the first function description information corresponding to the working agent related to the file search may be "an assistant focusing on the document search".
The first function descriptions corresponding to the working agents may be stored in a database in advance in association, and after receiving the questions input by the user, the distributing agents may call the data in the database to compare the questions with the first function descriptions corresponding to the respective working agents, thereby determining the target working agent. Or after receiving the user input, the distributing agent obtains the corresponding first function description from each working agent.
In some embodiments, the distributing agent may also input the questions and the first function descriptions corresponding to the respective working agents into a large model through which the questions are analyzed to determine target working agents suitable for solving the questions.
In this embodiment, by carefully comparing the content of the problem with the functional descriptions of the respective working agents, the system can quickly identify and select the working agent most suitable for solving a particular problem, so that the problem is handled by the working agent having the corresponding expertise and resources, and the success rate of problem solving is also improved.
In some embodiments, the work agent comprises at least one functional module, the functional module of the work agent related to the PLC code comprises at least one of a PLC code information module, a PLC code generation module, a PLC code check module and a document retrieval module, the functional module of the work agent related to the online search comprises an online retrieval module, and the functional module of the work agent related to the member search comprises at least one of a document summarization module and a document retrieval module.
In this embodiment, the working agent may include one or more functional modules, with different functional modules being responsible for handling a particular type of task or problem. When a problem is received by the working agent, the problem can be sent to a corresponding functional module for processing according to the type and the content of the problem.
As shown in FIG. 2, the function modules of the working agent related to the PLC codes can comprise a PLC code information module, a PLC code generation module, a PLC code checking module and a document retrieval module, the function modules of the working agent related to the online search can comprise an online retrieval module, and the function modules of the working agent related to the file search can comprise a document summarization module and a document retrieval module.
In this embodiment, the PLC code information module is responsible for storing and providing information related to PLC programming, such as instruction sets, programming specifications, error codes, etc., to provide references and assistance in the programming process. For example, a user needs to write a PLC program for controlling the start and stop of the motor, and after the PLC code information module obtains the user's requirement, the PLC code information module can provide an instruction set and a programming specification of a specific PLC model, and how to control the motor using a specific input/output module.
The PLC code generation module can adopt a similar Simulink-PLC code generation technology, and can use PLCcoder tool boxes to configure IDE, code storage positions and variable storage positions of code application by establishing a controller model and defining an input-output interface and internal variables, so as to finally generate the PLC code. For example, a user designs a control flow chart, and needs to convert the control flow chart into a PLC code, and after the PLC code generation module obtains the flow chart and related parameters input by the user, the corresponding ladder logic and the PLC code can be generated.
The PLC code checking module is responsible for checking whether the generated PLC code accords with programming standards and logic or not, and ensuring the correctness and safety of the code. For example, a user has written a piece of PLC code, needs to confirm whether there are syntax errors and logic errors, submits the code to a PLC code verification module, which analyzes the code and indicates potential problems, such as undefined tags or logic conflicts.
The document retrieval module is used for retrieving and accessing the module for storing the PLC project documents and related technical materials so as to quickly find out the required documents in the programming and maintenance process. For example, during debugging, a user encounters an error code and can query using a document retrieval module that can retrieve an internal or external document library based on the user's query to provide relevant technical documents and solutions.
The online retrieval module is responsible for retrieving relevant information from the internet to answer the user's query. The online search module can collect real-time information by utilizing a network search engine, so that the capability of the system for processing dynamic query is improved. For example, users need to know the latest PLC technology trend, and the online search module can collect the latest industry news, technical articles and forum discussions through the web search engine to provide a comprehensive information overview.
The document summarization module may be an AI (ARTIFICIAL INTELLIGENCE ) like PDF summarization tool that can summarize long PDF, word, or other formatted files, provide a user with a summary of content using an accurate text recognition function, and allow the user to ask specific questions through chat. For example, the user needs to quickly learn about a technical document of a large project, and after uploading the technical document, the document summarization module can analyze the document content and extract key information and abstracts so that the user quickly grasps the core content of the document.
The document retrieval module may be used to retrieve and access stored project documents and related technical material in order to quickly find a desired document when needed. For example, the user may need to review past project cases, and the document retrieval module may retrieve relevant documents from a document library based on keywords or attributes provided by the user and provide the documents to the user.
When the working agent receives the questions, the questions can be sent to the functional modules to obtain answers output by the functional modules.
In the embodiment, at least one functional module is integrated inside the working intelligent agent, so that the working intelligent agent is allowed to perform specialized processing on a specific type of problem, the problem can be deeply analyzed and solved in the required specialized field, and the accuracy and efficiency of problem solving are improved.
In some embodiments, the solving the received question to obtain an answer corresponding to the question includes:
in the case where the working agent includes a plurality of functional modules, the questions are analyzed to determine a target functional module suitable for solving the questions, and the questions are sent to the target functional module to obtain answers output by the target functional module.
In this embodiment, the working agent may analyze a problem inputted by a user through a large model, and then determine a functional module most suitable for solving the problem according to the analysis result.
In this embodiment, by integrating a plurality of functional modules within the working agent and intelligently selecting the most appropriate functional module to handle based on the nature of the problem, the problem can be properly directed to modules with corresponding specialized capabilities, resulting in a deeper and accurate solution.
In some embodiments, different functional modules correspond to different second functional descriptions;
analyzing the problem to determine a target functional module suitable for solving the problem, comprising:
and comparing the problems with the second function descriptions corresponding to the functional modules to determine the target functional module.
In this embodiment, the second function description is an explanation of functions or capabilities possessed by the functional modules, and different functional modules may be corresponded to different second function description information, for example, the description information of the functional modules may be "PLC code generation related module", "module for summarizing documents", or the like.
The second function descriptions corresponding to the function modules can be stored in a database in a pre-associated mode, and after the problem is received, the working agent can call the data in the database to compare the problem with the second function descriptions corresponding to the function modules, so that the target working module is determined. Or after receiving the problem, the working intelligent agent acquires the corresponding second function description from each function module.
In some embodiments, the working agent may also input the questions and the second function descriptions corresponding to the respective function modules into a large model from which the questions are analyzed to determine a target function module suitable for solving the questions.
In this embodiment, the capability of the functional module is provided with a clear definition through the second functional description, and by comparing the problem with the second functional descriptions of the respective functional modules, the working agent can quickly and accurately identify the functional module most suitable for solving the problem, so that the problem can be processed by the functional module with the corresponding expertise and resource, and the expertise and accuracy of the problem processing are significantly improved.
In some embodiments, the functional module is further configured to receive a question, retrieve target information associated with the question from a pre-constructed file dataset through a RAG technique, input the question and the target information into a large model, and obtain an answer output by the large model.
In some embodiments, the PLC code generation module comprises a RAG model, wherein the RAG model comprises a retrieval module and a generation module;
the retrieval module is used for retrieving target information from related example codes, a PLC standard motion library and related documents of the PLC codes according to user input;
And the generation module is used for generating a PLC code according to the user input and the target information.
In this embodiment, when the working agent receives the question, the question may be sent to the functional module, and an answer output by the functional module may be obtained. Specifically, as shown in fig. 3, the target information related to the question, such as a related code, a related grammar standard, a related standard library, etc., may be searched in a file dataset constructed by using a search enhancement generation (RETRIEVAL-Augmented Generation, RAG) technology, and then the searched target information is fed to a large model together with the question input by the user, including the question (template), as input, and the large model generates an answer in combination with the searched related information.
In this embodiment, the RAG is a model architecture that combines information retrieval and text generation, aimed at enhancing the effect of natural language processing tasks. The RAG model is typically composed of two main components, a retrieval module that uses information retrieval techniques, such as conventional search algorithms, or modern neural network-based retrieval techniques, etc., to find documents or segments from a large document library that are relevant to the input query, and a generation module that generates a natural language response from the large model based on the retrieved information.
As shown in fig. 3, the user input may be a prompt or question, for example, the user entered a question or requirement regarding PLC programming. The input may be formatted or pre-processed so that the model can be better understood and processed. In fig. 3, the retrieval module of the RAG model may include related example codes, PLC standard motion libraries, and PLC code related documents. The related example codes can comprise a pre-constructed code library or database, the example PLC codes related to the user input can be retrieved from the related example codes, the standardized programming modes, function blocks or logic structures and the like can be stored in the PLC standard motion library, the standardized programming modes, function blocks or logic structures and the like related to the user input can be retrieved from the PLC standard motion library, the technical documents or reference materials related to the PLC programming can be stored in the PLC code related documents, and more accurate code generation can be provided by retrieving the PLC code related documents. And generating corresponding PLC codes by combining the retrieved related information and user input.
In the embodiment, the RAG technology enables the large model to have more knowledge to deal with the problems in the specific field by retrieving relevant information from a wide document database without retraining the model, makes up for the short plates with insufficient knowledge of the large model in the professional field, and increases knowledge to the large model by supplementing a large amount of relevant information of the problems, thereby greatly improving the quality of answers.
The embodiment of the application also provides an automatic processing method based on the multi-agent. The multi-agent-based automatic processing method can be applied to a terminal, and can be specifically executed by hardware or software in the terminal.
The terminal includes, but is not limited to, a portable communication device such as a mobile phone or tablet having a touch sensitive surface (e.g., a touch screen display and/or a touch pad). It should also be appreciated that in some embodiments, the terminal may not be a portable communication device, but rather a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or a touch pad).
In the following various embodiments, a terminal including a display and a touch sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and joystick.
The execution subject of the multi-agent-based automatic processing method provided by the embodiment of the application can be electronic equipment or functional modules or functional entities in the electronic equipment which can realize the multi-agent-based automatic processing method, the electronic device in the embodiment of the application includes, but is not limited to, a tablet computer, a distributing agent, a working agent, and the like, and the automated processing method based on multiple agents provided in the embodiment of the application is described below by taking the distributing agent as an execution body as an example.
As shown in fig. 4, the multi-agent based automated processing method includes steps 410, 420, and 430.
Step 410, obtaining a problem input by a user;
step 420, analyzing the problem to determine a target working agent suitable for solving the problem
Step 430, routing the questions to the target working agent, so that the target working agent can solve the questions to obtain answers corresponding to the questions.
According to the multi-agent-based automatic processing method, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and along with the appearance of new requirements, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole process in a large scale, the customization and maintenance cost of the requirements are reduced, and the processing efficiency of an automatic process is improved.
The following describes an automated processing method based on multiple agents according to an embodiment of the present application, taking a working agent as an execution body.
As shown in fig. 5, the multi-agent based automated processing method includes steps 510 and 520.
Step 510, solving the received questions to obtain answers corresponding to the questions, wherein the working agent is a target working agent which is determined by analyzing the questions input by the user by the distributing agent and is suitable for solving the questions;
step 520, return the answer to the distributing agent.
According to the multi-agent-based automatic processing method, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and along with the appearance of new requirements, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole process in a large scale, the customization and maintenance cost of the requirements are reduced, and the processing efficiency of an automatic process is improved.
According to the multi-agent-based automatic processing method provided by the embodiment of the application, the execution subject can be an automatic processing device based on the multi-agent. In the embodiment of the application, the multi-agent-based automatic processing device is taken as an example for executing the multi-agent-based automatic processing method.
The embodiment of the application also provides an automatic processing device based on the multiple intelligent agents.
As shown in fig. 6, the multi-agent-based automated processing apparatus includes:
an obtaining module 610, configured to obtain a question input by a user;
A determination module 620 for analyzing the questions to determine target working agents suitable for solving the questions
And the routing module 630 is configured to route the question to the target working agent, so that the target working agent can solve the question and obtain an answer corresponding to the question.
According to the multi-agent-based automatic processing device, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and as new requirements appear, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole flow in a large scale, the customization and maintenance cost of the requirements is reduced, and the processing efficiency of an automatic process is improved.
The embodiment of the application also provides an automatic processing device based on the multi-agent, which is applied to the working agent.
As shown in fig. 7, the multi-agent-based automated processing apparatus includes:
The answering module 710 is configured to answer the received question to obtain an answer corresponding to the question, where the working agent is a target working agent suitable for answering the question determined by the distribution agent analyzing the question input by the user;
A return module 720 for returning the answer to the distributing agent.
According to the multi-agent-based automatic processing device, the distribution function and the working function of the agents are separated by building the multi-agent framework for managing the large model, the distribution agents are responsible for the receiving and preliminary analysis of the problems, the working agents are focused on the solution of the specific problems, the modularization of the system is realized, and as new requirements appear, new working agents can be simply added or the existing agents can be updated, so that the system can flexibly cope with various application requirements without modifying the whole flow in a large scale, the customization and maintenance cost of the requirements is reduced, and the processing efficiency of an automatic process is improved.
The multi-agent-based automated processing apparatus in the embodiment of the present application may be an electronic device, or may be a component in an electronic device, for example, an integrated circuit or a chip. The electronic device may be a terminal, or may be other devices than a terminal. The electronic device may be a Mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a Mobile internet appliance (Mobile INTERNET DEVICE, MID), an augmented reality (augmented reality, AR)/Virtual Reality (VR) device, a robot, a wearable device, an ultra-Mobile personal computer (UMPC), a netbook or a Personal Digital Assistant (PDA), etc., and may also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a Television (TV), a teller machine, a self-service machine, etc., which are not particularly limited in the embodiments of the present application.
The multi-agent-based automated processing unit in the embodiments of the present application may be a unit having an operating system. The operating system may be a microsoft (Windows) operating system, an Android operating system, an IOS operating system, or other possible operating systems, and the embodiment of the present application is not limited specifically.
In some embodiments, as shown in fig. 8, an electronic device 800 is further provided in the embodiments of the present application, which includes a processor 801, a memory 802, and a computer program stored in the memory 802 and capable of running on the processor 801, where the program, when executed by the processor 801, implements the respective processes of the foregoing embodiments of the multi-agent-based automated processing method, and the same technical effects are achieved, so that repetition is avoided and redundant description is omitted herein.
The electronic device in the embodiment of the application includes the mobile electronic device and the non-mobile electronic device.
The embodiment of the application also provides a non-transitory computer readable storage medium, on which a computer program is stored, which when executed by a processor, realizes the processes of the multi-agent-based automatic processing method embodiment, and can achieve the same technical effects, and in order to avoid repetition, the description is omitted here.
The processor is a processor in the electronic device in the above embodiment. Readable storage media include computer readable storage media such as computer readable memory ROM, random access memory RAM, magnetic or optical disks, and the like.
The embodiment of the application also provides a computer program product, which comprises a computer program, wherein the computer program is executed by a processor to realize the multi-agent-based automatic processing method.
The processor is a processor in the electronic device in the above embodiment. Readable storage media include computer readable storage media such as computer readable memory ROM, random access memory RAM, magnetic or optical disks, and the like.
The embodiment of the application further provides a chip, the chip comprises a processor and a communication interface, the communication interface is coupled with the processor, the processor is used for running programs or instructions, the processes of the embodiment of the multi-agent-based automatic processing method are realized, the same technical effects can be achieved, and the repetition is avoided, and the description is omitted here.
It should be understood that the chips referred to in the embodiments of the present application may also be referred to as system-on-chip chips, chip systems, or system-on-chip chips, etc.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element. Furthermore, it should be noted that the scope of the methods and apparatus in the embodiments of the present application is not limited to performing the functions in the order shown or discussed, but may also include performing the functions in a substantially simultaneous manner or in an opposite order depending on the functions involved, e.g., the described methods may be performed in an order different from that described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a computer software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising instructions for causing a terminal (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present application.
The embodiments of the present application have been described above with reference to the accompanying drawings, but the present application is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present application and the scope of the claims, which are to be protected by the present application.
In the description of the present specification, reference to the terms "one embodiment," "some embodiments," "illustrative embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present application have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the spirit and scope of the application as defined by the appended claims and their equivalents.

Claims (17)

1. An automated processing system based on multiple agents is characterized by comprising a distribution agent and a plurality of working agents;
the distribution agent is used for acquiring a problem input by a user, analyzing the problem to determine a target working agent suitable for solving the problem, and routing the problem to the target working agent;
And the working intelligent agent is used for solving the received questions to obtain answers corresponding to the questions, and returning the answers to the distribution intelligent agent.
2. The system of claim 1, wherein different working agents correspond to different first function descriptions;
the analyzing the problem to determine a target working agent suitable for solving the problem comprises:
And comparing the problems with first function descriptions corresponding to the working agents to determine the target working agent.
3. The system of claim 1, wherein analyzing the problem to determine a target working agent suitable for solving the problem comprises:
analyzing the problem to split the problem into a plurality of sub-problems;
Target working agents suitable for solving the respective sub-problems are determined separately.
4. The system of claim 3, wherein said routing said problem to said target working agent comprises:
And under the condition that the answer corresponding to the previous sub-question is obtained, the answer corresponding to the next sub-question and the previous sub-question is routed to the target working agent corresponding to the next sub-question.
5. The system of claim 1, wherein the distribution agent is further configured to:
Analyzing the answer to judge whether the problem is solved, and returning the answer to the user under the condition that the problem is solved.
6. The system of claim 5, wherein the distribution agent is further configured to:
in the event that the problem is not addressed, analyzing the problem and the answer to re-determine a target working agent suitable for solving the problem, routing the problem to the re-determined target working agent.
7. The system of claim 1, wherein the working agent comprises at least one functional module;
the received problem is solved to obtain an answer corresponding to the problem, which comprises the following steps:
and sending the questions to the functional module to obtain answers output by the functional module.
8. The system of claim 7, wherein said sending the question to the functional module to obtain an answer output by the functional module comprises:
In the case that the working agent includes a plurality of functional modules, the questions are analyzed to determine a target functional module suitable for solving the questions, and the questions are sent to the target functional module to obtain answers output by the target functional module.
9. The system of claim 8, wherein different functional modules correspond to different second functional descriptions;
The analyzing the problem to determine a target function module suitable for solving the problem includes:
And comparing the problem with second function descriptions corresponding to the function modules to determine the target function module.
10. The system of any of claims 1-9, wherein the problem is associated with programming.
11. The PLC automatic programming system based on the multiple intelligent agents is characterized by comprising a distribution intelligent agent and a plurality of working intelligent agents, wherein the working intelligent agents comprise working intelligent agents related to PLC codes, working intelligent agents related to online searching and working intelligent agents related to file searching;
the distribution agent is used for acquiring a problem input by a user, analyzing the problem to determine a target working agent suitable for solving the problem, and routing the problem to the target working agent;
And the working intelligent agent is used for solving the received questions to obtain answers corresponding to the questions, and returning the answers to the distribution intelligent agent.
12. The system of claim 11, wherein different working agents correspond to different first function descriptions;
the analyzing the problem to determine a target working agent suitable for solving the problem comprises:
And comparing the problems with first function descriptions corresponding to the working agents to determine the target working agent.
13. The system of claim 11, wherein the work agent comprises at least one functional module, wherein the functional module of the PLC code related work agent comprises at least one of a PLC code information module, a PLC code generation module, a PLC code verification module, and a document retrieval module, wherein the functional module of the online search related work agent comprises an online retrieval module, and wherein the functional module of the search related work agent comprises at least one of a document summarization module and a document retrieval module.
14. The system of claim 13, wherein the PLC code generation module comprises a RAG model, the RAG model comprising a retrieval module and a generation module;
The retrieval module is used for retrieving target information from related example codes, a PLC standard motion library and related documents of the PLC codes according to user input;
and the generation module is used for generating a PLC code according to the user input and the target information.
15. The system of claim 13, wherein the solving the received question to obtain an answer corresponding to the question comprises:
In the case that the working agent includes a plurality of functional modules, the questions are analyzed to determine a target functional module suitable for solving the questions, and the questions are sent to the target functional module to obtain answers output by the target functional module.
16. The system of claim 15, wherein different functional modules correspond to different second functional descriptions;
The analyzing the problem to determine a target function module suitable for solving the problem includes:
And comparing the problem with second function descriptions corresponding to the function modules to determine the target function module.
17. The system of claim 15, wherein the functional module is further configured to receive the question, retrieve target information associated with the question from a pre-constructed file dataset via a RAG technique, input the question and the target information into a large model, and obtain an answer output by the large model.
CN202411706518.7A 2024-11-26 2024-11-26 Multi-agent-based automatic processing system and PLC automatic programming system Pending CN119828579A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202411706518.7A CN119828579A (en) 2024-11-26 2024-11-26 Multi-agent-based automatic processing system and PLC automatic programming system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202411706518.7A CN119828579A (en) 2024-11-26 2024-11-26 Multi-agent-based automatic processing system and PLC automatic programming system

Publications (1)

Publication Number Publication Date
CN119828579A true CN119828579A (en) 2025-04-15

Family

ID=95296342

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202411706518.7A Pending CN119828579A (en) 2024-11-26 2024-11-26 Multi-agent-based automatic processing system and PLC automatic programming system

Country Status (1)

Country Link
CN (1) CN119828579A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120508285A (en) * 2025-07-22 2025-08-19 中国计量大学 Code generation method based on graph alignment coding large model and multi-agent cooperation
CN120524938A (en) * 2025-05-12 2025-08-22 成都证通数据科技有限公司 A natural language construction and interpretability auxiliary system for quantitative strategies based on multi-agent collaborative architecture
CN120632171A (en) * 2025-06-19 2025-09-12 广州电力交易中心有限责任公司 A multi-agent retrieval enhancement generation method and system based on diverse data sources

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120524938A (en) * 2025-05-12 2025-08-22 成都证通数据科技有限公司 A natural language construction and interpretability auxiliary system for quantitative strategies based on multi-agent collaborative architecture
CN120632171A (en) * 2025-06-19 2025-09-12 广州电力交易中心有限责任公司 A multi-agent retrieval enhancement generation method and system based on diverse data sources
CN120508285A (en) * 2025-07-22 2025-08-19 中国计量大学 Code generation method based on graph alignment coding large model and multi-agent cooperation
CN120508285B (en) * 2025-07-22 2025-10-21 中国计量大学 Code generation method based on graph alignment coding large model and multi-agent cooperation

Similar Documents

Publication Publication Date Title
CN117573834B (en) Multi-robot dialogue method and system for software-oriented instant service platform
US10339481B2 (en) Systems and methods for generating user interface-based service workflows utilizing voice data
CN119828579A (en) Multi-agent-based automatic processing system and PLC automatic programming system
KR20080107383A (en) A system that facilitates intuitive interaction between humans and machines, a computer executable system that facilitates statistical-based interactions, and a computer-implemented method that responds to user input.
CN109829052A (en) A kind of open dialogue method and system based on human-computer interaction
Malode Benchmarking public large language model
CN119759598B (en) Intelligent scheduling method of computing network resources based on large model intention perception
CN119377360A (en) An AI Agent based on a large language model collaborative knowledge graph and its implementation method
JP2025074312A (en) Large-scale model-based question answering method, device, electronic device, storage medium, agent, and program
CN119940552A (en) Agent-based data processing method, device, electronic device and storage medium
CN118485160A (en) Artificial intelligence data analysis method, device, equipment and medium conforming to business logic
CN112966076A (en) Intelligent question and answer generating method and device, computer equipment and storage medium
CN119202167A (en) Policy question answering method, device, apparatus and computer program product
Sriram et al. Leveraging Local LLMs for Secure In-System Task Automation With Prompt-Based Agent Classification
CN118246474A (en) Tool routing method and device
CN119005344B (en) Large model application method, device, equipment and medium
CN118734571B (en) Simulation computing APP application process recommendation method, device and system
CN119692449A (en) Intelligent question-answering processing method, device, electronic device, computer-readable storage medium, and computer program product
CN119782484A (en) Intelligent interaction method, device, system, medium and equipment based on large model
Lovtsov et al. Automated Mobile Operator Customer Service Using Large Language Models Combined with RAG System
CN119226467A (en) Information generation method, device, system, electronic device and storage medium
Patil et al. Analyzing Chatbot Architectures Utilising Deep Neural Networks
CN117312517A (en) Human-computer interaction prompt library maintenance method, electronic equipment and storage medium
CN118070925B (en) Model training method, device, electronic equipment, storage medium and program product
US20260037558A1 (en) System and method for expert-assisted generative ai prompt response adaptation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination