Scientific drawing method and system based on multi-agent cooperation and storage medium

Through a multi-agent collaboration system, including task planning, environment selection and code generation execution agents, combined with RAG technology and vector database, the environmental limitations and insufficient automation processing capabilities in the field of scientific drawing are solved, and efficient and intelligent graphics are achieved generate.

CN119105738AActive Publication Date: 2024-12-10BEI JING YI ZHUN YI LIAO KE JI YOU XIAN GONG SI

Patent Information

Application Number
CN202411280123.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-10
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

The existing multi-agent system has operating environment limitations and insufficient automation processing capabilities in the field of scientific drawing, resulting in inefficient drawing efficiency and error-proneness, which cannot meet complex and diverse drawing needs.

Method used

Using a scientific drawing method based on multi-agent collaboration, the agent generates task planning through task planning, the agent recommends a suitable programming language environment, code generation and execution of agent generation and execution of code that meets the needs, using RAG technology and vectors Database enhances search performance and generates high-quality graphics.

Benefits of technology

Overcoming the limitation that multi-agent systems can only operate in a single environment, improving the intelligence level of the system, better adapting to scientific drawing needs, and generating high-quality graphics that meet user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105738A_ABST
    Figure CN119105738A_ABST
Patent Text Reader

Abstract

The invention provides a scientific drawing method based on multi-agent cooperation, and the method comprises the steps: generating a task plan of a current drawing task by a task planning agent according to drawing data and drawing demands provided by a user; according to the task plan, an environment selection agent selects a programming language suitable for the drawing task as a programming environment recommendation result; and according to the task planning and programming environment recommendation result, the code generation and execution agent generates a code meeting the requirement, and executes the code in the corresponding programming environment to generate a final drawing result. According to the technical scheme, the limitation that a multi-agent system can only run in a single preset environment in the prior art is overcome, the intelligent level of the system is improved, the search performance in tasks such as environment selection and code generation is enhanced, and high-quality graphs meeting user requirements can be drawn.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of artificial intelligence technology, and in particular to a scientific drawing method, system and storage medium based on multi-agent collaboration. Background Art

[0002] An agent is a system based on artificial intelligence technology that can understand its surrounding environment, process input information and make intelligent responses or actions, thereby automatically performing tasks or making decisions in its environment. Multi-agent systems are usually composed of multiple autonomous or collaborative agents, each of which is responsible for a specific task, such as data preprocessing, model training, result analysis, etc. Multi-agent systems are widely used in data analysis, automated task execution and other fields.

[0003] Existing multi-agent systems are mostly used for general data analysis and lack special design and support for scientific drawing. When dealing with complex and diverse scientific drawing tasks, there are problems such as operating environment limitations and insufficient automated processing capabilities. The execution process often requires complex operations, which not only makes drawing inefficient but also prone to errors.

[0004] Given that existing technologies cannot meet the automated and diverse drawing needs in the field of scientific drawing, a smarter 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] One aspect of the present invention provides a scientific drawing method based on multi-agent collaboration, comprising:

[0007] Based on the drawing data and drawing requirements provided by the user, the task planning agent generates the task plan for this drawing task;

[0008] 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;

[0009] According to the task planning and programming environment recommendation results, 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.

[0010] Another aspect of the present invention provides a scientific drawing system based on multi-agent collaboration, comprising:

[0011] 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;

[0012] An 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;

[0013] The code generation and execution agent is used to generate code that meets the requirements according to the task planning and the programming environment recommendation results, and execute it in the corresponding programming environment to generate the final drawing result.

[0014] Another aspect of the present invention provides an electronic device, comprising 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 so that the processor implements the various methods described above.

[0015] Another aspect of the present invention provides a computer-readable storage medium on which computer-readable instructions are stored. When the instructions are executed by a processor, the processor implements the various methods described above.

[0016] Another aspect of the present invention further provides a computer program, which, when executed by a processor, enables 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) Based on multi-agent collaboration, special optimization is carried out for the specific task of scientific drawing. By building a vector database for scientific drawing and using RAG technology to provide the model with additional knowledge information, the search performance in tasks such as environment selection and code generation is enhanced, and high-quality graphics that better meet user needs are drawn. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Other features, objectives and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments in conjunction with the accompanying drawings.

[0021] Figure 1 A schematic diagram of a system architecture for applying the method of the embodiment of the present disclosure;

[0022] Figure 2 A flowchart of a scientific drawing method based on multi-agent collaboration according to an embodiment of the present disclosure;

[0023] Figure 3A block diagram of a scientific drawing system based on multi-agent collaboration according to an embodiment of the present disclosure;

[0024] Figure 4 A flowchart of applying a scientific drawing system in an embodiment of the present disclosure;

[0025] Figure 5 A user interaction interface for a scientific drawing system is provided to implement the embodiment of the present disclosure. DETAILED DESCRIPTION

[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, behaviors, components, parts or a combination thereof disclosed in this specification, and are not intended to exclude the possibility that one or more other features, numbers, steps, behaviors, components, parts or a combination thereof exist or are added.

[0027] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present disclosure may be combined with each other.

[0028] Before describing the implementation methods of the present disclosure, several typical multi-agent systems are briefly introduced.

[0029] (1) General Multi-Agent System

[0030] General-purpose multi-agent systems are often used for various automated task processing, such as AutoGen, MetaGPT, ChatDev, etc. These systems decompose tasks by setting up different task roles, allowing large language models (LLMs) to complete complex tasks. The design of such systems is mostly general, lacking optimization for specific tasks or application scenarios, and has not been specifically designed in the field of scientific graphics.

[0031] (2) Multi-agent framework for data analysis

[0032] Some existing data analysis multi-agent frameworks are usually composed of multiple agents, including agent modules such as data collection, cleaning, modeling, prediction, and result output. For example, Data Interpreter excels in automated data processing and analysis, and can be applied to fields such as finance, market analysis, and bioinformatics. These multi-agent frameworks are designed for data analysis tasks and are not specifically designed for the field of scientific drawing. The performance of the model depends largely on the pre-trained knowledge of its large language model, and it is unable to obtain additional relevant knowledge.

[0033] At the same time, these multi-agent systems are generally based on a single operating environment, with the programming language and execution environment (usually Python) pre-defined at the beginning of the task, and cannot flexibly select the optimal programming language or environment according to needs during the task execution. However, scientific drawing tasks often rely on specific function libraries, which may be implemented in different language environments, such as Python, R, or SAS. Therefore, the limitations of a single environment cannot fully meet the user's needs for scientific drawing, especially when facing interdisciplinary and cross-domain scientific drawing tasks, which are prone to inefficiency or failure to generate high-quality graphics.

[0034] In addition, although the existing multi-agent system has certain advantages in data processing and analysis, it still has major shortcomings in the field of scientific graphics, especially when it comes to complex data and multi-dimensional graphics generation. Existing technologies are mostly focused on general data analysis or chart generation tools, such as Matplotlib, ggplot2, etc. These tools usually require users to have high programming skills and need manual environment configuration and code writing, which are complex and error-prone.

[0035] In view of the problem that the existing technology cannot meet the intelligent and diversified needs in the field of scientific drawing, the present disclosure proposes a technical solution for completing scientific drawing based on multi-agent collaboration. Hereinafter, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings so that those skilled in the art can more easily implement them. In addition, for the sake of clarity, parts not related to the description of the exemplary embodiments are omitted in the accompanying drawings.

[0036] Figure 1 A schematic diagram of a system architecture for applying various methods of the embodiments of the present disclosure is schematically shown.

[0037] like Figure 1 As shown, in the system architecture, terminal devices 101, 102, 103, a network 104 and a server 105 may be included. The network 104 is used to provide a medium for a communication link 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 optical fiber cables, etc.

[0038] The terminal devices 101, 102, 103 interact with the server 105 via the network 104 to receive or send messages, etc. Various client applications may be installed on the terminal devices 101, 102, 103. For example, dedicated applications with functions such as drawing data upload, requirement specification input, graphic image display, auxiliary information display, etc.

[0039] The terminal devices 101, 102, 103 may be hardware or software. When the terminal devices 101, 102, 103 are hardware, they may be various special or general electronic devices, including but not limited to ultrasound machines, smart phones, tablet computers, laptop portable computers, desktop computers, etc. When the terminal devices 101, 102, 103 are software, they may be installed in the electronic devices listed above. They may be implemented as multiple software or software modules (e.g., multiple software or software modules for providing distributed services), or they may be implemented as a single software or software module.

[0040] The server 105 may be a server that provides various intelligent services, such as a backend server that provides services for client applications installed on the terminal devices 101, 102, and 103. For example, the server may train and deploy multiple agents to support scientific drawing tasks so as to display visualization results on the terminal devices 101, 102, and 103.

[0041] The server 105 may be hardware or software. When the server 105 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the server 105 is software, it may be implemented as multiple software or software modules (e.g., multiple software or software modules for providing distributed services), or as a single software or software module.

[0042] The various methods provided in the embodiments of the present invention may be executed by the server 105 or by the terminal devices 101, 102, 103. Alternatively, the various methods provided in the embodiments of the present invention may be partially executed by the terminal devices 101, 102, 103 and the rest executed by the server 105.

[0043] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0044] Combine the following Figure 2 An embodiment of a scientific drawing method based on multi-agent collaboration of the present disclosure is described.

[0045] Figure 2 The flowchart of the scientific drawing method based on multi-agent collaboration according to an embodiment of the present disclosure is schematically shown.

[0046] like Figure 2 As shown, the scientific drawing method includes operations S210-S230.

[0047] In operation S210, the task planning agent generates a task plan for this drawing task according to the drawing data and drawing requirements provided by the user.

[0048] Users can provide drawing data and drawing requirements by uploading files, adding file descriptions and drawing requirements. The task planning agent automatically analyzes user requirements and converts them into executable task steps. For example, according to user requirements, the planned tasks include determining the programming language environment to be selected, extracting relevant data columns from files, generating image types and saving paths, etc.

[0049] The task planning agent parses the drawing data and drawing requirements provided by the user based on natural language processing technology, and generates a task plan in JSON format. The task plan includes multiple tasks to be executed, and the tasks to be executed are sent to the corresponding agents according to the execution order given by the task plan.

[0050] Furthermore, the system has also designed an error correction mechanism. If any task to be executed fails, the intelligent agent executing the task will feedback the failure result to the task planning intelligent agent, and the task planning intelligent agent will regenerate a new task plan based on the feedback failure information.

[0051] In one embodiment, a specific task can be given to the task planning agent through the following prompt words.

[0052] System prompt: 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 requirements, {data_description} is the data description, and {save_path} is the path to save the drawing results.

[0058] Here, the task planning agent needs to give a task plan in json format based on the content of the drawing data and drawing requirements provided by the user. This format can be parsed and executed by the code.

[0059] In order to increase the success rate of the model and provide a more reasonable plan, the above implementation also provides several commonly used Tasks to call the corresponding agents. They are env select corresponding to the environment selection agent, data analysis corresponding to the data analysis agent, and doc search corresponding to the code function search agent. For greater flexibility, you can also customize the task type to deal with complex situations.

[0060] During the execution of the planned tasks, if one of the pending tasks fails, the failure content will be returned to the task planning agent, and the task planning agent will re-plan the task flow of this drawing task.

[0061] In operation S220, according to the task plan, the environment selection agent selects a programming language suitable for this drawing task as a 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 similar cases, and selects a 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 a database or a preset case library. By comparing the programming languages, data structures, and image types used in the cases, the agent selects the language environment that is most suitable for implementing the function, and feeds the results back to the task planning agent to update the execution path of subsequent tasks. In one embodiment, the programming language environment includes Python or R.

[0063] In one embodiment, the prompting instructions passed by the task planning agent to the environment selection agent are as follows:

[0064] System prompt words: 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 anasync function. You MUST use the same programming languages ​​for all the tasks.

[0065] User prompt words:

[0066]

[0067]

[0068] Among them, the prompt word after "Current Task" is generated by the task planning agent. The task planning agent generates different prompts according to different drawing tasks. For example, this task is to draw the ROC curve.

[0069] The search process can use the RAG search tool to enhance the search and find 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 search results and the knowledge of the large model itself to determine the programming environment recommendation results.

[0070] At this point, you can ask the model to output a section of the target environment's function code to facilitate location information and start the corresponding Jupyter Notebook environment kernel.

[0071] The environment selection agent will also feed back the environment recommendation results to the task planning agent; based on the environment recommendation results, the task planning agent updates the execution path of subsequent tasks in the task planning.

[0072] In addition, most scientific drawings may involve more complex algorithm implementation logic, which is generally implemented using functions in various existing libraries. For example, the ROC curve has corresponding implementation functions in the sklearn library of Python and the pROC library of R. In this case, the Python environment can be given priority. For another example, the nomogram of logistic regression has an implementation function in the rms library of R, but there is no similar implementation function in Python. In this case, the R language environment is selected, and the relevant functions can be called in this environment. Therefore, if the image type of this drawing task can be implemented in both Python and R language environments, Python is preferred as the recommended language environment. This is because LLM uses more Python data in the pre-training process, and its Python code capabilities are stronger.

[0073] In operation S230, according to the task planning and environment recommendation results, the code generation and execution agent generates codes that meet the requirements and executes them in a corresponding programming environment to generate the final drawing result.

[0074] The code generation agent uses the RAG search tool to search the pre-stored vector database; based on the code templates and library functions found in the vector database, it generates code that meets the requirements; it passes the generated code to the JupyterNotebook environment kernel and executes the code using the corresponding programming language.

[0075] In the implementation, the code generation and execution agent first generates data processing and drawing codes by analyzing user requirements and task planning. The code generator generates codes based on predefined code templates and library functions. After the code is generated, the agent passes the code to the Jupyter Notebook kernel to run and obtain the execution results.

[0076] In one implementation, the prompt guide for the current task is as follows:

[0077] System prompt words: 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 anasync function. You MUST use the same programming languages ​​for all the tasks.

[0078] User prompt words:

[0079]

[0080]

[0081]

[0082] The content after "User Requirement", "Finished Tasks", and "code" in the code line is obtained based on the actual drawing task, which is explained by the text in "[]" in the code line. The prompt word after "Current Task" in the code line is generated by the task planning agent, and there will be different prompts depending on different drawing tasks. For example, this task is to draw and save the graphics according to the aforementioned user requirements.

[0083] Furthermore, due to the high difficulty of code generation, an error correction mechanism is also set up inside the code generation and operation agent to automatically handle code errors, that is, if an error occurs when executing the code, the error information 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 error information. 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, etc. These specific tasks are scheduled by the task planning agent.

[0085] In addition, for the sake of flexibility and compatibility, data is transmitted between agents using plain text prompts for communication, and each agent can obtain the execution results of all previous tasks.

[0086] In the above implementation, RAG technology is used to enhance the search and build a vector database for scientific drawing. In the database, not only the common drawing functions of Python and R languages ​​are collected, but also a large number of pictures of multiple types. For each picture in the database, the picture type (i.e., picture name) is included, and the programming language, parameter document, and drawing example corresponding to the picture of this type are associated to enhance the capabilities of LLM. When the agent uses this tool, it can obtain the corresponding information by searching using the picture type, thereby enhancing the search for similar cases, and using the embedding model of the large language model to extract the picture type as the entry for vector search to cope with the flexibility of user input, such as box plots and box plots, which are actually the same 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 the specific task requirements. This overcomes the limitation of the multi-agent system in the prior art that it can only run in a single preset environment, and improves the intelligence level of the system. On the basis of the multi-agent collaborative system, special optimization is carried out for the specific task of scientific drawing. By building 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 user needs.

[0088] Based on the same inventive concept, the present disclosure also provides a scientific drawing system based on multi-agent collaboration, as shown below. Figure 3 Provide explanation.

[0089] Figure 3The block diagram of the scientific drawing system 300 according to the embodiment of the present disclosure is schematically shown. The system 300 can be implemented as part or all of an electronic device through software, hardware or a combination of both.

[0090] like Figure 3 As 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 this 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 a programming environment recommendation result according to the task plan.

[0093] The code generation and execution agent 330 is used to generate codes that meet the requirements according to the task planning and programming environment recommendation results, and execute them in the corresponding programming environment to generate the final drawing results.

[0094] Preferably, the scientific drawing system 300 further includes a RAG search tool 340 for searching similar cases of the current drawing task and searching for code templates and library functions required for code generation from a pre-stored vector database.

[0095] Furthermore, the scientific mapping system 300 may also include an input unit 350 and an output unit 360 to achieve human-computer interaction.

[0096] The input unit 350 is used to receive drawing data and drawing requirements uploaded by users.

[0097] The output unit 360 is used to visually display the final drawing result.

[0098] Based on the above scientific drawing system, a process of using the system to perform scientific drawing tasks is shown as follows: Figure 4 shown. Figure 5 A sample interface for implementing user interaction is given.

[0099] according to Figure 4 , 5, the user uploads the analysis file, file description and drawing requirements through the interactive interface, and then the task planning agent gives the task plan. According to the planned task plan, the environment selection agent finds the most suitable programming environment, the code generation agent displays the file content, writes the code and draws, and finally outputs and displays the drawing results through the human-computer interaction interface. In this process, if a task fails to execute, 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 ability of 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 is automatically recommended according to the specific task requirements. This overcomes the limitation of the multi-agent system in the prior art that it can only run in a single preset environment, and improves the intelligence level of the system. On the basis of the multi-agent collaborative system, special optimization is carried out for the specific task of scientific drawing. By building 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 user needs.

[0101] In another aspect, the present disclosure further provides an electronic device, comprising:

[0102] at least one processor; and,

[0103] a memory communicatively connected to the at least one processor; wherein,

[0104] The memory stores instructions that can be executed 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 perform the various methods described above.

[0105] This specification also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system in the above embodiment; or a computer-readable storage medium that exists independently and is not assembled into a device. The computer-readable storage medium stores one or more programs, and the programs are used by one or more processors to execute the method of the embodiment of the present invention.

[0106] Another aspect of the present disclosure also provides a computer program, which, when executed by a processor, enables the processor to implement the various methods described above.

[0107] The above describes specific embodiments of the present disclosure. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some 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, and the same or similar parts between the embodiments can be referred to each other, and 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, and the relevant parts can be referred to the partial description of the method embodiments.

[0109] The system, electronic device, computer storage medium and method provided in the embodiments of the present disclosure correspond to each other. Therefore, the device, electronic device, computer storage medium and computer program also have similar beneficial technical effects as the corresponding method. Since the beneficial technical effects of the method have been described in detail above, the beneficial technical effects of the corresponding device, electronic device and non-volatile computer storage medium will not be repeated here.

[0110] The units or modules involved in the embodiments described in the present disclosure may be implemented by software or programmable hardware. The units or modules described may also be set in a processor, and the names of these units or modules do not constitute limitations on the units or modules themselves in some cases.

[0111] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present disclosure is not limited to the technical solution formed by a specific combination of the above technical features, but should also cover 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 above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other.

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; According to the task planning and programming environment recommendation results, 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.

2. The scientific drawing method according to claim 1, characterized in that: 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 the RAG search tool to find similar cases for this drawing task; Compare the programming languages, data structures, and image types used in this drawing task and similar cases described above; Based on the comparison results, a programming language suitable for this drawing task is selected as the programming environment recommendation result.

3. The scientific drawing method according to claim 2, 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.

4. 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.

5. The scientific drawing method according to claim 1, characterized in that: 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.

6. The scientific drawing method according to claim 5, 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.

7. The scientific drawing method according to claim 5, 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.

8. 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.

9. The scientific drawing method according to claim 8, 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.

10. 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; An 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; The code generation and execution agent is used to generate code that meets the requirements according to the task planning and the programming environment recommendation results, and execute it in the corresponding programming environment to generate the final drawing result.

11. The scientific mapping system according to claim 10, 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.

12. The scientific mapping system according to claim 10, 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.

13. 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 9.

Citation Information

Patent Citations

  • Artificial intelligence reinforcement learning service system

    CN113377355A

  • Personalized traffic report dynamic generation method and device based on AI intelligent agent and medium

    CN117785965A

  • Navigation process code generation method based on artificial intelligence

    CN118409742A

  • Military intelligent software automatic translation method based on multi-agent cooperation

    CN118519640A

  • System and method for information recommendation

    US20190213194A1

Cited By

  • Biological information drawing system based on multiple agents

    CN120339451A

  • Property operation report generation method and device based on multiple agents, and related medium

    CN121212109A

  • Method and device for generating a property operation report based on multiple agents, and related medium

    CN121212109B