Large-model multi-agent collaborative machine manufacturing knowledge question-answering method

Through the large-model multi-agent collaborative method and multi-step reasoning strategy, combined with sparse and intensive search, the knowledge blind spots and efficiency problems of a single large-model in the knowledge question and answer in the field of mechanical manufacturing are solved, achieving more efficient and accurate knowledge retrieval and answer generation .

CN119227817AActive Publication Date: 2024-12-31CHINA JILIANG UNIV

Patent Information

Application Number
CN202411757786.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2024-12-31
Estimated Expiration
2044-12-03

AI Technical Summary

Technical Problem

A single large model has problems such as blind spots in knowledge questions and answers in the field of mechanical manufacturing. The existing blocking strategy leads to incomplete context and low knowledge retrieval efficiency, and fuzzy retrieval calculations, which affects the accuracy of the answer.

Method used

Using the large-model multi-agent collaborative method, the central agent is responsible for problem decomposition and parallel or serial strategies. The search agent improves the knowledge recall through multi-step reasoning and sparse and dense retrieval, and uses dynamic programming Levenshtein distance algorithm and text semantic segmentation. The answer is accurate and efficient.

Benefits of technology

Improve the timeliness and accuracy of knowledge in the field of mechanical manufacturing, enhance the multi-step reasoning ability of complex problems, optimize task allocation and collaboration, improve the efficiency and accuracy of knowledge retrieval, enhance the reliability of answers and Professionalism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227817A_ABST
    Figure CN119227817A_ABST
Patent Text Reader

Abstract

The invention discloses a large-model multi-agent collaborative machine manufacturing knowledge question-answering method, which belongs to the technical field of computers, and comprises the following steps of: acquiring and inputting a problem in the field of machine manufacturing and a preset strategy configuration cue word into a central agent to judge whether to adopt a parallel strategy to solve the problem; the central agent determines that a problem decomposition mode is divided into parallel decomposition and serial decomposition according to whether a parallel strategy is adopted or not; for parallel decomposition, the central agent splits the question into a plurality of independent sub-questions and inputs the sub-questions into a retrieval agent multi-step reasoning module, answers corresponding to the sub-questions are obtained respectively, and finally the answers of the sub-questions are input into the central agent to obtain a final answer; and for serial decomposition, the central agent splits the question into a series of ordered solution steps according to a logic sequence, inputs the question which is firstly split into a multi-step reasoning module of the retrieval agent, then splits a new question according to an obtained answer and an original question, and the rest are done in the same manner until a final answer is obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of computer technology, and specifically relates to a large-model multi-agent collaborative mechanical manufacturing knowledge question-answering method. Background Art

[0002] With the rapid development of artificial intelligence technology, especially the breakthrough in deep learning, the application of large language models (big models) has become a key force in promoting innovation in many fields. With its powerful representation and generalization capabilities, big models have demonstrated excellent performance in multiple tasks such as text generation, sentiment analysis, and machine translation. Using artificial intelligence big model technology to solve specific problems in the field of mechanical manufacturing can comprehensively improve the problem response speed and production efficiency in the field of mechanical manufacturing.

[0003] Due to the professional and time-sensitive characteristics of knowledge in the field of mechanical manufacturing, as well as the high complexity and dynamic changes of knowledge problems in the field of mechanical manufacturing, a single general large model faces certain limitations. On the one hand, the general large model is based on a fixed training data set, and its knowledge base is static and difficult to update in real time. Therefore, when dealing with emerging knowledge or knowledge in a specific field, there may be knowledge blind spots, resulting in inaccurate answers. On the other hand, when faced with complex and diverse knowledge question-and-answer tasks, a single large model has obvious limitations and often finds it difficult to balance efficiency and effectiveness. In mechanical manufacturing knowledge question-and-answer tasks that require multi-step reasoning or multi-source knowledge integration, a single large model is difficult to provide accurate and comprehensive answers.

[0004] When building a knowledge base, the text needs to be segmented. Existing segmentation strategies usually rely on punctuation and preset text length, which will lead to incomplete context and contain too much irrelevant information, thereby reducing the efficiency and accuracy of knowledge retrieval and affecting the quality of the final answer. In the knowledge recall stage, existing methods use a single-path recall method, and the knowledge recall effect is not good. In fuzzy retrieval such as keyword-based knowledge retrieval, existing methods compare the similarity of two strings by calculating the "edit distance" between the two strings. The calculation is redundant and increases processing time. Summary of the invention

[0005] In order to solve the shortcomings of the prior art, improve the timeliness and accuracy of knowledge in the field of mechanical manufacturing of large models, enhance the multi-step reasoning ability when dealing with complex problems, optimize task allocation and collaboration in multi-agent systems, and improve the efficiency and accuracy of knowledge retrieval, the present invention adopts the following technical solutions:

[0006] A large-model multi-agent collaborative mechanical manufacturing knowledge question-answering method includes the following steps:

[0007] Step 1: Obtain the problem in the field of mechanical manufacturing, input it and the preset strategy configuration prompt words into the central intelligent agent, and the central intelligent agent determines whether to use the parallel strategy to solve the problem;

[0008] Step 2: The central agent determines the decomposition method of the problem according to the problem execution strategy, and the decomposition method includes parallel decomposition;

[0009] Step 3: For the parallel decomposition method of the problem, the central intelligent agent splits the problem into multiple independent sub-problems and inputs them into the retrieval agent for multi-step reasoning to obtain the answers to the corresponding sub-problems respectively, and then inputs the answers to the multiple sub-problems into the central intelligent agent to obtain the final answer.

[0010] Furthermore, the strategy configuration prompts in step 1 are the description texts of the two execution strategies and the specific reasoning steps, which are used to guide the model to think and respond in an organized manner when facing complex problems. The construction of the central intelligent agent includes the following steps:

[0011] Step 1.1: Obtain various types of questions in the field of mechanical manufacturing and classify them according to the complexity of the questions and the question type. According to the complexity, they are divided into simple reasoning questions and complex reasoning questions. According to the question type, they are divided into single-choice questions, multiple-choice questions and short-answer questions;

[0012] Step 1.2: Construct a multi-step reasoning dataset for mechanical manufacturing problems suitable for the central agent, including the central agent serial reasoning dataset and the central agent parallel reasoning dataset. Set the prompt word format obtained by the large model through the parallel reasoning dataset to define the task strategy to be completed by the large model, and set the format of user input content and large model answer content;

[0013] Step 1.3: Use the central agent serial reasoning dataset and the central agent parallel reasoning data to fine-tune the Qwen2.5-14b large language model. Train the large language model through a dataset of a defined format. By learning a large number of dialogue rounds, the large language model can learn how to decompose user input questions and how to generate appropriate responses based on the questions. The loss value is calculated based on the difference between the model output and the expected output. When the loss value in the training process stabilizes after multiple iterations and no longer decreases significantly, stop the model training, and use the model state at this time as the final training result to obtain the central agent model.

[0014] Furthermore, in step 1.1, a simple reasoning problem refers to a problem that does not contain sub-problems and a problem that can be decomposed into multiple parallel sub-problems; a complex reasoning problem refers to a problem that can be decomposed into multiple serial sub-problems.

[0015] Furthermore, the format of the central agent parallel reasoning data set is:

[0016] System Prompt:

[0017] Step 1: Parallel decomposition of the original problem into multiple independent sub-problems; Step 2: Answer the original question based on the answers to the multiple sub-problems;

[0018] User Content:

[0019] Original question;

[0020] Assistant Content:

[0021] The large model decomposes the original problem in parallel into multiple sub-problems according to step 1 of the prompt word;

[0022] User Content:

[0023] Answers to multiple sub-questions;

[0024] Assistant Content:

[0025] The large model obtains the answer to the original question based on the answers to multiple sub-questions according to step 2 of the prompt word;

[0026] Among them, System Prompt represents the prompt word input to the big model, defining the task strategy to be completed; User Content represents the content input by the user (the content input to the big model); Assistant Content represents the content answered by the big model; a decomposition strategy is obtained based on the question, and a set of sub-questions and their corresponding answers are obtained according to the decomposition strategy, thereby obtaining the answer to the final question.

[0027] Furthermore, the multi-step reasoning data set also includes a central agent serial reasoning data set, and the central agent serial reasoning data set and the central agent parallel reasoning data set are used to perform fine-tuning training on the Qwen2.5-14b large language model;

[0028] For the serial decomposition method of the problem, the central intelligent agent breaks down the problem into a series of orderly solution steps in a certain logical order. It first breaks down problem 1 and inputs problem 1 into the multi-step reasoning module of the retrieval agent to get the answer to problem 1. Then the central intelligent agent breaks down problem 2 based on the answer to problem 1 and the original problem, and so on, until the final answer is obtained.

[0029] Furthermore, the format of the central agent serial reasoning data set is:

[0030] System Prompt:

[0031] Step 1: Decompose the original question in series, split the original question in logical order, and first split the first question; Step 2: Determine whether the answer to the first question can answer the original question, if so, directly generate the answer to the original question, otherwise, generate the second question based on the original question and the answer to the first question, and so on, until the final answer to the original question is generated;

[0032] User Content:

[0033] Original question;

[0034] Assistant Content:

[0035] The large model serially decomposes the original question according to step 1 of the prompt word to obtain the first question;

[0036] User Content:

[0037] The answer to the first question:

[0038] Assistant Content:

[0039] The large model generates an answer to the original question when it can answer the original question, or generates a second question when it cannot answer the original question, according to the answer to the first question in step 2 of the prompt word;

[0040] User Content:

[0041] The answer to the second question:

[0042] Assistant Content:

[0043] The large model makes a judgment based on the answer to the second question according to the prompt word step 2, and generates the answer to the original question or the answer to the third question, and so on, until the final answer to the original question is obtained;

[0044] Among them, System Prompt represents the prompt word input to the big model, defining the task strategy to be completed; User Content represents the content input by the user (the content input to the big model); Assistant Content represents the content answered by the big model; a decomposition strategy is obtained based on the question, and a set of sub-questions and their corresponding answers are obtained according to the decomposition strategy, thereby obtaining the answer to the final question.

[0045] Furthermore, in step 3, the multi-step reasoning of the retrieval agent includes the following steps:

[0046] Step 3.1: Obtain the search question and search prompt words, extract keywords and search phrases according to the search question, and assign weights to each keyword;

[0047] Step 3.2: Perform sparse search on search keywords and weights, and perform dense search on search phrases;

[0048] Step 3.3: Input the retrieved knowledge into the retrieval agent. The retrieval agent will evaluate whether the retrieved knowledge is sufficient to accurately answer the question and decide whether further query is needed. If further query is needed, the retrieval agent will regenerate more accurate or extended keywords and phrases based on the existing retrieval results and repeat steps 3.2 and 3.3 until the retrieval agent confirms that it has obtained sufficient information to generate answers to sub-questions. If further query is not needed, the retrieval agent will directly generate answers to sub-questions based on the existing retrieval results.

[0049] Furthermore, we obtain problems in the field of mechanical manufacturing, extract sub-problems, and construct a multi-step reasoning dataset suitable for retrieval agents. The dataset format is:

[0050] System Prompt:

[0051] Step 1: Extract keywords and search phrases from the question and assign weights to each keyword; Step 2: Based on the relevant knowledge retrieved by the keywords and search phrases, evaluate whether the relevant knowledge is accurate enough to answer the question and decide whether further queries are needed; if necessary, regenerate new keywords and search phrases; if not, answer the question based on the relevant knowledge, and so on, iterate the logic of steps 1 and 2 until the final relevant knowledge is generated to answer the question;

[0052] User Content:

[0053] question;

[0054] Assistant Content:

[0055] The large model extracts keywords and search phrases based on the search prompt words in step 1;

[0056] User Content:

[0057] Related knowledge texts retrieved based on keywords and related knowledge texts retrieved based on search phrases;

[0058] Assistant Content:

[0059] The large model uses the step 2 of the search prompt words to retrieve relevant knowledge texts that are sufficient to accurately answer the question based on the keywords and the search phrases;

[0060] Among them, System Prompt represents the search prompt word input to the big model, defining the task strategy to be completed; User Content represents the content input by the user (the content input to the big model); Assistant Content represents the content answered by the big model; based on the task strategy, the search answer is obtained.

[0061] The Qwen2.5-14b large language model was fine-tuned using the retrieval agent multi-step reasoning dataset to obtain the retrieval agent model.

[0062] Furthermore, the sparse search in step 3.2 includes the following steps:

[0063] Step 3.2.1.1: Obtain knowledge text in the field of mechanical manufacturing and perform text segmentation to obtain multiple short texts;

[0064] Step 3.2.1.2: Use the Levenshtein distance algorithm based on dynamic programming to calculate the similarity between keywords and short texts. Using dynamic programming to optimize the Levenshtein distance algorithm can reduce space complexity and improve performance. The specific implementation of the Levenshtein distance algorithm based on dynamic programming is as follows:

[0065] Step 3.2.1.2.1: Initialization:

[0066] set up is a keyword string of length m, A short text string of length n;

[0067] Use the previous row array and the current row array :

[0068] Initializing an Array ,

[0069] Initializing an Array ,

[0070] Step 3.2.1.2.2: Calculate the string character by character based on dynamic programming method and The minimum edit distance at each position; by traversing For each character of For each character of The minimum edit distance is calculated for each character in a loop:

[0071]

[0072] in,

[0073] Step 3.2.1.2.3: Update status:

[0074] Update row data:

[0075] After calculating the data of the current row, save the data of the current row as the data of the previous row, that is, update the array current of the current row to the array previous of the previous row, so that the result of the previous row can be used in the next calculation, which can realize the dependency of dynamic programming and save space at the same time;

[0076] Step 3.2.1.2.4: Calculate the final Levenshtein distance:

[0077]

[0078] Among them, after iterating over all rows, Contains the final result, that is, the string All characters of The minimum edit distance for all character matches;

[0079] Step 3.2.1.2.5: Calculate the similarity score:

[0080]

[0081] Step 3.2.1.3: Traverse all short texts, calculate their similarity with multiple keywords, and return texts with similarity higher than the threshold; for the short text set Each short text in , if there is a keyword set A keyword in , so that the short text With the keywords Similarity between Greater than the set threshold , then the short text will be included in the result set The implementation formula is as follows:

[0082]

[0083]

[0084] in, Represents a collection of short texts, , It is A short text; Represents a set of keywords. , It is Keywords; Indicates the calculation of short text With keywords The similarity between Indicates The weight of the keywords, Indicates the set similarity threshold; It is a set of short texts that meet the conditions, that is, a set of short texts whose similarity is higher than the threshold.

[0085] Furthermore, the intensive search in step 3.2 includes the following steps:

[0086] Step 3.2.2.1: Obtain knowledge text in the field of mechanical manufacturing, and use a large model-based text semantic segmentation method to segment the knowledge text in the field of mechanical manufacturing into text blocks, which specifically includes the following steps:

[0087] Step 3.2.2.1.1: Segment the input text into sentences to obtain multiple sentences;

[0088] Such as sentence 1, sentence 2, sentence 3... until sentence n. Sentence set It can be expressed as:

[0089]

[0090] Step 3.2.2.1.2: Starting from the first sentence, take the current sentence, the next sentence and the preset semantic segmentation prompt words as input;

[0091] enter It can be expressed as:

[0092]

[0093] Step 3.2.2.1.3: Pass the input to the text semantic segmentation model (SplitLLM). The text semantic segmentation model decides whether to merge two sentences into a larger paragraph (block) or split (remain independent) based on the semantics of the sentences. The text semantic segmentation model uses the Qwen2.5-14b large language model. The decision of the text semantic segmentation model ( ) process can be expressed as:

[0094]

[0095] Step 3.2.2.1.4: If concatenation is decided, the previous sentence (such as sentence 1) and the next sentence (such as sentence 2) are merged into a block (such as block 1), and then the merged block (such as block 1) and the next sentence (such as sentence 3) and the semantic segmentation prompt words are input into the text semantic segmentation model again; if segmentation is decided, the next sentence (such as sentence 2) and the next sentence (such as sentence 3) and the semantic segmentation prompt words are directly input into the model;

[0096] The sentence processing process of deciding to merge and split can be expressed as:

[0097]

[0098]

[0099]

[0100]

[0101]

[0102] Step 3.2.2.1.5: Repeat steps 3.2.2.1.2 to 3.2.2.1.4 until all sentences are processed, and finally output all segmented text blocks;

[0103] The collection of segmented text blocks It can be expressed as:

[0104]

[0105] Step 3.2.2.2: Input the segmented text blocks into a semantic vector model to convert them into vector form, and store them in a vector database after indexing. The semantic vector model uses the gte-Qwen2-7B-instruct vector model, and the vector database uses the Faiss vector database.

[0106] Step 3.2.2.3: Input the search phrase into the semantic vector model to obtain the search phrase vector. Recall the relevant text blocks by calculating the semantic similarity between the search phrase vector and the text block vector in the vector database. The semantic similarity is achieved by calculating the cosine similarity between the vectors.

[0107] The advantages and beneficial effects of the present invention are:

[0108] The present invention proposes a large-model multi-agent collaborative mechanical manufacturing knowledge question-answering method, in which a central agent is responsible for receiving, judging and decomposing questions, while a retrieval agent is responsible for answering specific sub-questions through multi-step reasoning. This collaborative mode has a clear division of labor, so that the entire system can efficiently and accurately handle various complex problems; the present invention also proposes a text semantic segmentation method based on a large model, which can more accurately parse the meaning of long texts and reasonably segment the text according to semantics, thereby improving the accuracy of subsequent retrieval and reasoning; the present invention uses an external mechanical manufacturing knowledge base to obtain additional information to assist in the generation of large-model answers, expand the domain knowledge of the large model, and improve the accuracy and professionalism of the answers; the present invention proposes a knowledge two-way recall method that combines sparse retrieval and dense retrieval, and proposes a Levenshtein distance algorithm based on dynamic programming in the sparse retrieval stage, which improves the quality and efficiency of information retrieval and recall in a large-scale mechanical manufacturing knowledge base, thereby enhancing the reliability and professionalism of mechanical manufacturing knowledge answer generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0109] Figure 1 is a flow chart of a method in an embodiment of the present invention.

[0110] Figure 2 It is a schematic diagram of the structure of the multi-step reasoning module of the retrieval agent in an embodiment of the present invention.

[0111] Figure 3 It is a schematic diagram of the structure of a sparse retrieval module in an embodiment of the present invention.

[0112] Figure 4 It is a schematic diagram of the structure of the intensive retrieval module in an embodiment of the present invention.

[0113] Figure 5 It is a structural diagram of a text semantic segmentation module based on a large model in an embodiment of the present invention. DETAILED DESCRIPTION

[0114] The specific implementation of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the present invention, and is not used to limit the present invention.

[0115] like Figure 1 As shown, a large-model multi-agent collaborative mechanical manufacturing knowledge question-answering method of the present invention comprises the following steps:

[0116] Step 1: Obtain a problem in the field of mechanical manufacturing, input the problem in the field of mechanical manufacturing and the preset strategy configuration prompt words into the central intelligent agent, and the central intelligent agent determines whether to adopt a parallel strategy to solve the problem;

[0117] The strategy configuration prompts are the descriptions of the two strategies and the specific reasoning steps, which are used to guide the model to think and respond in an organized manner when facing complex problems. The construction of the central intelligent agent includes the following steps:

[0118] Step 1.1: Obtain various types of mechanical manufacturing field questions. Various types of mechanical manufacturing field questions can be divided into two categories according to the complexity of the questions: simple reasoning questions and complex reasoning questions; according to the question type, they can be divided into single-choice questions, multiple-choice questions and short-answer questions.

[0119] Furthermore, the simple reasoning problems in step 1.1 refer to problems that do not contain sub-problems and problems that can be decomposed into multiple parallel sub-problems. For example: "Fill in the blank: What type of connector does the RRU5152-fad antenna use?", "Short answer question: What is the spindle speed range of the CK6140 CNC lathe, and what are the maximum processing diameter and maximum processing length of the CK6140?", "Multiple choice question: Which of the following interface standards are used for the connection between the following systems?, [A. ALCTEL's G2BSC and NSS are connected using the X25 interface, B. ALCTEL's G2BSC and NSS are connected using the Q3 interface, C. OMCR and NMC are connected using the X25 interface, D. OMCR and NMC are connected using the Q3 interface]".

[0120] The complex reasoning problem in step 1.1 refers to a problem that can be broken down into multiple serial sub-problems. For example: "Fill in the blank: What methods are generally used to achieve the processing accuracy requirements in a production method that rarely uses fixtures?"

[0121] Step 1.2: Construct a multi-step reasoning dataset for mechanical manufacturing problems suitable for the central agent, including a central agent serial reasoning dataset and a central agent parallel reasoning dataset.

[0122] Furthermore, the central agent parallel reasoning dataset format is:

[0123] System Prompt: Two strategies are used to answer questions. Strategy 1: Step 1: First, decompose the question in parallel and split it into multiple independent sub-questions; Step 2: Answer the original question based on the answers to the multiple sub-questions. Strategy 2: Step 1: First, decompose the question in series and split the question in logical order, first splitting the first question; Step 2: Determine whether the original question can be answered based on the answer to question 1. If it can be answered, directly generate the answer. If not, generate question 2 based on the original question and the answer to question 1; Steps 3, 4, etc.: Repeat using the logic of step 2 until the final answer can be generated. User Content: Question: What is the spindle speed range of the CK6140 CNC lathe? What are the maximum processing diameter and maximum processing length of the CK6140? Assistant Content: Step 1, the problem can be decomposed into the following parallel parts: Sub-question 1: 'What is the spindle speed range of the CK6140 CNC lathe?', Sub-question 2: 'What is the maximum processing diameter of the CK6140?', Sub-question 3: 'What is the maximum processing length of the CK6140?'. User Content: The answer to sub-question 1 is: '.....', the answer to sub-question 2 is: '.....', the answer to sub-question 3 is: '.....'. Assistant Content: Step 2: Based on the answers to sub-questions 1, 2, and 3, the answer to the question 'What is the spindle speed range of the CK6140 CNC lathe? What are the maximum processing diameter and maximum processing length of the CK6140?' is '......'.

[0124] System Prompt represents the premise prompt words input to the big model, defining the task to be completed; UserContent represents the content input by the user (the content input to the big model); Assistant Content represents the answer content of the big model. The dialogue model is trained through a dataset in this format, and by learning a large number of dialogue turns, the model learns how to generate appropriate responses based on user input.

[0125] Step 1.2 The format of the central agent serial reasoning dataset is:

[0126] System Prompt: Two strategies are used to answer questions. Strategy 1: Step 1: First, decompose the question in parallel and split it into multiple independent sub-questions; Step 2: Answer the original question based on the answers to the multiple sub-questions. Strategy 2: Step 1: First, decompose the question in series and split the question in logical order, first splitting the first question; Step 2: Determine whether the original question can be answered based on the answer to question 1. If it can be answered, directly generate the answer. If not, generate question 2 based on the original question and the answer to question 1; Steps 3, 4, etc.: Repeat using the logic of step 2 until the final answer can be generated. User Content: Question: What methods are generally used to achieve the processing accuracy requirements in production methods that rarely use fixtures? Assistant Content: Use strategy 1 to answer this question. Step 1, decompose the problem serially, and split question 1 in a logical order: 'What methods are generally used to achieve the processing accuracy requirements in production methods that rarely use fixtures?' User Content: The corresponding answer to question 1: 'The production method that rarely uses fixtures is single-piece small batch production' Assistant Content: Step 2: The answer to question 1 cannot answer the original question, generate question 2: 'What methods are generally used to achieve the processing accuracy requirements in single-piece small batch production' User Content: The corresponding answer to question 2: '......' Assistant Content: Step 2: The answer to question 2 can answer the original question, question: 'What methods are generally used to achieve the processing accuracy requirements in production methods that rarely use fixtures? ' The answer is: '.......'

[0127] Step 1.3: Use the constructed central agent serial reasoning dataset and central agent parallel reasoning data to fine-tune the Qwen2.5-14b large language model, and calculate the loss value based on the difference between the model output and the expected output. When the loss value in the training process stabilizes after multiple iterations and no longer decreases significantly, stop the model training and use the model state at this time as the final training result to obtain the central agent model.

[0128] Step 2: The central agent decides how to decompose the problem based on whether to adopt a parallel strategy, which can be divided into parallel decomposition and serial decomposition.

[0129] Step 3: Process the problem in parallel and serially respectively to get the final answer.

[0130] For the parallel decomposition of problems, the central agent splits the problem into multiple independent sub-problems, and inputs the multiple sub-problems into the multi-step reasoning module of the retrieval agent to obtain the answers to the corresponding sub-problems. Finally, the answers to the multiple sub-problems are input into the central agent to obtain the final answer.

[0131] like Figure 2 As shown in the figure, the implementation of the multi-step reasoning module of the retrieval agent includes the following steps:

[0132] Step 3.1: Input the query question and search prompt words into the search agent. The search agent extracts keywords and search phrases according to the query question, assigns weights to each keyword, and outputs search instructions:

[0133] Search-Keywords = {"k1": w1, "k2": w2, …, "k n ": w n} Search-phrase = {"p1", "p2", …, "p n "} Among them, k1, k2…k n represents keyword 1, keyword 2…keyword n, w1, w2…w n represents the weights of keyword 1, keyword 2…keyword n ​​respectively; p1, p2…p n Represents search phrase 1, search phrase 2, ... search phrase n.

[0134] Furthermore, the construction of the retrieval agent includes the following steps:

[0135] Obtain problems in the field of mechanical manufacturing, extract sub-problems, and construct a multi-step reasoning dataset suitable for retrieval agents. The dataset format is:

[0136] System Prompt: Follow the steps below to complete the task. Step 1: Extract keywords and search phrases from the question and assign weights to each keyword. Step 2: Based on the relevant knowledge retrieved from the keywords and search phrases, evaluate whether the information is accurate enough to answer the question and decide whether further queries are needed. If further queries are needed, regenerate more accurate or expanded keywords and search phrases; if no further queries are needed, answer the question based on the relevant knowledge. Steps 3, 4, and so on: Use the logic of steps 1 and 2 to iterate until a complete and accurate answer can be generated. User Content: Question: How is the timer T3168 sent, and what is its role in the wireless system of GPRSOnePhase? AssistantContent: Step 1, extract keywords and search phrases based on the question: Search-Keywords = {"Timer T3168": 0.9, "Sending method": 0.8, "GPRSOnePhase": 0.8}, Search-phrase = {"Timer T3168 sending method", "The role of timer T3168 in the wireless system of GPRSOnePhase"}. User Content: The relevant knowledge text retrieved based on the keywords is: '.....'; the relevant knowledge text retrieved based on the search phrase is: '.....'. Assistant Content: Step 2: The relevant knowledge text retrieved by the keywords and the relevant knowledge text retrieved by the search phrase are sufficient to accurately answer the question. {"Is it necessary to conduct further query": "No"}. According to the relevant knowledge text, it can be known that the question 'How is the timer T3168 sent, and what is its role in the wireless system of GPRSOnePhase? The answer to ' is '......'

[0137] The Qwen2.5-14b large language model was fine-tuned using the retrieval agent multi-step reasoning dataset to obtain the retrieval agent model.

[0138] Step 3.2: Input the search instruction into the search module to obtain the retrieved knowledge, wherein the search keywords and weights are input into the sparse search module, and the search phrases are input into the dense search module.

[0139] Furthermore, if Figure 3 As shown, the implementation of the sparse retrieval module includes the following steps:

[0140] Step 3.2.1.1: Obtain knowledge text in the field of mechanical manufacturing and perform text segmentation to obtain multiple short texts.

[0141] Step 3.2.1.2: Use the Levenshtein distance algorithm based on dynamic programming to calculate the similarity between keywords and short texts. Using dynamic programming to optimize the Levenshtein distance algorithm can reduce space complexity and improve performance. The specific implementation of the Levenshtein distance algorithm based on dynamic programming is:

[0142] Step 3.2.1.2.1: Initialization:

[0143] set up is a keyword string of length m, A short text string of length n.

[0144] Use the previous row array and the current row array :

[0145] initialization ,

[0146] initialization ,

[0147] Step 3.2.1.2.2: Calculate the string character by character based on dynamic programming method and The minimum edit distance at each position; by traversing For each character of For each character of The minimum edit distance is calculated for each character in a loop:

[0148]

[0149] in,

[0150] Step 3.2.1.2.3: Update status:

[0151] Update row data:

[0152] After calculating the data of the current row, save the data of the current row as the data of the previous row, that is, update the array current of the current row to the array previous of the previous row, so that the result of the previous row can be used in the next calculation, which can realize the dependency of dynamic programming and save space at the same time;

[0153] Step 3.2.1.2.4: Calculate the final Levenshtein distance:

[0154]

[0155] Among them, after iterating over all rows, Contains the final result, that is, the string All characters of The minimum edit distance for all characters to match.

[0156] Step 3.2.1.2.5: Calculate the similarity score:

[0157]

[0158] Step 3.2.1.3: Traverse all short texts to calculate the similarity with multiple keywords, and return the texts with similarity higher than the threshold. The specific implementation is: for the short text collection Each short text in , if there is a keyword set A keyword in , so that and Similarity between Greater than the set threshold , then the short text will be included in the result set The implementation formula is as follows:

[0159]

[0160]

[0161] in, Represents a collection of short texts, , It is A short text; Represents a set of keywords. , It is Keywords; Indicates the calculation of short text With keywords The similarity between Indicates The weight of the keywords, Indicates the set similarity threshold; It is a set of short texts that meet the conditions, that is, a set of short texts whose similarity is higher than the threshold.

[0162] Furthermore, if Figure 4 As shown, the implementation of the dense retrieval module includes the following steps:

[0163] Step 3.2.2.1: Obtain the knowledge text in the field of mechanical manufacturing, and use the text semantic segmentation method based on the large model to segment the knowledge text in the field of mechanical manufacturing into text blocks. Figure 5 As shown in the figure, the implementation of the text semantic segmentation method based on the large model is:

[0164] Step 3.2.2.1.1: Enter long text , and perform sentence segmentation on it to obtain multiple sentences, such as sentence 1, sentence 2, sentence 3... until sentence n. Sentence set It can be expressed as:

[0165]

[0166] Step 3.2.2.1.2: Starting from sentence 1, take the current sentence (such as sentence 1), the next sentence (such as sentence 2) and the preset semantic segmentation prompt as input. It can be expressed as:

[0167]

[0168] Step 3.2.2.1.3: Pass the input of step 3.2.2.1.2 to the text semantic segmentation model (SplitLLM). The text semantic segmentation model decides whether the two sentences should be merged into a larger paragraph (block) or split (remain independent) based on the semantics of the sentences. The text semantic segmentation model uses the Qwen2.5-14b large language model. The decision of the text semantic segmentation model ( ) process can be expressed as:

[0169]

[0170] Step 3.2.2.4: If the decision is to merge, merge the previous sentence (such as sentence 1) and the next sentence (such as sentence 2) into a block (such as block 1), and then input the merged block (such as block 1) and the next sentence (such as sentence 3) and the semantic segmentation prompt words into the text semantic segmentation model again; if the decision is to split, directly input the next sentence (such as sentence 2) and the next sentence (such as sentence 3) and the semantic segmentation prompt words into the model. The sentence processing process of deciding to merge (merge) and deciding to split (split) can be expressed as:

[0171]

[0172]

[0173]

[0174]

[0175]

[0176] Step 3.2.2.5: Repeat steps 3.2.2.2 to 3.2.2.4 until all sentences are processed and all segmented text blocks are output. It can be expressed as:

[0177]

[0178] Step 3.2.2.2: Input the text block obtained in step 3.2.2.1 into the semantic vector model to convert it into vector form, and store it in the vector database after indexing. The semantic vector model uses the gte-Qwen2-7B-instruct vector model, and the vector database uses the Faiss vector database.

[0179] Step 3.2.2.3: Input the search phrase into the semantic vector model to obtain the search phrase vector, and recall the relevant text blocks by calculating the semantic similarity between the search phrase vector and the text block vector in the vector database. The semantic similarity is achieved by calculating the cosine similarity between vectors.

[0180] Step 3.3: Input the knowledge retrieved in step 3.2 into the retrieval agent. The retrieval agent decides whether further queries are needed by evaluating whether the retrieved relevant knowledge is sufficient to accurately answer the question. If further queries are needed, the retrieval agent regenerates more accurate or extended keywords and phrases based on the existing search results. Repeat steps 3.2 and 3.3 until the retrieval agent confirms that sufficient information has been obtained. Once this standard is met, the agent will generate answers to sub-questions based on the retrieved knowledge; if no further queries are needed, the retrieval agent directly generates answers to sub-questions based on the existing search results.

[0181] For the serial decomposition method of the problem, the central intelligent agent breaks down the problem into a series of orderly solution steps in a certain logical order. It first breaks down problem 1 and inputs problem 1 into the multi-step reasoning module of the retrieval agent to get the answer to problem 1. Then the central intelligent agent breaks down problem 2 based on the answer to problem 1 and the original problem. The above operations are repeated until the final answer is obtained.

[0182] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. However, these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method, characterized by The steps include: Step 1: Obtain the problem in the field of mechanical manufacturing and input it and the preset strategy configuration prompt words into the central intelligent agent; Step 2: The central agent determines the decomposition method of the problem according to the problem execution strategy, and the decomposition method includes parallel decomposition; Step 3: For the parallel decomposition method of the problem, the central intelligent agent splits the problem into multiple independent sub-problems and inputs them into the retrieval agent for multi-step reasoning to obtain the answers to the corresponding sub-problems respectively, and then inputs the answers to the multiple sub-problems into the central intelligent agent to obtain the final answer.

2. According to claim 1, a large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method is characterized by: The strategy configuration prompt in step 1 is the description and reasoning steps of the execution strategy. The construction of the central intelligent agent includes the following steps: Step 1.1: Obtain various types of problems in the field of mechanical manufacturing and classify them according to their complexity; Step 1.2: Construct a multi-step reasoning dataset for mechanical manufacturing problems suitable for the central agent, including a parallel reasoning dataset for the central agent. Through the parallel reasoning dataset, set the prompt word format obtained by the large model to define the task strategy to be completed by the large model, and set the format of the user input content and the large model answer content; Step 1.3: Use the central agent parallel reasoning data to fine-tune the large language model so that the large language model can decompose complex problems into multiple parallel sub-problems and generate accurate answers based on the problems to obtain the central agent.

3. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 2 is characterized by: In step 1.1, the problems are divided into simple reasoning problems and complex reasoning problems according to their complexity. Simple reasoning problems refer to problems that do not contain sub-problems and problems that can be decomposed into multiple parallel sub-problems. Complex reasoning problems are those that can be broken down into multiple serial sub-problems.

4. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 2 is characterized by: The format of the central agent parallel reasoning dataset is: System Prompt: Step 1: Parallel decomposition of the original problem into multiple independent sub-problems; Step 2: Answer the original question based on the answers to the multiple sub-problems; User Content: Original question; Assistant Content: The large model decomposes the original problem in parallel into multiple sub-problems according to step 1 of the prompt word; User Content: Answers to multiple sub-questions; Assistant Content: The large model obtains the answer to the original question based on the answers to multiple sub-questions according to step 2 of the prompt word; Among them, System Prompt represents the prompt word input to the big model, defining the task strategy to be completed; UserContent represents the content input by the user, that is, the content input to the big model; Assistant Content represents the content answered by the big model; a decomposition strategy is obtained based on the question, and a set of sub-questions and their corresponding answers are obtained according to the decomposition strategy, thereby obtaining the answer to the final question.

5. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 2 is characterized by: The multi-step reasoning data set also includes a central agent serial reasoning data set, and the central agent serial reasoning data set and the central agent parallel reasoning data set are used to perform fine-tuning training on the large language model; For the serial decomposition method of the problem, the central intelligent agent breaks down the problem into a series of orderly solution steps in a logical order. It first breaks down problem 1 and inputs problem 1 into the multi-step reasoning module of the retrieval agent to get the answer to problem 1. Then the central intelligent agent breaks down problem 2 based on the answer to problem 1 and the original problem, and so on, until the final answer is obtained.

6. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 5 is characterized by: The format of the central agent serial reasoning dataset is: System Prompt: Step 1: Decompose the original question in series, split the original question in logical order, and first split the first question; Step 2: Determine whether the answer to the first question can answer the original question, if so, directly generate the answer to the original question, otherwise, generate the second question based on the original question and the answer to the first question, and so on, until the final answer to the original question is generated; User Content: Original question; Assistant Content: The large model serially decomposes the original question according to step 1 of the prompt word to obtain the first question; User Content: The answer to the first question: Assistant Content: The large model generates an answer to the original question when it can answer the original question, or generates a second question when it cannot answer the original question, according to the answer to the first question in step 2 of the prompt word; User Content: The answer to the second question: Assistant Content: The large model makes a judgment based on the answer to the second question according to the prompt word step 2, and generates the answer to the original question or the answer to the third question, and so on, until the final answer to the original question is obtained; Among them, System Prompt represents the prompt word input to the big model, defining the task strategy to be completed; UserContent represents the content input by the user, that is, the content input to the big model; Assistant Content represents the content answered by the big model; a decomposition strategy is obtained based on the question, and a set of sub-questions and their corresponding answers are obtained according to the decomposition strategy, thereby obtaining the answer to the final question.

7. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 1 is characterized by: In step 3, the multi-step reasoning of the retrieval agent includes the following steps: Step 3.1: Obtain the search question and search prompt words, extract keywords and search phrases according to the search question, and assign weights to each keyword; Step 3.2: Perform sparse search on search keywords and weights, and perform dense search on search phrases; Step 3.3: Input the retrieved knowledge into the retrieval agent. The retrieval agent will evaluate whether the retrieved knowledge is sufficient to accurately answer the question and decide whether further query is needed. If further query is needed, the retrieval agent will regenerate keywords and phrases based on the existing retrieval results and repeat steps 3.2 and 3.3 until the retrieval agent confirms that it has obtained sufficient information to generate answers to sub-questions. If further query is not needed, the retrieval agent will directly generate answers to sub-questions based on the existing retrieval results.

8. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 7 is characterized by: Obtain problems in the field of mechanical manufacturing, extract sub-problems, and construct a multi-step reasoning dataset suitable for retrieval agents. The dataset format is: System Prompt: Step 1: Extract keywords and search phrases from the question and assign weights to each keyword; Step 2: Based on the relevant knowledge retrieved by the keywords and search phrases, evaluate whether the relevant knowledge is accurate enough to answer the question and decide whether further queries are needed; if necessary, regenerate new keywords and search phrases; If not, answer the question based on relevant knowledge, and so on, iterating the logic of steps 1 and 2 until the final relevant knowledge answer question is generated; User Content: question; Assistant Content: The large model extracts keywords and search phrases based on the search prompt words in step 1; User Content: Related knowledge texts retrieved based on keywords and related knowledge texts retrieved based on search phrases; Assistant Content: The large model uses the step 2 of the search prompt words to retrieve relevant knowledge texts that are sufficient to accurately answer the question based on the keywords and the search phrases; Among them, System Prompt represents the search prompt word input to the big model, defining the task strategy to be completed; User Content represents the content input by the user, that is, the content input to the big model; Assistant Content represents the content answered by the big model, and the search answer is obtained based on the task strategy; The large language model is fine-tuned using the retrieval agent multi-step reasoning dataset to obtain the retrieval agent.

9. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 7 is characterized by: The sparse search in step 3.2 includes the following steps: Step 3.2.1.1: Obtain knowledge text in the field of mechanical manufacturing and perform text segmentation to obtain multiple short texts; Step 3.2.1.2: Use a distance algorithm based on dynamic programming to calculate the similarity between keywords and short texts: Step 3.2.1.2.1: Initialization: set up is a keyword string of length m, A short text string of length n; Use the previous row array and the current row array : initialization , initialization , Step 3.2.1.2.2: Calculate the string character by character based on dynamic programming method and The minimum edit distance at each position; by traversing For each character of For each character of The minimum edit distance is calculated for each character in a loop: , in, , Step 3.2.1.2.3: Update status: Update row data: , After calculating the data of the current row, save the data of the current row as the data of the previous row, that is, update the array current of the current row to the array previous of the previous row; Step 3.2.1.2.4: Calculate the final Levenshtein distance: , Among them, after iterating over all rows, Contains the final result, that is, the string All characters of The minimum edit distance for all character matches; Step 3.2.1.2.5: Calculate the similarity score: , Step 3.2.1.3: Traverse all short texts, calculate their similarity with multiple keywords, and return texts with similarity higher than a threshold; for a short text in a short text set, if there is a keyword in the keyword set such that the similarity between the short text and the keyword is greater than a set threshold, the short text will be included in the result set.

10. The large-scale multi-agent collaborative mechanical manufacturing knowledge question-answering method according to claim 7 is characterized by: The intensive search in step 3.2 includes the following steps: Step 3.2.2.1: Obtain the knowledge text in the field of mechanical manufacturing, and use the text semantic segmentation method based on the large model to segment the knowledge text in the field of mechanical manufacturing into text blocks, which specifically includes the following steps: Step 3.2.2.1.1: Segment the input text into sentences to obtain multiple sentences; Step 3.2.2.1.2: Starting from the first sentence, take the current sentence, the next sentence and the preset semantic segmentation prompt words as input; Step 3.2.2.1.3: Pass the input to the text semantic segmentation model, which decides whether to merge or segment two sentences based on the semantics of the sentences; Step 3.2.2.1.4: If concatenation is decided, the previous sentence and the next sentence are merged into a block, and then the merged block, the next sentence and the semantic segmentation prompt words are input into the text semantic segmentation model again; if segmentation is decided, the next sentence, the next sentence and the semantic segmentation prompt words are directly input into the model; Step 3.2.2.1.5: Repeat steps 3.2.2.1.2 to 3.2.2.1.4 until all sentences are processed, and finally output all segmented text blocks; Step 3.2.2.2: Input the segmented text blocks into a semantic vector model to convert them into vector form, and store them in a vector database after indexing; Step 3.2.2.3: Input the search phrase into the semantic vector model to obtain the search phrase vector, and recall the relevant text blocks by calculating the semantic similarity between the search phrase vector and the text block vector in the vector database.

Citation Information

Patent Citations

  • Question and answer method and device, electronic equipment and storage medium

    CN116860941A

  • Question and answer method and device, electronic equipment and storage medium

    CN116955561A

  • Knowledge vector library construction method, device, equipment, system and storage medium

    CN117422136A

  • Power knowledge service method and device for multi-path recall retrieval, equipment and medium

    CN118733732A

  • Knowledge intensive question reasoning and generating method based on LLM

    CN118798367A

Cited By

  • Open type problem implicit intention recognition method and system based on multi-agent reasoning

    CN119621916A

  • Multi-agent system conformity diagnosis and elimination method, product, medium and equipment

    CN119990174A

  • Multi-order question answering method, system and device

    CN120179793A

  • Knowledge question and answer game content generation method and device and electronic equipment

    CN120258149A

  • Deep search method and device, equipment and medium

    CN120596636A