Scientific Drawing Method, System and Storage Medium Based on Multi-Agent Collaboration
By introducing multi-agent collaboration methods in the field of scientific drawing, including task planning, environment selection and code generation agents, the problem of insufficient environmental selection and automation processing capabilities of scientific drawing systems in the existing technology is solved, and more efficient and high-quality scientific drawing is achieved.
Patent Information
- Application Number
- CN202411280123.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The existing multi-agent system has problems such as operating environment limitations and insufficient automation processing capabilities in the field of scientific drawing, resulting in inefficient drawing and error-prone.
By introducing scientific drawing methods of multi-agent collaboration, including task planning agents, environment selection agents and code generation and execution agents, the most suitable programming language environment is automatically selected based on the user's drawing data and needs, and the code that meets the needs is generated to generate high-quality graphics.
This method overcomes the limitations of the existing technology that multi-agent systems can only operate in a single preset environment, improves the intelligence level of the system, can better adapt to the needs of scientific drawing, and generate high-quality graphics that meet user needs.
Smart Images

Figure CN119105738B_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of artificial intelligence technology, and particularly to a scientific drawing method, system, and storage medium based on multi-agent collaboration. Background Art
[0002] An agent refers to a system that, based on artificial intelligence technology, can understand its surrounding environment, process input information, and make intelligent responses or actions, thereby automatically executing tasks or making decisions in its environment. A multi-agent system usually consists of multiple autonomous or collaborative agents, and each agent is responsible for specific tasks, such as data preprocessing, model training, result analysis, etc. Multi-agent systems are widely used in fields such as data analysis and automated task execution.
[0003] Existing multi-agent systems are mostly used for general data analysis and lack dedicated design and support for scientific drawing. When dealing with scientific drawing tasks with complex and diverse requirements, there are problems such as limitations in the operating environment and insufficient automated processing capabilities. The execution process often requires complex operations, not only with low drawing efficiency but also prone to errors.
[0004] In view of the fact that the existing technology cannot meet the automated and diverse drawing requirements in the field of scientific drawing, a more intelligent solution is urgently needed. Summary of the Invention
[0005] To solve the problems in the related art, the present invention provides a scientific drawing method, system, and storage medium based on multi-agent collaboration.
[0006] In one aspect of the present invention, a scientific drawing method based on multi-agent collaboration is provided, including:
[0007] According to the drawing data and drawing requirements provided by the user, a task planning agent generates a task plan for the current drawing task;
[0008] According to the task plan, an environment selection agent selects a programming language suitable for the current drawing task as the recommended result of the programming environment;
[0009] According to the task plan and the recommended result of the programming environment, a code generation and execution agent generates code that meets the requirements and executes it in the corresponding programming environment to generate the final drawing result.
[0010] In another aspect of the present invention, a scientific drawing system based on multi-agent collaboration is provided, including:
[0011] A task planning agent, configured to generate a task plan for the current drawing task according to the drawing data and drawing requirements provided by the user;
[0012] An environment selection agent for selecting a programming language suitable for the current drawing task as the recommended result of the programming environment according to the task plan;
[0013] A code generation and execution agent for generating code that meets the requirements according to the task plan and the recommended result of the programming environment, and executing it in the corresponding programming environment to generate the final drawing result.
[0014] Another aspect of the present invention also provides an electronic device, including at least one processor; and a memory communicatively connected to the at least one processor; wherein, the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to cause the processor to implement the various methods described above.
[0015] Another aspect of the present invention also provides a computer-readable storage medium, on which computer-readable instructions are stored, and when the instructions are executed by a processor, the processor is caused to implement the various methods described above.
[0016] Another aspect of the present invention also provides a computer program, which when executed by a processor causes the processor to implement the various methods described above.
[0017] The technical solution of the present invention can achieve the following beneficial effects:
[0018] (1) By introducing an environment selection agent, the most suitable programming language environment is recommended according to specific task requirements. This design overcomes the limitation that the existing multi-agent system can only run in a single preset environment, improves the intelligence level of the system, and can better meet the needs of scientific drawing.
[0019] (2) On the basis of multi-agent cooperation, special optimization is carried out for the specific task of scientific drawing. By constructing a vector database for scientific drawing and using the RAG technology to provide additional knowledge information to the model, the search performance in tasks such as environment selection and code generation is enhanced, and high-quality graphics that better meet the user's needs are drawn. Description of the Drawings
[0020] In combination with the drawings, through the following detailed description of non-limiting embodiments, other features, objects, and advantages of the present invention will become more apparent.
[0021] Figure 1 It is a schematic diagram of the system architecture for applying the method of the embodiment of the present disclosure;
[0022] Figure 2 It is a flowchart of the scientific drawing method based on multi-agent cooperation of the embodiment of the present disclosure;
[0023] Figure 3Block diagram of a scientific drawing system based on multi-agent collaboration according to an embodiment of the present disclosure;
[0024] Figure 4 Flowchart of applying the scientific drawing system in an embodiment of the present disclosure;
[0025] Figure 5 A user interface for implementing the scientific drawing system of an embodiment of the present disclosure. Detailed implementation manners
[0026] In this specification, it should be understood that terms such as "including" or "having" are intended to indicate the presence of features, numbers, steps, actions, components, parts, or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, numbers, steps, actions, components, parts, or combinations thereof.
[0027] It should be noted that, without conflict, the embodiments in the present disclosure and the features in the embodiments may be combined with each other.
[0028] Before describing the embodiments of the present disclosure, several typical multi-agent systems are briefly introduced.
[0029] (1) General multi-agent system
[0030] General multi-agent systems are usually used for various automated task processing, such as AutoGen, MetaGPT, ChatDev, etc. These systems decompose tasks by setting up different task roles and let large language models (LLMs) complete complex tasks. The design of such systems is mostly general-purpose and lacks optimization for specific tasks or application scenarios, and is not specifically designed for the field of scientific drawing.
[0031] (2) Data analysis multi-agent framework
[0032] Some existing data analysis multi-agent frameworks usually consist of multiple agents, including agent modules such as data collection, cleaning, modeling, prediction, and result output. For example, Data Interpreter is good at automated processing and analysis of data and can be applied to fields such as finance, market analysis, and bioinformatics. The design purpose of these multi-agent frameworks is for data analysis tasks and is not specifically designed for the field of scientific drawing. The performance of the model largely depends on the knowledge pre-trained by its large language model and cannot obtain additional relevant knowledge.
[0033] At the same time, these multi-agent systems generally rely on a single operating environment, where the programming language and execution environment (usually Python) are predefined at the start of the task, and it is not possible to flexibly select the optimal programming language or environment according to requirements during the task execution. However, scientific plotting tasks often rely on specific function libraries, which may be implemented in different language environments, such as Python, R, or SAS, etc. Therefore, the limitation of a single environment cannot fully meet the needs of users for scientific plotting. Especially when faced with cross-disciplinary and cross-field scientific plotting tasks, it is easy to experience low efficiency or the inability to generate high-quality graphics.
[0034] In addition, although existing multi-agent systems have certain advantages in data processing and analysis, in the field of scientific plotting, especially when it comes to complex data and multi-dimensional graph generation, there are still significant deficiencies. Existing technologies mainly focus on general data analysis or chart generation tools, such as Matplotlib, ggplot2, etc. These tools usually require users to have a relatively high programming ability and need to manually configure the environment and write code, which is complex and error-prone.
[0035] To address the problem that existing technologies cannot meet the intelligent and diverse needs in the field of scientific plotting, the present disclosure proposes a technical solution for scientific plotting based on multi-agent collaboration. In the following text, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to make it easier for those skilled in the art to implement them. In addition, for clarity, parts irrelevant to the description of the exemplary embodiments are omitted in the drawings.
[0036] Figure 1 Schematically shows a system architecture diagram applying the various methods of the embodiments of the present disclosure.
[0037] As Figure 1 shown, in this system architecture, it may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0038] The terminal devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send messages, etc. Various client applications may be installed on the terminal devices 101, 102, 103. For example, a dedicated application program with functions such as uploading plotting data, inputting requirement descriptions, and displaying graphic images and auxiliary information.
[0039] The terminal devices 101, 102, and 103 can be hardware or software. When the terminal devices 101, 102, and 103 are hardware, they can be various dedicated or general-purpose electronic devices, including but not limited to ultrasound machines, smartphones, tablets, laptop computers, and desktop computers, etc. When the terminal devices 101, 102, and 103 are software, they can be installed in the above-listed electronic devices. They can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or can be implemented as a single software or software module.
[0040] The server 105 can be a server that provides various intelligent services. For example, it can be a backend server that provides services for the client applications installed on the terminal devices 101, 102, and 103. For example, the server can train and deploy multiple agents to support scientific drawing tasks so as to display the visualization results on the terminal devices 101, 102, and 103.
[0041] The server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server cluster composed of multiple servers, or can be implemented as a single server. When the server 105 is software, it can be implemented as multiple software or software modules (for example, multiple software or software modules for providing distributed services), or can be implemented as a single software or software module.
[0042] The various methods provided by the embodiments of the present invention can be executed by the server 105, or can be executed by the terminal devices 101, 102, and 103. Or, the various methods of the embodiments of the present invention can be partially executed by the terminal devices 101, 102, and 103, and other parts can be executed by the server 105.
[0043] It should be understood that Figure 1 the numbers of the terminal devices, network, and server in
[0044] are merely illustrative. According to the implementation requirements, there can be any number of terminal devices, network, and server. Figure 2 The following describes embodiments for implementing the scientific drawing method based on multi-agent collaboration of the present disclosure in conjunction with
[0045] Figure 2 The flowchart of the scientific drawing method based on multi-agent collaboration of the embodiments of the present disclosure is schematically shown.
[0046] As Figure 2 shown, the scientific drawing method includes operations S210 - S230.
[0047] In operation S210, according to the drawing data and drawing requirements provided by the user, the task planning agent generates a task plan for the current drawing task.
[0048] Users can provide drawing data and drawing requirements by uploading files, adding file descriptions, and drawing requirements. Based on this, the task planning agent automatically parses the user's requirements and converts them into executable task steps. For example, according to the user's requirements, the tasks to be executed planned include determining the programming language environment to be selected, extracting relevant data columns from the file, the type of image to be generated, and the saving path, etc.
[0049] The task planning agent parses the drawing data and drawing requirements provided by the user based on natural language processing technology, generates a task plan in JSON format. This task plan includes multiple tasks to be executed, and sends the tasks to be executed to the corresponding agent according to the execution order given in the task plan.
[0050] Furthermore, the system also designs an error correction mechanism. If any task to be executed fails, the agent executing the task will feedback the failure result to the task planning agent, and the task planning agent will regenerate a new task plan according to the feedback failure information.
[0051] In one implementation, specific tasks can be given to the task planning agent through the following prompt words.
[0052] System prompt words: You are a helpful assistant.
[0053] User prompt words:
[0054]
[0055]
[0056]
[0057] Among them, {file_path} is the file path to be parsed, {plot_requirements} is the drawing requirement, {data_description} is the data description, and {save_path} is the path to save the drawing result.
[0058] Here, the task planning agent needs to give a task plan in JSON format according to the content of the drawing data and the drawing requirements provided by the user, and this format can be parsed and executed by the code.
[0059] To make the model more successful and provide a more reasonable plan, several common Tasks are provided in the above embodiments to call the corresponding agents. They are env select for the environment selection agent, data analysis for the data analysis agent, and doc search for the code function search agent. For more flexibility, task types can also be customized to handle complex situations.
[0060] During the execution of the planned tasks, if one of the tasks to be executed fails, the failure content will be returned to the task planning agent, and the task planning agent will re-plan the task process for this drawing task.
[0061] In operation S220, according to the task plan, the environment selection agent selects the programming language suitable for this drawing task as the programming environment recommendation result.
[0062] The environment selection agent uses the RAG (Retrieval-Augmented Generation) search tool to find similar cases for this drawing task, compares the programming languages, data structures, and image types used in this drawing task and the similar cases, and selects the programming language suitable for this drawing task as the programming environment recommendation result based on the comparison results. Specifically, the environment selection agent first parses the drawing requirements provided by the task planning agent, analyzes the type of chart to be drawn, and then retrieves similar cases from the database or the preset case library. By comparing the programming languages, data structures, and image types used in the cases, the agent selects the language environment most suitable for implementing the function and feeds the result back to the task planning agent to update the execution path of the subsequent tasks. In one embodiment, the programming language environment includes Python or R.
[0063] In one embodiment, the prompt guidance passed from the task planning agent to the environment selection agent is as follows:
[0064] System prompt: As a data scientist, you need to help user to achieve their goal step by step in a continuous Jupyter notebook. Since it is a notebook environment, don't use asyncio.run. Instead, use await if you need to call an async function. You MUST use the same programming languages for all the tasks.
[0065] User prompt:
[0066]
[0067]
[0068] Among them, the prompt after "Current Task" is generated by the task planning agent. The task planning agent generates different prompts according to different drawing tasks. For example, the current task is to draw an ROC curve.
[0069] The search process can use the RAG search tool to enhance the search for similar cases. Due to the diversity of user needs, there may be no similar cases included. If no similar cases are found, the environment selection agent makes a decision based on the comprehensive consideration of the search results and the knowledge of the large model itself to determine the recommended programming environment result.
[0070] At this time, the model can be required to output a function code for the target environment to facilitate information positioning and start the corresponding Jupyter Notebook environment kernel.
[0071] The environment selection agent will also feedback the environment recommendation result to the task planning agent; according to the environment recommendation result, the task planning agent updates the execution path of the subsequent tasks in the task plan.
[0072] In addition, most scientific drawing pictures may involve relatively complex algorithm implementation logics and generally use functions in various ready-made libraries to implement. For example, for the ROC curve, there are corresponding implementation functions in the sklearn library of Python and the pROC library of R language. In this case, the Python environment can be preferentially selected. Another example is the nomogram of logistic regression, which has an implementation function in the rms library of R language, while there is no similar implementation function in the Python library. In this case, the R language environment is selected, and relevant functions can be called in this environment. Therefore, if it is found that the picture type of this drawing task can be implemented in both Python and R language environments, Python is preferentially selected as the recommended language environment. This is because more Python data is used in the pre-training process of the LLM, and its Python code ability is stronger.
[0073] In operation S230, according to the task plan and the environment recommendation result, the code generation and execution agent generates code that meets the requirements and executes it in the corresponding programming environment to generate the final drawing result.
[0074] The code generation agent uses the RAG search tool to search for the pre-stored vector database; generates code that meets the requirements based on the code templates and library functions found in the vector database; passes the generated code to the Jupyter Notebook environment kernel, and executes the code using the corresponding programming language.
[0075] In implementation, the code generation and execution agent first generates data processing and plotting code by parsing the user requirements and task planning. The code generator therein flexibly combines to generate code based on predefined code templates and library functions. After the code is generated, the agent passes the code to the Jupyter Notebook kernel for running and obtains the execution result.
[0076] In one implementation, the prompt for the current task is as follows:
[0077] System prompt: As a data scientist, you need to help user to achieve their goal step by step in a continuous Jupyter notebook. Since it is a notebook environment, don't use asyncio.run. Instead, use await if you need to call an async function. You MUST use the same programming languages for all the tasks.
[0078] User prompt:
[0079]
[0080]
[0081]
[0082] Among them, the content after "User Requirement", "Finished Tasks", and "code" in the code lines is obtained according to the actual plotting task, and is explained by the text in "[]" in the code lines. The prompt after "Current Task" in the code lines is generated by the task planning agent, and there will be different prompts according to different plotting tasks. For example, this task is to draw a graph according to the aforementioned user requirements and save the graph.
[0083] Furthermore, due to the high difficulty of code generation, an error correction mechanism is also set inside the code generation and execution agent to automatically handle code errors, that is: if an error occurs during code execution, the error message and the original code are fed back to the code generation agent, and the code generation agent regenerates new code that meets the requirements based on the code and the error message. The agent can choose to rewrite the code or install the corresponding missing code package to solve the code error.
[0084] In the actual processing flow, the code generation and execution agent may undertake multiple tasks, such as parsing data, analyzing data, performing drawing, and so on. These specific tasks are scheduled by the task planning agent.
[0085] In addition, for flexibility and compatibility, when data is transmitted between agents, plain text prompts are used for communication, and each agent can obtain the execution results of all previous tasks.
[0086] In the above embodiments, the RAG technology is used to enhance the search, and a vector database for scientific drawing is constructed. In the database, not only common drawing functions in Python and R languages are collected, but also a large number of pictures of various types are collected. For each picture in the database, the picture type (i.e., the picture name) is included, and the programming language, parameter documentation, and drawing examples corresponding to the picture of this type are associated to enhance the capabilities of the LLM. When the agent uses this tool, it can retrieve the corresponding information by using the picture type, so as to obtain enhancement in finding similar cases. The embedding model of the large language model is used to extract the picture type as the entry for vector search to cope with the flexibility of user input. For example, box plots and box-and-whisker plots are actually the same type of picture.
[0087] According to the solution of the embodiment of the present disclosure, by introducing an environment selection agent, the most suitable programming language environment is automatically recommended according to specific task requirements. It overcomes the limitation that the multi-agent system in the prior art can only run in a single preset environment, and improves the intelligence level of the system. On the basis of the multi-agent cooperation system, special optimization is carried out for the specific task of scientific drawing. By constructing a vector database for scientific drawing, additional knowledge information is provided to the model, enhancing the search performance in tasks such as environment selection and code generation, and drawing high-quality graphics that meet the user's requirements.
[0088] Based on the same inventive concept, the embodiment of the present disclosure also provides a scientific drawing system based on multi-agent cooperation, which will be described below with reference to Figure 3 for illustration.
[0089] Figure 3A block diagram schematically showing the scientific drawing system 300 according to an embodiment of the present disclosure. Among them, the system 300 can be implemented as part or all of an electronic device through software, hardware, or a combination of both.
[0090] As Figure 3 shown, the scientific drawing system 300 includes a task planning agent 310, an environment selection agent 320, and a code generation and execution agent 330. The scientific drawing 300 can execute the scientific drawing method described above.
[0091] The task planning agent 310 is used to generate a task plan for the current drawing task according to the drawing data and drawing requirements provided by the user.
[0092] The environment selection agent 320 is used to select a programming language suitable for the current drawing task as the programming environment recommendation result according to the task plan.
[0093] The code generation and execution agent 330 is used to generate code that meets the requirements according to the task plan and the programming environment recommendation result, and execute it in the corresponding programming environment to generate the final drawing result.
[0094] Preferably, the scientific drawing system 300 further includes a RAG search tool 340, which is used to query similar cases of the current drawing task and search for code templates and library functions required for generating code from a pre-stored vector database.
[0095] Furthermore, the scientific drawing system 300 may further include an input unit 350 and an output unit 360 to achieve human-computer interaction.
[0096] The input unit 350 is used to receive the drawing data and drawing requirements uploaded by the user.
[0097] The output unit 360 is used to visually display the final drawing result.
[0098] Based on the above scientific drawing system, a process schematic of using the system to perform a scientific drawing task is as Figure 4 shown. Figure 5 An example interface for realizing user interaction is given.
[0099] According to Figure 4 、 5, the user uploads an analysis file, file description, and drawing requirements through the interaction interface. Then, the task planning agent gives a task plan. According to the planned task plan, the environment selection agent searches for the most suitable programming environment. The code generation agent displays the file content, writes code for drawing, and finally outputs and displays the drawing result through the human-computer interaction interface. During this process, if a certain task fails, the result will be fed back to the task planning agent for adjustment. At the same time, the agent can use the RAG search tool to enhance the capabilities of the LLM.
[0100] According to the solution of the embodiment of the present disclosure, by introducing an environment selection agent, the most suitable programming language environment can be automatically recommended according to specific task requirements. It overcomes the limitation that the multi-agent system in the prior art can only run in a single preset environment and improves the intelligence level of the system. On the basis of the multi-agent cooperation system, special optimization is carried out for the specific task of scientific drawing. By constructing a vector database for scientific drawing, additional knowledge information is provided to the model, enhancing the search performance in tasks such as environment selection and code generation, and drawing high-quality graphics that meet the user's requirements.
[0101] On the other hand, the present disclosure also provides an electronic device, including:
[0102] at least one processor; and,
[0103] a memory communicatively connected to the at least one processor; wherein,
[0104] the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the various methods as described above.
[0105] This specification also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the electronic device or computer system in the above embodiment; or it may exist alone and be a computer-readable storage medium not assembled into the device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the methods of the embodiments of the present invention.
[0106] Another aspect of the present disclosure also provides a computer program, which when executed by a processor causes the processor to implement the various methods as described above.
[0107] The specific embodiments of the present disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve the desired result. Additionally, the processes depicted in the drawings do not necessarily require the particular order or sequential order shown to achieve the desired result. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0108] Each embodiment in the present disclosure is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the system, electronic device, computer storage medium, and computer program embodiments, since they are basically similar to the method embodiments, the description is relatively simple. For the relevant parts, reference can be made to the partial description of the method embodiments.
[0109] The systems, electronic devices, computer storage media provided in the embodiments of the present disclosure correspond to the methods. Therefore, the devices, electronic devices, computer storage media, and computer programs also have beneficial technical effects similar to the corresponding methods. Since the beneficial technical effects of the methods have been described in detail above, the beneficial technical effects of the corresponding devices, electronic devices, and non-volatile computer storage media will not be elaborated here.
[0110] The units or modules described in the embodiments of the present disclosure can be implemented in software or in programmable hardware. The described units or modules can also be set in the processor. In some cases, the names of these units or modules do not constitute a limitation to the units or modules themselves.
[0111] The above description is only for the preferred embodiments of the present disclosure and the explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above technical features, but also covers other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the inventive concept. For example, the technical solutions formed by mutually replacing the above features with the (but not limited to) technical features with similar functions disclosed in the present disclosure.
Claims
1. A scientific drawing method based on multi-agent collaboration, characterized in that: include: Based on the drawing data and drawing requirements provided by the user, the task planning agent generates the task plan for this drawing task; According to the task plan, the environment selection agent selects a programming language suitable for the current drawing task as a programming environment recommendation result, including: the environment selection agent uses a RAG search tool to search for similar cases of the current drawing task; compares the programming languages, data structures, and image types used in the current drawing task and the similar cases; and selects a programming language suitable for the current drawing task as a programming environment recommendation result based on the comparison result; According to the task planning and the programming environment recommendation results, the code generation and execution agent generates the code that meets the requirements and executes it in the corresponding programming environment to generate the final drawing result, wherein the code generation and execution agent generates the code that meets the requirements and executes it in the corresponding programming environment, including: The code generation agent uses the RAG search tool to search the pre-stored vector database; Generate code that meets the requirements based on the code templates and library functions found in the vector database; The generated code is passed to the Jupyter Notebook environment kernel and executed using the corresponding programming language.
2. The scientific drawing method according to claim 1, characterized in that: The method further comprises: If no similar cases are found, a decision is made based on the search results and the big model's own knowledge to determine the programming environment recommendation result.
3. The scientific drawing method according to claim 1, characterized in that: After the environment selection agent selects a programming language suitable for this drawing task as the programming environment recommendation result, it also includes: The environment selection agent feeds back the environment recommendation result to the task planning agent; According to the environmental recommendation result, the task planning agent updates the execution path of subsequent tasks in the task planning.
4. The scientific drawing method according to claim 1, characterized in that: The method of using the RAG search tool to search a pre-stored vector database includes: The image type to be generated in this drawing task is extracted through a large language model, and the RAG search tool is used to search for matching image types in the vector database. The image types in the vector database are associated with corresponding programming languages, parameter documents, and drawing example information.
5. The scientific drawing method according to claim 4, characterized in that: After executing the code using a corresponding programming language, the method further includes: If an error occurs when executing the code, a new code that meets the requirements is generated again based on the code and the error information.
6. The scientific drawing method according to claim 1, characterized in that: The task planning agent generates a task plan for this drawing task, including: The task planning agent generates a task plan in JSON format, wherein the task plan includes multiple tasks to be executed; The tasks to be executed are sent to the corresponding agents in the execution order given by the task plan.
7. The scientific drawing method according to claim 6, characterized in that: The method further comprises: If any of the tasks to be executed fails, the task planning agent regenerates a new task plan based on the feedback failure information.
8. A scientific drawing system based on multi-agent collaboration, characterized in that: include: The task planning agent is used to generate the task plan of this drawing task according to the drawing data and drawing requirements provided by the user; The environment selection agent is used to select a programming language suitable for the current drawing task as a programming environment recommendation result according to the task plan, including: the environment selection agent uses a RAG search tool to find similar cases of the current drawing task; compares the programming languages, data structures and image types used in the current drawing task and the similar cases; and selects a programming language suitable for the current drawing task as a programming environment recommendation result based on the comparison result; A code generation and execution agent, used to generate codes that meet the requirements according to the task planning and the recommended results of the programming environment, and execute them in the corresponding programming environment to generate the final drawing results; The code generation and execution agent generates code that meets the requirements and executes it in a corresponding programming environment, including: The code generation agent uses the RAG search tool to search the pre-stored vector database; Generate code that meets the requirements based on the code templates and library functions found in the vector database; The generated code is passed to the Jupyter Notebook environment kernel and executed using the corresponding programming language.
9. The scientific mapping system according to claim 8, characterized in that: It also includes a RAG search tool for searching similar cases of this drawing task and for searching the code templates and library functions required for code generation from a pre-stored vector database.
10. The scientific mapping system according to claim 8, characterized in that: Also includes: An input unit, used to receive drawing data and drawing requirements uploaded by users; Output unit, used to visualize the final drawing results.
11. A computer-readable storage medium having computer-readable instructions stored thereon, characterized in that: When the readable instructions are executed by a processor, the processor implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Artificial intelligence reinforcement learning service system
CN113377355A
Navigation process code generation method based on artificial intelligence
CN118409742A