A tea garden management method, device and equipment based on a large model agent
Patent Information
- Application Number
- CN202610652398.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-13
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2046-05-13
AI Technical Summary
本发明首先通过对用户任务指令的解析、分类及实体参数提取,生成任务结构化语义表示,精准把握茶园管理需求,将任务分解为有序子任务并生成初步执行策略,使复杂任务得以细化处理,增强任务执行的条理性和可操作性。从长期记忆库检索知识与历史数据等多模态数据,并对多模态数据进行相关性及质量评估、加权融合生成综合特征表示,能全面准确把握任务关键信息。构建决策上下文并利用茶叶大模型推理生成最终执行方案,可确保方案贴合实际且具备完整性和可执行性。最后,依据方案调用工具设备执行任务,通过结果评估与策略调整形成闭环控制,保证任务顺利推进,最终整合结果输出响应,该方法构建了“任务理解一任务规划一任务执行一反馈调优一长期记忆积累”的智能闭环工作流,其中在任务执行中会调用各种工具来完成子任务。不仅增强了智能体处理复杂任务的能力,同时也通过结果评估和反馈机制确保了任务执行的可靠性,围绕茶园管理者实际需求,实现从任务规划、工具调用到执行反馈的完整闭环,提升茶园管理效率和质量。
Smart Images

Figure CN122175325B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of agricultural artificial intelligence technology, specifically relating to a tea garden management method, device, and equipment based on a large-scale intelligent agent model. Background Technology
[0002] Tea, as a traditional advantageous agricultural product in my country, has a cultivation process that mainly includes seedling cultivation, planting, pruning, fertilization, irrigation, harvesting, and pest and disease control. For a long time, tea cultivation and decision-making have relied primarily on manual experience and expert knowledge. However, this traditional management model has several limitations: delayed information access, lack of real-time control capabilities, and limited experience and knowledge among managers. In particular, the accurate judgment of the timing of irrigation and fertilization during the tea tree growth process is crucial; experience-based management easily leads to unstable tea production quality, thus seriously affecting both yield and quality.
[0003] In recent years, with the rapid development of artificial intelligence technology, large language models and multimodal learning have been gradually integrated into tea planting and production, providing a new technological path for the intelligent transformation of the traditional tea industry. Existing general-purpose large models can already achieve common tea knowledge question answering, providing users with basic consulting services.
[0004] However, existing large language models are all general-purpose models with limited coverage of professional knowledge in the tea field, resulting in insufficient domain knowledge and low accuracy in responses. For example, patent document (CN120475055A) discloses a general IoT sensing command and dispatch method. While it also involves task decomposition, it is mainly applied to security and emergency fields such as urban utility tunnels and fire protection. Its data fusion uses general methods such as Kalman filtering, and task decomposition relies on HTN planning. It does not model the complex environment-biological interactions in agricultural planting scenarios, especially the tea tree growth cycle. Another example is patent document (CN121212278A), which discloses an automatic agent orchestration method based on a large language model. This method assigns agents through vector matching and uses event-driven anomaly monitoring. However, this method is also a general orchestration framework. Its task decomposition and agent allocation are mainly based on general semantic matching, lacking deep integration of tea-related professional knowledge. It cannot handle the problems of inconsistent quality and dynamic changes in task relevance of multimodal data (such as soil moisture, tea tree images, and meteorological data) in tea garden management, nor does it address the knowledge memory and management specific to the phenological stages of tea trees. Therefore, existing technologies have failed to solve the core technical problems in refined tea garden management: how to dynamically evaluate and integrate the value of multi-source heterogeneous data according to task objectives, how to efficiently manage and retrieve knowledge of the entire life cycle of tea trees, and how to organically combine domain rules with the reasoning capabilities of large models for task planning.
[0005] Furthermore, large language models are primarily used for knowledge-based question answering and semantic analysis, lacking a deep understanding of the complex, multi-step tasks in tea cultivation and the ability to execute goal-oriented tasks. This results in agents based on existing large models being unable to perform closed-loop control of task planning, tool invocation, and execution feedback around the actual needs of tea garden managers. Especially when dealing with complex, multi-step tasks, the role of large models is usually limited to generating suggestions or answers, making it difficult for agents to accurately complete the closed-loop response from "understanding the tea garden manager's problem" to "executing specific tasks." Summary of the Invention
[0006] To address the problem of low task completion accuracy of existing large-model-based intelligent agents in tea garden management, this invention provides a tea garden management method, apparatus, and equipment based on large-model intelligent agents.
[0007] To achieve the above objectives, the present invention provides the following technical solution: A tea garden management method based on a large-scale intelligent agent, the method being applied to a large-scale intelligent agent, the method comprising: Get and parse the task instructions for tea garden management issued by the user, determine the task type, extract the task entity and related parameters, and generate a structured semantic representation of the task; Based on the structured semantic representation of the task, and by calling a pre-set rule base that stores multiple tea garden management task templates, the task instructions are decomposed into several ordered sub-tasks, and a preliminary execution strategy containing the required data source, execution steps and rules is generated for each sub-task. For each subtask, based on the initial execution strategy, the required sensor data, relevant knowledge, and historical cases are retrieved from a pre-built memory containing knowledge and historical cases in the tea industry. Based on the objectives of sub-tasks, the task relevance and data quality of the sensor data, related knowledge, and historical cases are evaluated to determine the corresponding perception coefficients. Then, the sensor data, related knowledge, and historical cases are weighted and fused according to the perception coefficients to generate a comprehensive feature representation. The perception coefficients are obtained after normalization based on the baseline weights of the multimodal data and the task relevance scores and data quality scores of each modality. Based on the task instructions, the task's structured semantic representation, the preliminary execution strategy, the retrieval results of the memory bank, the comprehensive feature representation, and the currently available tools, a decision context is constructed; and a pre-trained tea model is used to reason about the decision context to generate the final execution plan for each sub-task. The plan includes a specific execution path, a sequence of tool call instructions, input and output parameters, and an exception handling mechanism. According to the final execution plan, call the corresponding tools or physical devices to execute subtasks; evaluate the execution results of subtasks, if the preset goal is achieved, execute the next subtask in sequence, if not, readjust the strategy and execute; after all subtasks are completed, integrate the results and determine whether the final requirements of the task instructions are met, and output the final response.
[0008] Optionally, the memory bank includes a long-term memory bank and a short-term memory bank; The long-term memory adopts a three-layer hybrid architecture for knowledge in the tea industry, including an L0 layer for storing raw sensor data, related knowledge, and historical cases; an L1 layer for storing text descriptions and summary information obtained after semantic processing of L0 layer data; and an L2 layer for storing structured knowledge, rule-based conclusions, and conclusive data processed by the model. The L0 layer data is extracted, summarized, and labeled before being upgraded to the L1 layer, and then written to the L2 layer after structuring. The short-term memory is used to calculate the importance weight of each token in the dialogue context through an attention mechanism during a single task execution, and to extract the top k tokens or fragments with the highest importance weight as key intermediate results for caching, so as to break through the context window limitation; the key intermediate results include at least one of the preliminary execution strategy, the comprehensive feature representation, and the final execution scheme; after the task is completed, the cached key intermediate results are written into the long-term memory as historical cases.
[0009] Optionally, the sensor data, relevant knowledge, and historical cases required for execution can be retrieved from a pre-built memory bank, including: A hybrid retrieval strategy combining keyword matching, semantic vector similarity calculation, and structured query is used to perform a preliminary retrieval of the long-term memory. The results obtained from the preliminary retrieval are then reordered using a cross-encoder model to improve relevance, thereby obtaining the sensor data, relevant knowledge, and historical cases required for the execution of subtasks. When retrieving data from the long-term memory, if the retrieved data includes source identifier metadata, the source identifier metadata shall be provided as well. When no relevant information is found in the long-term memory, an external document retrieval tool is triggered to query the relevant information and its source, and the source identifier found is associated with the generated content and output.
[0010] Optionally, the step of decomposing the task instruction into several ordered subtasks includes: Call the pre-set rule base, which stores task templates, trigger conditions and corresponding standardized sub-task decomposition processes for multiple high-frequency tea garden management tasks; Calculate the semantic matching degree between the current task and each task template in the rule base; If a task template exists that matches a preset threshold and meets the corresponding triggering conditions, the standardized subtask decomposition process corresponding to that template will be invoked. Otherwise, using the large tea model, a subtask decomposition scheme can be generated through chain reasoning.
[0011] Optionally, the large-scale tea model is constructed in the following way: Collect text, image, and structured data in the tea industry to build a multimodal training corpus; A multimodal model containing a text encoder and a visual encoder was built based on the Transformer architecture; The multimodal model is pre-trained using the multimodal training corpus to obtain an initial model; the initial model includes the ability to understand and associate multimodal data in the tea industry. The question-and-answer pairs are extracted from tea knowledge information to construct a tea domain instruction fine-tuning dataset. The initial model is then subjected to supervised fine-tuning using the instruction fine-tuning dataset to obtain the large tea model.
[0012] Optionally, the task-relatedness and data quality assessment of the sensor data, relevant knowledge, and historical cases based on the sub-task objectives, and the determination of the corresponding perception coefficients, includes: Based on the task type of the sub-task, obtain the baseline weight of multimodal data including the sensor data, relevant knowledge and historical cases; The perception coefficient is obtained by combining the baseline weights, the task relevance scores and data quality scores of each modality data and performing normalization processing.
[0013] A tea garden management device based on a large-scale intelligent agent, the device comprising: The task understanding module is used to obtain and parse the task instructions for tea garden management issued by the user, determine the task type, extract the task entity and related parameters, and generate a structured semantic representation of the task. The task decomposition module is used to decompose the task instructions into several ordered subtasks based on the structured semantic representation of the task, and generate a preliminary execution strategy for each subtask, which includes the required data source, execution steps and rules. The data retrieval module is used to retrieve the sensor data, relevant knowledge, and historical cases required for execution from a pre-built memory bank for each subtask, based on the initial execution strategy. The data fusion module is used to evaluate the task relevance and data quality of the sensor data, related knowledge and historical cases based on the sub-task objectives, determine the corresponding perception coefficients, and perform weighted fusion of the sensor data, related knowledge and historical cases based on the perception coefficients to generate a comprehensive feature representation. The decision generation module is used to construct a decision context based on the task instructions, the task structured semantic representation, the preliminary execution strategy, the retrieval results of the memory bank, the comprehensive feature representation, and the currently available tools; and to use a pre-trained tea model to reason about the decision context to generate the final execution plan for each sub-task, wherein the plan includes a specific execution path, a sequence of tool call instructions, input and output parameters, and an exception handling mechanism. The task execution module is used to call the corresponding tools or physical devices to execute sub-tasks according to the final execution plan; evaluate the execution results of the sub-tasks; if the preset goal is achieved, the next sub-task is executed sequentially; if the goal is not achieved, the strategy is readjusted and executed; after all sub-tasks are completed, the results are integrated and it is determined whether the final requirements of the task instruction are met, and the final response is output.
[0014] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the aforementioned tea garden management method based on a large model intelligent agent.
[0015] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the aforementioned tea garden management method based on a large model intelligent agent.
[0016] The tea garden management method based on a large-scale intelligent agent provided by this invention has the following beneficial effects: This invention first generates a structured semantic representation of the task by parsing, classifying, and extracting entity parameters from user task instructions. This accurately grasps the needs of tea garden management, decomposes the task into ordered sub-tasks, and generates preliminary execution strategies, allowing for detailed processing of complex tasks and enhancing the systematic and operable nature of task execution. It retrieves multimodal data, including knowledge and historical data, from long-term memory, and performs correlation and quality assessments on this multimodal data, weighted fusion to generate a comprehensive feature representation, enabling a comprehensive and accurate grasp of key task information. Constructing a decision context and using a large tea model to infer and generate a final execution plan ensures that the plan is practical, complete, and executable. Finally, based on the plan, tools and equipment are invoked to execute the task. A closed-loop control system is formed through result evaluation and strategy adjustment to ensure smooth task progress. The final integrated result output response is then implemented. This method constructs an intelligent closed-loop workflow of "task understanding – task planning – task execution – feedback optimization – long-term memory accumulation," in which various tools are invoked during task execution to complete sub-tasks. It not only enhances the ability of intelligent agents to handle complex tasks, but also ensures the reliability of task execution through result evaluation and feedback mechanisms. It achieves a complete closed loop from task planning and tool invocation to execution feedback, based on the actual needs of tea garden managers, thereby improving the efficiency and quality of tea garden management. Attached Figure Description
[0017] To more clearly illustrate the embodiments and design schemes of the present invention, the accompanying drawings required for this embodiment will be briefly described below. The drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart illustrating a tea garden management method based on a large model intelligent agent according to an exemplary embodiment of the present invention.
[0019] Figure 2 This is a block diagram of a tea garden management device based on a large model intelligent agent according to an exemplary embodiment of the present invention. Detailed Implementation
[0020] To enable those skilled in the art to better understand and implement the technical solutions of the present invention, the present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. The following embodiments are only used to more clearly illustrate the technical solutions of the present invention and should not be construed as limiting the scope of protection of the present invention.
[0021] The technical solutions provided by the various embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0022] First, this invention provides a tea garden management method based on a large-scale intelligent agent model, specifically as follows: Figure 1 As shown, it includes the following steps: S101. Obtain and parse the task instructions for tea garden management issued by the user, determine the task type, extract the task entity and related parameters, and generate a structured semantic representation of the task.
[0023] In this step, a pre-built large-scale tea model can be used for in-depth analysis of the task. This process includes intent recognition, entity and parameter extraction, context fusion, and task semantic modeling. Specifically, the context fusion stage uses retrieval-enhanced generation technology to retrieve background knowledge, user preference information, and historical operation templates related to the current task from the memory database, enabling semantic completion and disambiguation of the current task.
[0024] For example, a retrieval query is generated based on the task type, task entity, and related parameters, and relevant background knowledge and historical operation templates are retrieved from a pre-built memory to form the context information of the task.
[0025] S102. Based on the structured semantic representation of the task, the task instructions are decomposed into several ordered subtasks, and a preliminary execution strategy containing the required data source, execution steps and rules is generated for each subtask.
[0026] The system calls a pre-set rule base, which stores task templates, trigger conditions, and corresponding standardized subtask decomposition processes for multiple high-frequency tea garden management tasks. It calculates the semantic matching degree between the current task and each task template in the rule base. If there is a task template with a matching degree exceeding a preset threshold and meeting the corresponding trigger conditions, the system calls the standardized subtask decomposition process corresponding to that template. Otherwise, it uses a large tea model to generate a subtask decomposition scheme through chain reasoning.
[0027] In this step, the high-frequency tea garden management tasks are quickly decomposed by calling a pre-set rule base that stores multiple high-frequency tea garden management task templates, and the low-frequency tea garden management tasks are decomposed by using a large tea model, which saves storage costs while improving the efficiency of tea garden management task decomposition.
[0028] S103. For each subtask, according to the preliminary execution strategy, retrieve the sensor data, relevant knowledge and historical cases required for execution from the pre-built memory bank.
[0029] The memory bank includes a long-term memory and a short-term memory. The long-term memory adopts a three-layer hybrid architecture for tea-related knowledge, including an L0 layer for storing raw sensor data, relevant knowledge in the tea field, and historical cases; an L1 layer for storing text descriptions and summary information obtained after semantic processing of L0 layer data; and an L2 layer for storing structured knowledge, rule-based conclusions, and conclusive data processed by the model. The L0 layer data is extracted, summarized, and labeled before being upgraded to the L1 layer, and then written to the L2 layer after structuring.
[0030] This short-term memory is used to calculate the importance weight of each token in the dialogue context through an attention mechanism during a single task execution, and to extract the top k tokens or fragments with the highest importance weight as key intermediate results for caching, so as to break through the context window limitation; the key intermediate results include at least one of the preliminary execution strategy, the comprehensive feature representation, and the final execution scheme; after the task is completed, the cached key intermediate results are written into the long-term memory as historical cases.
[0031] In this step, the long-term memory (LTM) employs a three-layer hybrid architecture. During retrieval, different retrieval methods can be used according to the data characteristics of each layer. For example, layer L0 is suitable for keyword matching retrieval, layer L1 is suitable for semantic vector similarity calculation retrieval, and layer L2 is suitable for structured query retrieval. Therefore, a hybrid retrieval strategy combining keyword matching, semantic vector similarity calculation, and structured query can be used to perform a preliminary retrieval of the LTM. The results obtained from the preliminary retrieval are then reordered using a cross-encoder model to improve relevance, yielding the sensor data, relevant knowledge, and historical cases required for subtask execution. When retrieving data from the LTM, if the retrieved data includes source identifier metadata, this metadata is provided as well. If no relevant information is found in the LTM, an external literature retrieval tool is triggered to query relevant information and its source, and the retrieved source identifier is associated with the generated content and output.
[0032] In addition, when relevant knowledge content cannot be retrieved in the knowledge memory, an external literature retrieval tool is triggered to query relevant information and its source, and the source identifier found is associated with the generated content and output.
[0033] S104. Based on the sub-task objectives, evaluate the task relevance and data quality of the sensor data, related knowledge, and historical cases, determine the corresponding perception coefficients, and perform weighted fusion of the sensor data, related knowledge, and historical cases based on the perception coefficients to generate a comprehensive feature representation.
[0034] The perception coefficient is obtained by normalizing the baseline weights of the multimodal data and the task relevance scores and data quality scores of each modality.
[0035] For example, for the perception coefficient, a baseline weight can be obtained based on the task type of the subtask, including the sensor data, relevant knowledge, and historical cases of the multimodal data; the perception coefficient is obtained by normalizing the baseline weight, the task relevance score of each modality data, and the data quality score.
[0036] S105. Based on the task instructions, the task's structured semantic representation, the preliminary execution strategy, the retrieval results of the memory bank, the comprehensive feature representation, and the currently available tools, construct a decision context; use the tea-themed big model for reasoning to generate the final execution plan for each sub-task.
[0037] The scheme includes specific execution paths, tool call instruction sequences, input and output parameters, and exception handling mechanisms.
[0038] In this step, the pre-training process for the large-scale tea model is as follows: Text, image, and structured data in the tea field are collected to construct a multimodal training corpus; a multimodal model containing a text encoder and a visual encoder is built based on the Transformer architecture; this multimodal training corpus is used to pre-train the multimodal model to obtain an initial model; this initial model includes the ability to understand and associate multimodal data in the tea field; question-answer pairs are extracted from tea knowledge information to construct a tea-related instruction fine-tuning dataset, and the dataset is filtered for quality to obtain a high-quality instruction fine-tuning dataset; this dataset is used to perform supervised fine-tuning of the initial model to obtain the large-scale tea model. This large-scale tea model can be used to decompose tasks or generate sub-task execution plans based on user-input task instructions. During the instruction fine-tuning stage, the model learns through a large number of question-answer pairs. The design of these question-answer pairs directly affects the model's ability to recognize and execute different functional types.
[0039] S106. According to the final execution plan, call the corresponding tools or physical devices to execute the sub-tasks; evaluate the execution results of the sub-tasks. If the preset goal is achieved, execute the next sub-task in sequence. If not, readjust the strategy and execute it. After all sub-tasks are completed, integrate the results and determine whether the final requirements of the task instructions are met, and output the final response.
[0040] Based on the above steps, this invention, targeting the specific agricultural scenario of tea garden management, constructs a large-scale tea model and a three-layer hybrid memory bank that incorporates professional knowledge such as tea variety characteristics, growth period management, and pest and disease control. It also introduces a perceptual coefficient weighted fusion mechanism based on task relevance and data quality, which can dynamically adjust the weight of different modalities of data (such as soil, images, and weather) in decision-making. For example, in pest and disease identification tasks, it automatically assigns higher weight to image data. This overcomes the deficiency of general data fusion methods (such as Kalman filtering) in their inability to perceive task semantics. Furthermore, it employs a task decomposition strategy combining a domain rule base and a domain-specific large-scale model. For high-frequency, experience-based agricultural operations such as "judging the timing of irrigation" and "calculating the amount of fertilizer," it uses rule templates for rapid response, while employing chain-like reasoning based on the large-scale model for less frequent tasks. This achieves a balance between efficiency and flexibility, completing a full closed loop from task planning and tool invocation to execution feedback, thereby improving the efficiency and quality of tea garden management.
[0041] In the above steps, the key core of the present invention includes the construction of an intelligent agent in the field of tea, and the present invention provides a possible implementation method for this.
[0042] S1. Construct a multi-source sensing module. This module is used to collect various sensor data of the tea garden environment in real time, including but not limited to: soil moisture, air temperature, light intensity, soil pH, crop images, and images of pests and diseases. The collected data is cleaned, denoised, and standardized, and growth stage labels are added to adapt to the management needs of tea tree growth stages, providing a data foundation for intelligent processing.
[0043] S2. Construct a knowledge corpus of text, images, and structured data related to the tea industry. This corpus includes tea variety characteristics, cultivation, tea growth period management, pest and disease control, harvesting management, and tea quality formation mechanisms (such as changes in amino acid and tea polyphenol content). A multimodal model is built based on the Transformer architecture and pre-trained using the processed corpus data to obtain a large-scale tea model. This model possesses basic knowledge related to tea planting and production processes, as well as reasoning and understanding capabilities.
[0044] Based on the collected tea-related language data, a tea-related question-and-answer dataset was first constructed. A rigorous selection strategy was then employed to extract high-quality samples, ensuring the accuracy and professionalism of the training data. Subsequently, the high-quality dataset was used to conduct supervised fine-tuning training on a large-scale tea model, significantly improving the model's understanding and response capabilities to tea-related instructions and tasks.
[0045] S3. A short-term memory (SSM) is constructed based on a key intermediate result caching mechanism. Key node information is extracted by semantic compression of the model output stream to overcome the context window limitation. A three-layer hybrid architecture long-term memory (LSM) is built, comprising a raw data layer, a natural language layer, and a structured knowledge layer. A hybrid retrieval strategy, combining keywords and semantics, is used to retrieve data from the LSM. A cross-encoder model is then used to reorder the retrieval results to obtain highly accurate search content, which is then used by large models for multi-dimensional knowledge fusion and reasoning enhancement.
[0046] Specifically, for tea-related knowledge corpora in the long-term memory knowledge base, this invention adds metadata, including the title of the relevant document or book, DOI, and other identifying information. When using retrieval enhancement generation technology to output contextual information, this metadata is output along with the content. If the output content is not from the knowledge base but rather learned by the model, a search tool is invoked to automatically retrieve relevant documents and output their titles and DOI information. This method ensures that the output content is based on evidence and has a source, thereby enhancing the credibility of the large model agent.
[0047] S4. Construction of the Tool Module: This module enhances the agent's capabilities, enabling it to perform tasks that the model alone cannot. Specifically, this module includes API interfaces for various hardware in the tea garden, a tea-related database, a knowledge graph, web information, and code execution tools. Based on tool call instructions generated during the decision-making process, the agent invokes the corresponding tools to obtain the data or execution capabilities needed to complete the task.
[0048] S5. Design a workflow for the intelligent agent of tea planting tasks. When the tea task is received from the tea garden administrator, the agent calls each module to perform task understanding, task decomposition and sub-task strategy planning, tea garden memory retrieval and multimodal data fusion, sub-task final decision generation, and evaluation and feedback of the results.
[0049] In this step, the task is first analyzed in depth using the large tea model built by S2, based on the user's input of tea-related task instructions. This process includes intent recognition, entity and parameter extraction, context fusion, and task semantic modeling. The context fusion stage utilizes retrieval-enhanced generation technology to retrieve background knowledge, user preference information, and historical operation templates related to the current task from the memory database, enabling semantic completion and disambiguation of the current task.
[0050] Secondly, by using the large-scale tea model to understand the task, the complex task is decomposed into a series of executable sub-tasks, and a preliminary execution strategy is generated for each sub-task. This execution strategy includes the sensor data required to complete the sub-task, background knowledge, rules to be followed, steps, and priority order.
[0051] The retrieval query, generated again based on the divided subtasks and the initial execution strategy, initiates a precise on-demand retrieval from the memory bank to obtain multimodal data such as relevant knowledge, historical cases, or sensor data required for subtask execution. This retrieval employs a hybrid retrieval strategy, combining keywords and semantics to obtain more comprehensive and accurate search results, aiding in data-driven judgment. Because the sensor data stored in the memory bank has a certain lag—for example, if real-time environmental data of the tea garden is needed but has not yet been stored in the memory bank—then when the required data is insufficient or unavailable, the tool can access the sensors to obtain the data.
[0052] The large model then generates fusion instructions based on the sub-tasks and calculates a perceptual coefficient for each modality based on task relevance and data quality scores. The fusion module then weights and fuses the different modalities according to their perceptual coefficients. Based on the fused multimodal data and the knowledge obtained through precise retrieval, the tea-related large model generates the final execution instructions for the sub-task and calls the corresponding tools or execution modules to complete the sub-task.
[0053] This involves constructing a decision context based on acquired knowledge and data, using a large tea model to perform deep reasoning simulations of the decision-making process of domain experts, and generating final decision schemes for subtasks, including subtask execution paths, tool invocation methods and sequences, input and output parameter requirements, exception handling and rollback mechanisms, etc.
[0054] In addition, since each step of the task decomposition generates an instruction, it is necessary to judge the content returned by the execution. If the result meets the expected goal of the subtask, then proceed to the next subtask; if not, adjust the strategy or re-search and execute in a loop until the subtask goal is achieved.
[0055] Finally, after all subtasks are completed, the results are integrated to determine if the overall result meets the user's final needs. If it does, the final user-facing response is output; otherwise, a new loop is triggered or the user is requested to provide more contextual information. Ultimately, a final, user-facing response integrating all information is generated. Furthermore, the execution results are updated in the memory bank for the larger model to reference in its next decision-making process.
[0056] Based on the above steps, the present invention also provides an embodiment.
[0057] S1. Construct a multi-source sensing module.
[0058] The perception module is responsible for actively accessing various sensors and data sources in the tea garden, collecting, preprocessing, structuring, and performing preliminary analysis to provide high-quality data sources for the intelligent agent. The acquired data includes multi-source sensor data such as environmental information, soil data, tea tree growth status, and tea tree images. Subsequently, the data is processed into a structured form and stored in a memory bank to support subsequent task reasoning and decision-making. The specific steps are as follows: Step 1: Acquire raw data such as environment, soil, tea tree growth status and tea tree images through sensor interface.
[0059] Step 2: Add collection time information to each set of collected data to ensure that the data is traceable and queryable.
[0060] Step 3: Perform data cleaning, including removing outliers, filling in missing values, and deleting duplicate data.
[0061] Step 4: Convert data from different sources and in different formats into unified structured data. For example, dated [Month] [Day]: soil moisture 25%RH, air temperature 30℃, light intensity 1200 lux, soil pH=6.5, and crop images.
[0062] Step 5: Perform rule-based judgment and model processing on sensor data. For example, set a normal threshold range for "soil moisture 25%RH on xx month xx day, current soil moisture is within a suitable range; light intensity 1000 lux, insufficient light intensity, appropriate supplemental light is needed". After calculation, judge whether the data is abnormal to avoid the agent having to recalculate from the original values every time it uses sensor information.
[0063] Step 6: Store the processed sensor data from Step 4 into the L0 layer of the long-term memory of the memory bank, and store the sensor data from Step 5 into the L2 layer of the memory bank.
[0064] S2. After completing the construction of the perception module, in a preferred embodiment of the present invention, a multimodal model is built based on the Transformer architecture of multimodal fusion, and pre-trained using data. First, multi-source data in the tea industry is collected and preprocessed. Based on the Transformer architecture, a model is built by combining a text encoder and a visual encoder. The preprocessed data is then used for multimodal joint pre-training to obtain a large language model for tea. Afterwards, the model is fine-tuned to enable it to understand, reason about, and execute instructions related to tea-related tasks. The specific method is as follows: S201 collects multi-source data in the tea industry, including books, literature, and expert experience related to tea cultivation, irrigation techniques, and pest and disease control. It primarily involves multimodal data such as text, images, and structured data. The acquired data includes various formats such as HTML, text, and PDF, which are processed into a unified JSONL format. Fine-grained cleaning, deduplication, and value alignment are then performed to generate a dataset for pre-training. In the JSONL file, image data is represented using a label plus image path format.
[0065] Specifically, the data undergoes standardization processing, adopting the unified encoding format UTF-8, and natural language processing tools are used for sentence segmentation, word segmentation, part-of-speech tagging, and entity recognition. By combining regular expressions with deep learning models, HTML tags, script garbled characters, special characters, and other noise interference are removed. This ensures the corpus is clean, accurate, and suitable for subsequent knowledge base construction and large language model training. Secondly, for image data, we perform quality screening and standardization processing, deleting low-resolution, blurry, and distorted images, and standardizing image resolution.
[0066] Simultaneously, an image-text alignment mechanism is used to perform consistency checks between the image and its corresponding text label description, deleting data pairs that do not match. Specifically, an image encoder is used to extract the visual feature vector of image I, and a text encoder is used to extract the semantic feature vector of text description T. Cosine similarity is then calculated using the following formula: ; Where v represents the feature vector of image I, and t represents the feature vector of text description T; a threshold θ of 0.6 is set to judge the semantic consistency between the image and text. When the cosine similarity is lower than this threshold, i.e. If the data does not meet the requirements, we delete the sample data. The cleaning process for plain text data is similar. Finally, the collected structured data such as Excel and CSV files are cleaned and standardized, including missing value handling, outlier detection, deduplication, and error labeling correction.
[0067] After constructing the pre-training dataset, S202 builds a language model based on a Decoder-Only Transformer architecture and a visual encoder based on a Vision Transformer architecture. The visual encoder and language model are then fused to form a large visual model. Combined with the pre-training dataset mentioned above, the large tea model is trained. The specific steps are as follows: (1) A visual encoder is built based on the Vision Transformer architecture to extract and encode features from image data; specifically, the image is divided into N image blocks, and each image block is flattened into a vector: ; in, It is the i-th image patch. Let d represent the embedding vector of the i-th image patch, where d represents the dimension. Represents a mapping function. Indicates the image block Mapping to vector space .
[0068] Each image patch vector is added with a positional code p: ; in, This is an initial image patch feature sequence that incorporates positional encoding; To represent the dimension of the feature space to which it belongs; Will The input is fed into a network consisting of stacked Transformer encoders, each layer containing multi-head attention and feedforward networks, to obtain a globally interactive image feature sequence: ; in, for The feature sequence output after processing by multiple Transformer encoders and completing global self-attention interaction; Finally, the visual features are aligned to the hidden dimensions of the language model using a linear projection layer: ; in This is the projection weight matrix.
[0069] (2) The text input first passes through a word embedding layer and is converted into a vector sequence. Let the input text sequence T be divided into segments by the word segmenter. And add location encoding : ; ; in, The input text sequence after being segmented by the tokenizer is the first... Each text word element; For the first Each text word is processed through word embedding mapping and fused with positional encoding. The final vector representation is then obtained; Obtain the text token sequence: ; (3) Visual feature sequence With text feature sequences Concatenate them into a unified multimodal token sequence: .
[0070] (4) The fused feature sequence is input into a mask attention, residual link, layer normalization and feedforward fully connected network model, and after being stacked through L layers, a contextual representation of fused vision and text is obtained.
[0071] ; in, To integrate multimodal feature sequences that incorporate global contextual information from both visual and textual perspectives, For multimodal splicing sequences The Transformer decoder performs forward processing.
[0072] (5) The hidden vector obtained by the fusion context representation is mapped to the word space through the output module to obtain the probability distribution of each token.
[0073] (6) The decoder uses sampling or Top-k decoding to gradually select the token sequence from the probability distribution. The token sequence is then converted into the final human-readable text by the word segmenter.
[0074] (7) The AdamW optimizer is used during the training process, and appropriate hyperparameters are set, such as learning rate, weight decay coefficient, number of training rounds, etc. A learning rate scheduling strategy combining linear warm-up and cosine annealing is adopted.
[0075] (8) Mixed precision training (FP16) and gradient accumulation techniques are used to improve training efficiency and adapt to existing resource constraints. The model adopts a multi-task joint training strategy, mainly including image question answering and text question answering tasks.
[0076] After completing the training of the large tea model, S203 designs prompt word templates to guide the large model to process the acquired data into question-answer pairs. It also calculates the marginal contribution of the data by calculating the approximate Shapley value, extracts a high-quality question-answer pair dataset, and uses this dataset to fine-tune the large tea model.
[0077] Specifically, in the implementation of this invention, prompts are designed for the large-scale tea model to guide it in extracting question-and-answer datasets from collected tea-related corpus knowledge. These prompts could be designed as follows: "You are a professional tea expert. Please extract questions and corresponding answers based on the tea-related text content I provide. The extracted questions should be diverse, covering different aspects, and the answers should be strictly based on the provided text content, ensuring conciseness, accuracy, and not containing any content beyond the scope of the text."
[0078] After constructing the question-answering data, it is sorted and filtered. Low-quality data not only degrades model performance but also wastes training resources. Therefore, we calculate the marginal contribution of data samples using the Shapley value method, measuring the gain of a subset of samples on the target performance given a value function. For a dataset containing N samples... The value function of the model is denoted as , indicating that in the sample subset S The performance on the validation set after training on D is such that the Shapley value of the i-th sample is: ; This formula represents the sample. The marginal contribution to overall performance, i.e., the performance improvement brought about by adding samples to the model training, is not feasible when N is large because it requires traversing all subsets. Since the Shapley value can be equivalently represented as the expected form of all sample permutations: ; ; in For the sample The expected form under all sample permutations, for The single marginal contribution, Represents the set of permutations of all samples. Indicates the order of arrangement The set of samples preceding sample i. This expected form provides the theoretical basis for the Monte Carlo approximation. By sampling from a finite number of random permutations, calculating the corresponding marginal contributions, and taking the mean, an approximate estimate of the Shapley value can be obtained: ; Where T is the number of Monte Carlo iterations, the computational complexity can be reduced from [previous value] to [new value]. Down to This makes it possible to assess the importance of large-scale samples.
[0079] Due to the massive sample size, to reduce the complexity to a computable level, we first semantically encode the original data using the bge-large-en-v1.5 vector model to obtain the embedding representation vector for each sample. Then, we use the K-means clustering algorithm to partition the embedding space. To determine the optimal number of clusters, k, we use the elbow method to search for the optimal number of clusters within a preset range. The optimal cluster distribution is determined by the k value corresponding to the inflection point of the rate of decrease in the intra-cluster squared error. Tea data samples are then assigned to their corresponding clusters, and empty clusters are removed, ultimately yielding the number of clusters, k. After clustering, each cluster uses its cluster center as a surrogate, selecting the sample closest to the center as the cluster representative. Subsequent value evaluation only needs to be performed on these surrogate samples, effectively reducing the overall computational complexity.
[0080] Although clustering compression only requires calculating the Shapley value of the surrogate sample, the traditional calculation of the Shapley value still requires exhaustively enumerating all possible sample permutations, resulting in high complexity. The computational cost increases dramatically with the sample size. Therefore, we obtain surrogate samples through clustering. Based on this, the Monte Carlo approximation method is used to estimate the Shapley value of each agent sample. The model is first fine-tuned and evaluated on the complete agent set, with the validation set accuracy used as the value function V. Subsequently, instead of performing calculations on a sample-by-sample basis, we start from the surrogate sample in each iteration. Gradually remove a group of agent clusters The process continues until all elements are removed, with a total of M removals performed. The difference in model performance before and after removal is calculated, and the average value is taken as the marginal contribution of each cluster in the set. ; in, The average marginal contribution of this cluster. This represents the set of proxies before removal. Indicates from Remove a group of proxy clusters The set after, | | represents the number of proxy clusters currently removed. In this way, the performance change caused by removal is evenly distributed among each cluster within the group, thus obtaining the individual marginal contribution of each proxy cluster. Complete removal of proxy samples is considered a full Monte Carlo iteration sampling. This process is repeated T times, with the proxy cluster order randomly shuffled each time, to obtain the marginal contribution of each proxy cluster under different sampling conditions. Finally, the average of these values is used as an approximate estimate of the Shapley value for that proxy cluster. ; in, For an approximate estimate of the Shapley value, T represents the number of Monte Carlo iterations, and M represents the number of batch removals in each permutation. Denotes the cluster in the t-th random permutation The marginal contribution, in this way, while maintaining Shapley fairness, reduces computational complexity from Down to Then, based on comparative experiments, the top-k best question-answer pairs were selected, and duplicate, ambiguous, improperly expressed, or factually inaccurate data samples were removed. This dataset was then used to fine-tune the large-scale tea model, enabling it to better understand and follow human instructions.
[0081] S3. Constructing a Memory Bank. After completing the pre-training and instruction fine-tuning of the large tea model, this invention further constructs the memory bank required by the agent. This memory bank includes both short-term memory and long-term memory. Through this memory bank, the agent can maintain contextual coherence during task execution and continuously accumulate and solidify new knowledge and experience over long-term operation, thereby achieving dynamic learning and continuous optimization. Specifically: S301 short-term memory serves as a temporary repository for task-specific information. Its core function is to capture and store the context information of the agent's current task and the task objective within a context window. To avoid the limitation of the context window capacity preventing the retention of early records, this invention provides a short-term memory construction method based on a key result caching mechanism. The specific steps are as follows: 1. When a user enters a task, the AI will save the current input statement along with the previous dialogue content into the context window.
[0082] 2. As the task progresses, the context window will be continuously updated, and each time input is made, the most recent N rounds of dialogue will be extracted as context and provided to the model.
[0083] 3. During task execution, the agent continuously processes the task records. Each round of dialogue content is segmented and encoded to generate vector representations of multiple tokens. Based on an attention mechanism, attention weights are calculated to capture the importance score of each token within the entire dialogue context. The tokens are then ranked, and the top k most important tokens are selected. Furthermore, since "green tea" and "planting" are two important tokens, and "green tea planting" is also a key intermediate result, important fragments are generated through aggregation and stored as key intermediate results in the key result cache database. The specific calculation formula is as follows: After word segmentation and encoding, the t-th round of dialogue yields a token vector sequence: , ; The relevance score of each token across all contexts is calculated using an attention mechanism: ; in, The relevance score of each token across all contexts; Attention weights are obtained through normalization: ; Select the top k tokens with the highest weights: .
[0084] If you need fragment-level results, you can use the sliding window method on the original token sequence. The process involves iterating through the tokens, concatenating them, calculating the attention weights using the method described above, and then sorting and selecting the top-k segments to obtain the final result. Concatenate the token sequences that need to be aggregated: ; The relevance score of each segment in the entire context is calculated using an attention mechanism: ; in, A relevance score for each segment across the entire context; Attention weights are obtained through normalization: ; ; The relevant token set With related fragment set The data is merged, and a filtering mechanism is used to remove relevant but unimportant content, ultimately generating a set of key intermediate results. : ; in, A vector representation of the token. , Let C be the trainable weight matrix, and let C represent the context sequence matrix from the start of the dialogue to the current dialogue turn. That is, the importance weight of the i-th token. This represents the set of token indices that the fragment needs to be aggregated. This is the importance weight of the m-th segment.
[0085] 4. During task execution, the cached results in the key result cache database can be called at any time to support the execution of subsequent task steps.
[0086] 5. After the task is completed, write the cached content in the database to long-term memory and clear the database to avoid redundant data occupying storage space.
[0087] S302 long-term memory serves as a long-term data reserve for the intelligent agent, capturing and storing previous interaction records. Based on this, it extracts and consolidates user preferences and operating habits, and stores relevant background knowledge, literature, standards and specifications, and historical production data in the tea field. Combined with a retrieval-enhanced generation mechanism, it provides continuous knowledge support and optimization capabilities for reasoning and decision-making in subsequent tasks.
[0088] 1. Long-term memory storage module. User memory needs to support efficient retrieval and semantic association, avoiding information fragmentation. Therefore, this invention adopts a three-layer hybrid memory architecture of L0, L1, and L2, and uses a hybrid storage method of vector database, traditional database, and knowledge graph to store data, achieving efficient storage and retrieval of long-term memory.
[0089] Layer L0 (Raw Data Layer): Stores theoretical knowledge related to tea cultivation and production, including literature, books, and images of pests and diseases. In addition, this layer stores multimodal data from tea garden sensors (such as timestamped soil temperature and humidity, light intensity values, and crop images), as well as raw user interaction records. While this layer provides complete information, its structure is loose, making it unsuitable for direct semantic retrieval or complex reasoning.
[0090] Layer L1 (Natural Language Memory Layer): This layer performs semantic processing and summarization on the data from Layer LO. First, data tags are extracted for rapid classification and retrieval of knowledge content. Second, key knowledge points are extracted as concise expressions of core information. Finally, natural language descriptions of the knowledge content are generated. Simultaneously, user interaction data is organized and extracted to form user preference and habit information. To facilitate retrieval, the natural language is converted into vector form and stored in a vector database. The processed L1 layer information is suitable for both rapid semantic retrieval and direct use in multimodal generation and inference.
[0091] Layer L2 (Structured Knowledge Layer): This layer uses knowledge graphs and traditional databases to store highly structured knowledge data related to the tea industry. It also stores sensor data processed by rules and models, such as "soil moisture 25%RH, current soil moisture is within a suitable range; light intensity 1000 lux, insufficient light, supplemental lighting is needed," avoiding recalculation from the original values every time relevant information is used. Layer L2 data has rigorous logic and the highest access efficiency, allowing direct use for precise task planning and reasoning by intelligent agents. Furthermore, when the conclusions of Layer L2 are questionable, the original data from Layer L0 can be called up at any time for further verification.
[0092] After entering from the LO layer, the data undergoes extraction, summarization, and labeling, then is upgraded to the L1 layer, and finally written to the L2 layer after structured standardization. During task execution, data from different layers can be flexibly accessed as needed: simple queries directly access the L2 layer, semantic reasoning or multimodal generation can combine the L1 and L2 layers, and original data verification can be traced back to the LO layer.
[0093] Furthermore, metadata is added to the tea-related knowledge corpus in the search memory, including the title of the relevant literature or book, DOI, and other identifying information. When using the search output, this metadata is output along with the content. If the corresponding source cannot be found in the search memory, an external search tool is invoked to automatically retrieve relevant literature information based on public academic databases or authoritative literature retrieval websites. The search results, along with the metadata, are then written into the search memory. This not only allows for the inclusion of source evidence when generating content but also enables dynamic updates to the search memory, thereby enhancing the verifiability and credibility of the output results from the large model agent.
[0094] 2. Long-term memory retrieval module: Since the memory bank stores data in various forms, including traditional databases, knowledge graphs, and vector databases, a single retrieval method cannot meet the retrieval and query needs of the memory bank. Therefore, this invention uses a hybrid retrieval strategy, combining semantic retrieval, structured retrieval, and keyword retrieval to retrieve long-term memory. Because ranking candidate texts by calculating cosine similarity relies solely on global vectors, it lacks fine-grainedness and cannot capture the precise alignment between the question and candidate texts. This invention sets up a cross-encoder model to re-rank the retrieved results. The specific steps are as follows: (1) Combine the retrieval task and the retrieved candidate content as a whole and feed them into the model: ; Where q is the retrieval task vector representation. The vector representation of the i-th candidate content. This indicates that the task and the retrieved i-th candidate content are concatenated and used as the input to the cross encoder.
[0095] (2) After linear mapping, Q, K, and V are obtained. Then, self-attention interaction is performed at the token layer. Each token in the sequence interacts with other tokens. After calculation by the attention mechanism, the vector of each token is fused with information from other tokens in the sequence. The new token represents the sequence. The attention mechanism calculation formula is as follows: ; in, , , They are query, key, and value, respectively. is the dimension of the key vector.
[0096] (3) Take The vector of [CLS] tokens in the sequence is used as the representation of the entire input sequence, and the [CLS] vector is input into the feedforward layer to obtain the relevance score: ; ; in, For sequence The vector representation of the [CLS] flag, where W is the weight vector and b is the bias term. This represents the relevance score between the task and the retrieved i-th candidate content.
[0097] (4) Relevance score for all candidate content Sort the results and select the highest-scoring content as the search results.
[0098] 3. The long-term memory update module specifically includes: updating user interaction data by updating the records of each user interaction to long-term memory, so that when encountering similar tasks again, the data can be retrieved directly from the memory and relevant experience can be referenced without repeatedly calling the tool; updating sensor data by connecting the memory bank to the perception module and writing the data processed by the perception module into the memory bank, dynamically updating the data in the memory bank; and updating domain knowledge data by updating the tea knowledge in the memory bank in real time based on the latest tea science research results and cutting-edge technology solutions, thereby ensuring the timeliness of information and ensuring that the intelligent agent always maintains the cutting edge and timeliness of knowledge.
[0099] Building the S4 tool module.
[0100] After understanding the task, the intelligent agent generates corresponding decisions, including instructions to invoke external tools. By invoking tools, the intelligent agent can extend its action execution capabilities, thereby solving more complex task requirements.
[0101] Specifically, after receiving a tool call request, the tool module invokes the corresponding tool to complete the task. The module primarily integrates various APIs, tea-related databases, knowledge graphs, and web information. For example, the web search tool retrieves internet information by calling search engine APIs or crawling public web pages; the literature search tool retrieves literature not yet indexed in the memory database when outputting document titles and DOIs; the weather tool obtains real-time weather conditions and future weather forecasts for the tea garden area; due to the inherent lag in sensor data stored in the memory database, the tool module obtains real-time data by calling sensor data; furthermore, the tool module can also invoke physical equipment in the tea garden to perform operations such as watering and fertilizing based on instructions.
[0102] Through the above design, the tool module can effectively make up for the shortcomings of the memory bank in terms of timeliness and coverage, and provide the agent with a channel to interact with the external world, enabling it to form a closed-loop mechanism of "task understanding - decision generation - tool invocation - result acquisition - knowledge update", which significantly improves the level of intelligence and task execution capability.
[0103] S5, Construction of Large Model Intelligent Agent Workflow.
[0104] This invention constructs a workflow to systematically connect and automate the various stages of an intelligent agent's task execution process, enabling end-to-end processing from task input to execution result output. This ensures that task execution is standardized, controllable, and scalable. The workflow includes task understanding, task decomposition and planning, memory retrieval, multimodal data fusion and perception coefficient calculation, decision generation and execution, and result evaluation and feedback. The specific steps are as follows: S501 Task Understanding.
[0105] Different intent categories will trigger different task execution processes. To ensure the accuracy and efficiency of task processing, it is necessary to first identify the intent of the task to clarify its core objective category, thereby determining the subsequent task decomposition and execution path.
[0106] Specifically, the present invention uses the large tea model constructed in step 2 to perform deep semantic analysis on the input information, identify the core intent of the input task, and thus determine the target category of the task, such as query, recommendation, suggestion, diagnosis, operation execution, etc.
[0107] To further improve the accuracy of intent recognition, this invention fine-tunes the large-scale tea model by constructing a dedicated dataset. This fine-tuning dataset is formatted as "task + category label," and its task classification system adheres to the independent orthogonal principle, meaning there is no overlap within each sub-category, while ensuring that each sub-category contains a sufficient number of samples. The model is then fine-tuned based on this dataset. Furthermore, due to the large number of categories, the model's ability to perceive classification may be weak. Therefore, this invention combines retrieval-enhanced generation to construct an intent category vector database. Upon receiving an input task, the input task is first converted into a semantic vector, and the K most relevant candidate categories are retrieved from this database. The candidate results and the task are then input into the large-scale model, and appropriate prompts are designed to guide the model in scoring and ranking these K categories, selecting the optimal target category, thereby significantly improving the model's intent recognition capability.
[0108] After the task category is obtained through intent recognition, entities and parameters are extracted from the input task based on the identified intent category. Key entities and related parameters are then identified to provide structured information for subsequent task decomposition, strategy planning, tool invocation, and data processing.
[0109] The extracted entities and parameters are fused with context, and combined with the historical interaction information, background knowledge and user preferences of the input task in the memory bank, the current task is semantically completed and disambiguated to ensure the accuracy and completeness of task understanding. Building upon intent recognition, entity and parameter extraction, and context fusion, deep semantic modeling is performed on the input task. This step generates a structured semantic representation of the task by comprehensively analyzing its core intent, key entities, parameter information, and contextual completion, achieving a deep semantic understanding of the input task. This provides clear and complete semantic support for subsequent task decomposition, strategy planning, and execution.
[0110] S502 Task Decomposition and Strategy Planning.
[0111] After understanding the input tea garden task and generating structured task information, this invention proposes a task planning and decomposition method combining rules and models based on the scenario characteristics of the entire tea planting and production process. This method employs a collaborative mechanism where "high-frequency tasks are handled by rules, while low-frequency tasks are processed by a large tea model." Based on the understanding of the task, complex tasks are further decomposed into a series of executable sub-tasks. This achieves structured decomposition and strategy planning for real tea garden management tasks.
[0112] The tea cultivation cycle exhibits distinct phases, including budding, leaf unfolding, mature leaf stage, and overwintering stages. Each stage presents significant differences in the need for water, light, nutrients, and pest and disease control strategies. Therefore, this invention constructs a high-frequency task rule base for tea cultivation. It structurally models typical business scenarios in daily tea garden management, such as "judging the timing of watering," "calculating fertilizer application," "early identification of pests and diseases," "judging the growth stage of tea trees," "regulating light in tea gardens," and "formulating tea tree pruning plans." This results in high-frequency task templates, rule conditions, and subtask decomposition templates, enabling the intelligent agent to accurately map actual tea garden management behaviors. Specifically, the high-frequency task template is a standardized text description representing a common task; the rule conditions are a set of prerequisites that must be met to execute the task; and the subtask decomposition template, the core of the rules and the execution body, is a predefined structured decomposition scheme that details the subtask structure, logical order, and parameter requirements after the task is decomposed.
[0113] The semantic similarity between the input task and task templates in the rule base is calculated, and a threshold is set. When the calculation result is higher than the threshold, the input task is determined to be a high-frequency task, and it is decomposed into a series of executable sub-tasks according to the matched rule templates. When the similarity calculation result is lower than the threshold, the task is determined to be outside the scope of tasks covered by the rule base. Based on the prompting engineering, a large tea model is used, combined with the thinking chain reasoning technique to decompose the task. The specific steps are as follows: 1. Vectorize the content obtained after understanding the user input question task to obtain the semantic vector V.
[0114] 2. Calculate the semantic vector V and the vectors of all task templates in the rule base. cosine similarity Let j be the index of the j-th task template in the rule base, and let the highest similarity be denoted as . .
[0115] ; ; Through experimental optimization, the threshold for distinguishing between high-frequency and non-high-frequency tasks was determined.
[0116] (1) First, construct a labeled dataset, including task statements labeled with category labels.
[0117] (2) Vectorize each task statement Calculate the relationship between each task vector and all task template vectors in the rule base. cosine similarity And select the one with the highest cosine similarity. : ; ; in, For the first Task statement vector With the rule base The cosine similarity between task template vectors, where i is the task number index for constructing the labeled dataset, and j is the task template index in the rule base.
[0118] (3) Record the true label (high frequency and low frequency) and the corresponding maximum cosine similarity score for each sample.
[0119] (4) Set the threshold candidate interval (0.6-0.9, step size 0.05), and calculate the accuracy, recall and F1 score of each threshold in the threshold candidate interval on the labeled dataset.
[0120] (5) Compare the F1 scores under different thresholds and select the threshold corresponding to the optimal F1 score as the final threshold θ. In addition, in actual operation, new tasks and results can be continuously collected, and the above indicators can be recalculated periodically to dynamically update the thresholds.
[0121] like If the task is determined to be a high-frequency task, It was determined to be a low-frequency task.
[0122] 5. After the input task and high-frequency task template are determined, check whether the corresponding rule conditions are met. If the rules are met, the subtasks can be decomposed according to the execution method of "high-frequency task"; if the rule conditions are not met, even if the semantic matching is successful and it is defined as a "high-frequency task", another execution method of "non-high-frequency task" should be used, that is, the task should be decomposed using the tea leaf model.
[0123] 6. For high-frequency task decomposition and execution methods, the corresponding subtask decomposition template is called according to the retrieved and matched task to decompose the task into a series of executable subtasks.
[0124] 7. For low-frequency tasks, a large tea model is used to decompose the task based on prompts. Furthermore, to avoid the model directly providing a list of subtasks without logical order, a chain-of-thought reasoning method is employed. This guides the model to reason step-by-step through a chain of prompts before outputting, thus improving the logic, accuracy, and executability of the task decomposition scheme. Example prompt: "You are a tea expert. Based on your understanding of the task, think step-by-step and break it down into several executable subtasks. Output the execution order and key points of each subtask. Ensure that the subtasks are specific, clear, and consistent with professional knowledge in the tea field."
[0125] Finally, based on the above decomposition results, a preliminary execution strategy is generated for each subtask. This preliminary execution strategy includes, but is not limited to, the data required to complete the subtask, the execution steps, the rules to be followed, and the preconditions.
[0126] S503. After completing task decomposition and generating the initial execution strategy, this invention generates retrieval query instructions based on the sub-tasks and the initial execution strategy. Through retrieval enhancement generation technology, a precise on-demand retrieval is initiated to the memory bank to obtain all the knowledge, historical cases, and multimodal data required for sub-task execution. First, the "knowledge and conditions" are prepared to provide the sub-tasks with a basis for execution. This retrieval not only includes a hybrid retrieval strategy combining keywords and semantics, but also incorporates specialized information from the tea planting field, such as professional terminology, tea tree growth period labels, specific names of pests and diseases (e.g., tea green leafhopper, tea geometrid moth, anthracnose), harvesting standards (e.g., "one bud and one leaf," "one bud and two leaves"), and variety parameters (e.g., cold resistance of Longjing 43, photosensitivity of Tieguanyin), to obtain more comprehensive and accurate retrieval results. Because data storage in the memory bank has a lag, when the required data is insufficient or unavailable, the tool module can actively call upon tea garden sensor devices such as soil moisture sensors, temperature and humidity nodes, canopy cameras, and leaf close-up imaging devices to obtain the required real-time tea garden data.
[0127] After completing the task division and retrieval of knowledge data required for subtasks, S504 performs multimodal data fusion based on the retrieved knowledge and data information. Environmental factors in tea garden production scenarios are complex, and multi-source information exhibits significant correlation and complementarity. A single modality is often insufficient to support accurate decision-making and cannot make accurate judgments. For example, the color of tea leaves alone cannot determine whether the cause is water shortage, disease, or other reasons. Therefore, this invention designs a multimodal data fusion method that extracts and fuses features from multimodal information such as meteorological (temperature, humidity, rainfall), soil (pH, water content, nutrients), leaf image data, and manual observation records to comprehensively determine the cause of the phenomenon. The specific steps are as follows: 1. The large model generates fusion instructions based on the initial execution strategy of the subtask and the knowledge data information required by the subtask retrieved by S503, and determines the set of modalities that need to be processed in this subtask.
[0128] 2. The model scores the relevance of each modality of data to the current task and the data quality. The task relevance score R assesses the degree of association between the modality of data and the current sub-task objective; the data quality score Q assesses the reliability and confidence of the data itself, including data completeness, real-time updates, sensor noise levels, image clarity, and the accuracy of sampling locations.
[0129] 3. Based on task relevance scores and data quality scores, a perceptual coefficient is calculated for each modality, representing the importance weight of that modality in the current task. The specific calculation is as follows: First, calculate the overall score for this mode. : ; Then, all modes are normalized to obtain the sensing coefficients for each mode. : ; Where M is the total number of modes, Score the task relevance of the i-th modality data. Let j be the quality score for the i-th modality of data, and j be an iterative variable ranging from 1 to M.
[0130] The fusion module weights and fuses data from different modalities (such as images, sensor data, and text) according to perceptual coefficients to generate a comprehensive feature representation for subsequent task decision generation.
[0131] ; Where F represents the comprehensive feature representation, Let be the eigenvector of the i-th mode.
[0132] For example, in the "tea tree disease and pest identification" task, the system calculated the image perception coefficient (0.7), soil perception coefficient (0.2), and meteorological perception coefficient (0.1). Therefore, in the "disease and pest identification" task, leaf image information has the highest correlation with the task and is of good quality, with a perception coefficient of 0.7; soil data has a certain auxiliary role in the judgment; although meteorological data has a lower correlation, it can be used to determine the seasonal triggering conditions for the occurrence of diseases and pests. The final fusion result is dominated by image features, supplemented by soil and meteorological modal information, making the reasoning results more comprehensive and consistent with the actual production patterns of tea gardens.
[0133] S505 Decision Generation and Execution.
[0134] After obtaining the feature representation of the weighted fusion of multimodal data, a final execution plan is generated for each subtask based on the initial execution strategy.
[0135] Specifically, S503 defines the preliminary execution strategies, including the data types and background knowledge required for each subtask, and the execution order of each subtask, laying the foundation for the final decision. A decision context is constructed based on the acquired knowledge data, specifically including the original task, task understanding content, subtasks and preliminary execution strategies, historical knowledge retrieved in step S503, cases and data, feature representations and their perceptual coefficients obtained after multimodal fusion in S504, and currently available tools in the tool library. Based on the constructed decision context, the agent uses a large tea model to perform deep reasoning to simulate the decision-making process of tea garden experts, generating the final decision scheme for each subtask, including the subtask execution path, tool invocation method and order, input / output parameter requirements, exception handling, and rollback mechanisms.
[0136] The agent invokes the corresponding tools or execution modules to complete the subtask based on the decision-making scheme. In the execution module, if it is only a knowledge reasoning task such as "determining whether tea trees need pruning", the answer is output directly. If it involves the invocation of physical tools in the tea garden, such as watering or fertilizing, the corresponding physical tools are invoked to complete the task and the execution result is returned.
[0137] S506 Result Evaluation and Feedback.
[0138] After completing a subtask, since each step of the task decomposition generates an instruction, it's necessary to evaluate the returned result. If the result meets the expected goal of the subtask, the system proceeds to the next subtask; otherwise, the strategy is adjusted or the process is repeated until the subtask goal is achieved. Furthermore, if multiple subtasks have dependencies, the AI dynamically updates the execution plans for other subtasks after each subtask is completed. For example, if the pruning subtask results in a change in the tea tree canopy width, the system automatically updates the parameters for subsequent light control tasks; if the pest and disease identification result shows a high-risk level, the priority of subsequent spraying tasks is automatically increased.
[0139] After all subtasks are completed, the results of the subtasks are integrated. It is then determined whether the overall integrated result meets the user's final requirements; if it does, the final response is output to the user; if not, a new loop is triggered or the user is requested to provide more contextual information. This process continues until a final result that meets the user's requirements is generated.
[0140] Furthermore, the results of the execution module, including success, failure, returned data, and generated answers, are updated in the memory bank through a feedback mechanism for the large model to refer to in the next decision. The agent dynamically adjusts the perception coefficient, tool invocation priority, and execution strategy based on historical feedback, supporting iterative optimization based on continuous feedback to gradually improve the overall decision-making level.
[0141] This enables an intelligent closed-loop mechanism of "task understanding - task planning and generation - instruction execution - execution feedback optimization - long-term memory accumulation".
[0142] Deep semantic modeling is performed on the input task. This step generates a structured semantic representation of the task by comprehensively analyzing the core intent, key entities, parameter information, and contextual completion content, thereby achieving a deep semantic understanding of the input task.
[0143] In one specific embodiment of the present invention, a tea garden manager inputs the task instruction "determine whether the current tea trees need watering, and automatically water them if needed." The intelligent agent first performs intent recognition on the task, classifying it as a "watering timing judgment" task, and extracts entity parameters, including semantic units such as "tea trees," "watering," "whether it needs watering," and "real-time status." Then, it matches the set of environmental parameters associated with the task in the knowledge base, such as "soil moisture," "temperature," "light intensity," and "water content threshold during the growth period," and performs context fusion. Combining historical interaction information, background knowledge, and user preferences from the memory bank, it performs semantic completion and disambiguation processing on the current task. Finally, it performs deep semantic modeling on the input task, combining the preceding information to achieve deep semantic understanding of the input task.
[0144] After completing task understanding, the task is identified as a high-frequency task based on a predefined high-frequency task rule base. The task is then broken down into sub-tasks such as "acquiring real-time soil moisture content," "acquiring current weather and light information," "retrieving the optimal moisture content range for the current growth stage," "performing multimodal fusion judgment," and "generating irrigation instructions." Preliminary strategy planning is performed for each sub-task to determine the data types required for execution. During sub-task execution, the agent actively invokes soil moisture sensors, temperature and humidity nodes, and canopy cameras through the tool module to obtain current soil moisture (18%RH), tea garden air temperature (32℃), light intensity (900 lux), and leaf images, respectively. Simultaneously, the agent retrieves the suitable soil moisture range (22%–28%) for the current tea variety during the leaf expansion stage from the long-term memory database.
[0145] The agent automatically calculates the perceptual coefficients for each modality based on task relevance and data quality, obtaining 0.5 for the image modality, 0.3 for soil data, and 0.2 for meteorological data. The multimodal features are then weighted and fused. The fused feature representation shows that soil moisture is low, air temperature is high, and leaves exhibit slight curling.
[0146] Based on the aforementioned fusion features, the agent generates the final execution plan: "Execute light irrigation, recommended water volume 1.2L," and automatically calls the irrigation equipment to complete the watering through the tool module. The execution results and sensor feedback data will be written into long-term memory for dynamic optimization of subsequent tasks.
[0147] Secondly, this invention also provides a tea garden management device based on a large-scale intelligent agent, such as... Figure 2 As shown, it includes: The task understanding module 201 is used to obtain and parse the task instructions for tea garden management issued by the user, determine the task type, extract the task entity and related parameters, and generate a structured semantic representation of the task.
[0148] The task decomposition module 202 is used to decompose the task instruction into several ordered subtasks based on the structured semantic representation of the task, and generate a preliminary execution strategy for each subtask, which includes the required data source, execution steps and rules.
[0149] The data retrieval module 203 is used to retrieve the sensor data, relevant knowledge and historical cases required for execution from a pre-built memory bank for each subtask, based on the preliminary execution strategy.
[0150] The data fusion module 204 is used to evaluate the task relevance and data quality of the sensor data, related knowledge and historical cases based on the sub-task objectives, determine the corresponding perception coefficients, and perform weighted fusion of the sensor data, related knowledge and historical cases based on the perception coefficients to generate a comprehensive feature representation.
[0151] The decision generation module 205 is used to construct a decision context based on the task instructions, the task structured semantic representation, the preliminary execution strategy, the retrieval results of the memory bank, the comprehensive feature representation, and the currently available tools; and to use a pre-trained tea model to reason about the decision context to generate the final execution plan for each sub-task. The plan includes a specific execution path, a sequence of tool call instructions, input and output parameters, and an exception handling mechanism.
[0152] The task execution module 206 is used to call the corresponding tools or physical devices to execute sub-tasks according to the final execution plan; evaluate the execution results of the sub-tasks; if the preset goal is achieved, the next sub-task is executed sequentially; if the goal is not achieved, the strategy is readjusted and executed; after all sub-tasks are completed, the results are integrated and it is determined whether the final requirements of the task instruction are met, and the final response is output.
[0153] The present invention also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 The steps of a tea garden management method based on a large model intelligent agent are provided.
[0154] This invention also provides a computer device. At the hardware level, the computer device includes a processor, an internal bus, a network interface, memory, and non-volatile memory, and may also include other hardware required for various operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then executes it to achieve the above-mentioned functions. Figure 1 The steps of a tea garden management method based on a large model intelligent agent are provided.
[0155] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0156] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, as well as combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0157] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0158] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0159] It should be noted that the specific embodiments described above enable those skilled in the art to more fully understand the present invention, but do not limit the present invention in any way. Therefore, although the present invention has been described in detail in this specification, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the present invention; and all technical solutions and improvements that do not depart from the spirit and scope of the present invention are covered within the protection scope of the patent of the present invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A tea garden management method based on a large-scale intelligent agent model, characterized in that, The method is applied to a large-scale intelligent agent, and the method includes: Get and parse the task instructions for tea garden management issued by the user, determine the task type, extract the task entity and related parameters, and generate a structured semantic representation of the task; Based on the structured semantic representation of the task, and by calling a pre-set rule base that stores multiple tea garden management task templates, the task instructions are decomposed into several ordered sub-tasks, and a preliminary execution strategy containing the required data source, execution steps and rules is generated for each sub-task. For each subtask, based on the initial execution strategy, the required sensor data, relevant knowledge, and historical cases are retrieved from the pre-built memory bank. Based on the objectives of sub-tasks, the task relevance and data quality of the sensor data, related knowledge, and historical cases are evaluated to determine the corresponding perception coefficients. The sensor data, related knowledge, and historical cases are then weighted and fused according to the perception coefficients to generate a comprehensive feature representation. The perception coefficients are obtained after normalization of the task relevance scores and data quality scores of each modality. Based on the task instructions, the task's structured semantic representation, the preliminary execution strategy, the retrieval results of the memory bank, the comprehensive feature representation, and the currently available tools, a decision context is constructed; and a pre-trained tea model is used to reason about the decision context to generate the final execution plan for each sub-task. The plan includes a specific execution path, a sequence of tool call instructions, input and output parameters, and an exception handling mechanism. According to the final execution plan, call the corresponding tools or physical devices to execute subtasks; evaluate the execution results of subtasks, if the preset goal is achieved, execute the next subtask in sequence, if not, readjust the strategy and execute; after all subtasks are completed, integrate the results and determine whether the final requirements of the task instruction are met, and output the final response; The memory bank includes a long-term memory bank and a short-term memory bank; The long-term memory adopts a three-layer hybrid architecture oriented towards tea-related knowledge, including an L0 layer for storing raw sensor data, relevant knowledge in the tea field, and historical cases; an L1 layer for storing text descriptions and summary information obtained after semantic processing of L0 layer data; and an L2 layer for storing structured knowledge, rule-based conclusions, and conclusive data processed by the model. Among them, L0 layer data is extracted, summarized, and labeled before being upgraded to L1 layer, and then written to L2 layer after structuring. The short-term memory is used to calculate the importance weight of each token in the dialogue context through an attention mechanism during a single task execution, and to extract the top k tokens or fragments with the highest importance weight as key intermediate results for caching, so as to break through the context window limitation; the key intermediate results include at least one of the preliminary execution strategy, the comprehensive feature representation, and the final execution scheme; after the task is completed, the cached key intermediate results are written into the long-term memory as historical cases.
2. The method according to claim 1, characterized in that, Retrieving the necessary sensor data, relevant knowledge, and historical case studies from a pre-built memory bank includes: A hybrid retrieval strategy combining keyword matching, semantic vector similarity calculation, and structured query is used to perform a preliminary retrieval of the long-term memory. The results obtained from the preliminary retrieval are then reordered using a cross-encoder model to improve relevance, thereby obtaining the sensor data, relevant knowledge, and historical cases required for the execution of subtasks. When retrieving data from the long-term memory, if the retrieved data includes source identifier metadata, the source identifier metadata shall be provided as well. When no relevant information is found in the long-term memory, an external document retrieval tool is triggered to query the relevant information and its source, and the source identifier found is associated with the generated content and output.
3. The method according to claim 1, characterized in that, The process of decomposing the task instruction into several ordered subtasks includes: Call the pre-set rule base, which stores task templates, trigger conditions and corresponding standardized sub-task decomposition processes for multiple high-frequency tea garden management tasks; Calculate the semantic matching degree between the current task and each task template in the rule base; If a task template exists that matches a preset threshold and meets the corresponding triggering conditions, the standardized subtask decomposition process corresponding to that template will be invoked. Otherwise, using the large tea model, a subtask decomposition scheme can be generated through chain reasoning.
4. The method according to claim 1, characterized in that, The large-scale tea model is constructed in the following way: Collect text, image, and structured data in the tea industry to build a multimodal training corpus; A multimodal model containing a text encoder and a visual encoder was built based on the Transformer architecture; The multimodal model is pre-trained using the multimodal training corpus to obtain an initial model; the initial model includes the ability to understand and associate multimodal data in the tea industry. The question-and-answer pairs are extracted from tea knowledge information to construct a tea domain instruction fine-tuning dataset. The initial model is then subjected to supervised fine-tuning using the instruction fine-tuning dataset to obtain the large tea model.
5. The method according to claim 1, characterized in that, The sub-task-based objective evaluation of the sensor data, relevant knowledge, and historical cases assesses task relevance and data quality, and determines the corresponding perception coefficients, including: Based on the task type of the sub-task, obtain the task relevance score and data quality score of each modality data; The perceptual coefficient is obtained by combining the task relevance score and data quality score of each modality data and performing normalization processing.
6. A tea garden management device based on a large-scale intelligent agent, applied to the method described in claim 1, characterized in that, The device includes: The task understanding module is used to obtain and parse the task instructions for tea garden management issued by the user, determine the task type, extract the task entity and related parameters, and generate a structured semantic representation of the task. The task decomposition module is used to decompose the task instructions into several ordered subtasks based on the structured semantic representation of the task, and generate a preliminary execution strategy for each subtask, which includes the required data source, execution steps and rules. The data retrieval module is used to retrieve the sensor data, relevant knowledge, and historical cases required for execution from a pre-built memory bank for each subtask, based on the initial execution strategy. The data fusion module is used to evaluate the task relevance and data quality of the sensor data, related knowledge and historical cases based on the sub-task objectives, determine the corresponding perception coefficients, and perform weighted fusion of the sensor data, related knowledge and historical cases based on the perception coefficients to generate a comprehensive feature representation. The decision generation module is used to construct a decision context based on the task instructions, the task structured semantic representation, the preliminary execution strategy, the retrieval results of the memory bank, the comprehensive feature representation, and the currently available tools; and to use a pre-trained tea model to reason about the decision context to generate the final execution plan for each sub-task, wherein the plan includes a specific execution path, a sequence of tool call instructions, input and output parameters, and an exception handling mechanism. The task execution module is used to call the corresponding tools or physical devices to execute sub-tasks according to the final execution plan; evaluate the execution results of the sub-tasks; if the preset goal is achieved, the next sub-task is executed sequentially; if the goal is not achieved, the strategy is readjusted and executed; after all sub-tasks are completed, the results are integrated and it is determined whether the final requirements of the task instruction are met, and the final response is output.
7. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 5.
8. A computer device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 5.
Citation Information
Patent Citations
Internet of Things sensing command and dispatch intelligent method and system based on multi-modal large model
CN120475055A
Intelligent agent automatic arrangement method and system based on large language model
CN121212278A
AI programming method and system based on multilayer memory fusion
CN121541856A
Self-adaptive decision-making method and system for smart forest and fruit industry, and electronic equipment
CN122021717A