Intelligent agent planning method, system and equipment based on context awareness and medium

By employing a target function-aware directional parameter extraction mechanism and contextual semantic correlation reasoning, the problems of redundant parameter extraction and unstable execution in intelligent agent systems are solved, achieving efficient and reliable task execution.

CN121706971APending Publication Date: 2026-03-20CHINA TOWER CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202511902647.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-17
Publication Date
2026-03-20

AI Technical Summary

Technical Problem

Existing intelligent agent systems employ a global scanning mode during parameter extraction, leading to redundant parameter extraction and a lack of context-based dynamic reasoning capabilities, which impacts execution efficiency and reliability.

Method used

It adopts a target function-aware directional parameter extraction mechanism, combines parameter template matching and data type verification to filter irrelevant parameters, relies on context semantic relevance reasoning and user completion mechanisms, and uses a cosine similarity algorithm to improve parameter acquisition efficiency.

Benefits of technology

It significantly reduced the function call failure rate, enhanced the execution accuracy and stability in complex task scenarios, and improved the efficiency of multi-tool collaboration by constructing a closed-loop optimization of function priority and dependency conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121706971A_ABST
    Figure CN121706971A_ABST
Patent Text Reader

Abstract

The invention discloses an intelligent agent planning method, system and device based on context awareness and a medium, and belongs to the technical field of artificial intelligence. The method comprises the steps that firstly, user input is analyzed, structured task requirements are generated, and meanwhile, external tool function attributes and historical interaction data are collected; according to the method, an ordered execution plan is generated in combination with task requirements and tool attributes, subsequent plans are optimized by utilizing historical interaction contexts, in an execution stage, parameters required by a target function can be accurately extracted from the task requirements and context information, corresponding tools are called to complete a task, and finally, an execution result is fed back for display, so that the execution efficiency is improved. And performing execution control based on the function calling state and the result. According to the method, more intelligent task planning and execution are realized through context sensing, and the method is particularly suitable for complex task scenes needing multi-step and multi-tool cooperation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of artificial intelligence technology, and specifically relates to a context-aware intelligent agent planning method, system, device and medium. Background Technology

[0002] With the rapid development of artificial intelligence technology, intelligent agent frameworks that integrate large language models (LLMs) with external tool calling capabilities have become a research hotspot. These frameworks receive users' natural language input, automatically parse task requirements, plan execution steps, and call corresponding tool functions to automate the processing of complex tasks. They are widely used in fields such as intelligent question answering, data analysis, and process automation. Their core value lies in reducing the threshold of human-computer interaction and improving task processing efficiency. In existing technologies, the natural language processing module typically parses user commands to generate structured requirements first, and then the planning module generates a multi-step execution plan (with the tool functions corresponding to each step clearly defined) based on a full list of tool functions. The parameter extraction stage generally adopts a "global scanning" mode, that is, it selects all tool function parameters involved in the plan from user input and historical interactions before extracting the parameters, without focusing on the specific function requirements of the current step to be executed. After extraction, the tool functions are called in the planned order and the results are returned. When parameters are missing, existing systems often rely on fixed templates to prompt the user to supplement them, lacking context-based dynamic reasoning capabilities, which easily leads to tool call failures and seriously affects the execution efficiency and reliability of intelligent agents.

[0003] Therefore, a feasible and preferred approach is to extract the required parameters only for the objective function of the current step to be executed by using a target function-aware directional parameter extraction mechanism. This involves combining parameter template matching and data type validation to filter out irrelevant parameters, while relying on contextual semantic correlation reasoning and user completion mechanisms, along with a cosine similarity algorithm to improve the efficiency of missing parameter acquisition. This significantly reduces the function call failure rate and enhances the execution accuracy and stability in complex task scenarios. Summary of the Invention

[0004] To address the aforementioned issues, this application provides a context-aware intelligent agent planning method, system, device, and medium. Through a target function-aware directional parameter extraction mechanism, it extracts only the required parameters for the target function of the current step to be executed. It combines parameter template matching and data type validation to filter irrelevant parameters. Simultaneously, relying on context semantic correlation reasoning and user completion mechanisms, and combined with a cosine similarity algorithm, it improves the efficiency of missing parameter acquisition, significantly reduces the function call failure rate, and enhances the execution accuracy and stability in complex task scenarios.

[0005] This application provides a context-aware intelligent agent planning method, the method comprising, It receives and parses the task instructions input by the user, outputs structured task requirement information, stores the attribute information of all available external utility functions, and records the user's historical interaction data to form historical interaction context information. The system receives the structured task requirement information, combines it with the acquired attribute information, generates a task execution plan containing ordered function call steps, and receives the stored historical interaction context information to optimize the generation of subsequent task execution plans. Receive the task execution plan, and for the target function specified in the current step to be executed in the plan, call the required parameters of the target function from the stored task requirement information and the historical interaction context information; The system receives the required parameters, calls the corresponding stored utility function based on the required parameters to execute the task, obtains the execution result, feeds back the execution result for result display, and performs execution control based on the function call status and the execution result.

[0006] Furthermore, It receives and parses user-input task instructions, outputs structured task requirement information, stores the attribute information of all available external utility functions, and records the user's historical interaction data to form historical interaction context information, specifically including: The task instructions are segmented using a word segmentation tool to identify the task type and key information; Based on the task type and the key information, the task instruction is parsed into the structured task requirement information; Store the unique identifier, function description text, parameter list, and data type constraint information of each utility function to generate a utility function attribute information database; The system records the user's historical interaction data, including historical task instructions input by the user, historical planning schemes generated by the system, parameter extraction records, function call results, and parameter information supplemented by the user, forming the historical interaction context information.

[0007] Furthermore, Receive the structured task requirement information, and combine it with the acquired attribute information to generate a task execution plan containing ordered function call steps, specifically including: Receive the structured task requirement information and combine it with the tool function attribute information database to perform tool matching and planning generation; Using a large language model, semantic similarity is calculated. Based on the semantic similarity, the core objective of the task is compared with the functional description text of each tool function, and tool functions with target matching degree are selected. Based on the function call logic and dependencies, an ordered sequence of function call steps, including the step order, target function identifier, and expected output, is generated, and step metadata is added to obtain the task execution plan.

[0008] Furthermore, Receive the task execution plan, and for the objective function specified in the currently pending step in the plan, retrieve the required parameters of the objective function from the stored task requirement information and the historical interaction context information, specifically including: Receive the output task execution plan and identify the objective function of the current step to be executed; Invoke the parameter template generator to generate a structured parameter extraction template based on the target parameter list of the target function; Using a contextual semantic retrieval model, parameters are matched from the structured task requirement information and the historical interaction context information, and the parameter format is verified by a parameter validator. Natural language prompts are generated using contextual semantic relevance, and missing parameters are requested to be supplemented based on the natural language prompts.

[0009] Furthermore, The system receives the required parameters, calls the corresponding stored utility function based on the parameters to execute the task, obtains the execution result, provides feedback on the execution result for display, and performs execution control based on the function call status and the execution result, specifically including: The calling order is dynamically adjusted based on the priority of the target function specified in the current step to be executed; Automatically retrieve equivalent alternative functions for functions that fail to be called consecutively.

[0010] Furthermore, Receiving the stored historical interaction context information to optimize the generation of subsequent task execution plans specifically includes: Analyze the deviation rate between the function call results and the expected output of the plan, optimize the parameter extraction strategy based on user feedback, and dynamically adjust the call priority or dependency conditions of similar functions in subsequent planning according to the deviation rate.

[0011] Secondly, based on the same inventive concept, this application provides a context-aware intelligent agent planning system. The system includes: The interaction and tool management module receives and parses user-input task instructions, outputs structured task requirement information, stores the attribute information of all available external tool functions, and records the user's historical interaction data to form historical interaction context information. The planning engine module receives the structured task requirement information, combines it with the acquired attribute information, generates a task execution plan containing ordered function call steps, and receives the stored historical interaction context information to optimize the generation of subsequent task execution plans. The objective function-aware parameter extraction module receives the task execution plan and, for the objective function specified in the current step to be executed in the plan, calls the required parameters of the objective function from the stored task requirement information and the historical interaction context information. The execution control module receives the required parameters, calls the corresponding stored tool functions based on the required parameters to execute the task, obtains the execution result, feeds back the execution result for result display, and performs execution control based on the function call status and the execution result.

[0012] Thirdly, this application also provides an electronic device, including at least one processor and at least one memory electrically connected; The memory is electrically connected to the processor, wherein the memory stores instructions executable by at least one of the processors, the instructions being executed by at least one of the processors to enable at least one of the processors to perform any of the context-aware intelligent agent planning methods described above.

[0013] Fourthly, this application also provides a computer storage medium, wherein a computer program is stored within the computer-readable storage medium; When the computer program is executed by the processor, it implements any of the context-aware intelligent agent planning methods described above.

[0014] Fifthly, this application also provides a computer program product, which is stored in at least one storage medium; The computer program product includes several instructions for causing at least one electronic device to execute any of the context-aware intelligent agent planning methods described above.

[0015] Compared with the prior art, this application has the following advantages: 1. Through the objective function-aware directional parameter extraction mechanism, the required parameters are extracted only for the objective function of the current step to be executed. Combined with parameter template matching and data type validation to filter irrelevant parameters, the problem of redundant parameter extraction in traditional systems is solved. At the same time, relying on the dual mechanisms of context semantic correlation reasoning and user completion, and with the cosine similarity algorithm, the efficiency of missing parameter acquisition is improved, significantly reducing the function call failure rate and enhancing the execution accuracy and stability in complex task scenarios. 2. Construct a closed-loop process of "interaction-planning-execution-optimization", dynamically adjust function priorities and dependencies by using historical interaction context and deviation rate analysis, achieve fine-grained control through priority scheduling, failure substitution and deviation verification, adapt large language models to meet requirements through domain fine-tuning, and support cross-task learning by storing historical data in time series, effectively improving the efficiency of multi-tool collaboration and the self-optimization capability of task planning.

[0016] Other features and advantages of this application will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the application. The objectives and other advantages of this application may be realized and obtained by means of the structures pointed out in the description, claims and drawings. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A flowchart illustrating the context-aware intelligent agent planning method according to an embodiment of this application is shown. Figure 2 A schematic diagram of the structure of a context-aware intelligent agent planning system according to an embodiment of this application is shown. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] Figure 1 An example of a context-aware intelligent agent planning method according to an embodiment of this application is illustrated. Figure 1 As shown in the figure, the context-aware intelligent agent planning method of this application includes the following steps: S1 receives and parses the task instructions input by the user, outputs structured task requirement information, stores the attribute information of all available external tool functions, and records the user's historical interaction data to form historical interaction context information. S2, receive the structured task requirement information, combine it with the acquired attribute information, generate a task execution plan containing ordered function call steps, and receive the stored historical interaction context information to optimize the generation of subsequent task execution plans; S3, receive the task execution plan, and for the target function specified in the current step to be executed in the plan, call the required parameters of the target function from the stored task requirement information and the historical interaction context information; S4, receive the required parameters, call the corresponding stored tool function to execute the task based on the required parameters, and then obtain the execution result. Feed back the execution result for result display, and perform execution control based on the function call status and the execution result.

[0021] In the embodiments of this application, step S1 specifically includes: S11, The task instructions are segmented using a word segmentation tool to identify the task type and key information; S12, the task instruction is parsed into the structured task requirement information according to the task type and the key information; S13 stores the unique identifier, function description text, parameter list, and data type constraint information of each utility function, and generates a utility function attribute information database; S14, record the user's historical interaction data, including the user's input of historical task instructions, the system-generated historical planning schemes, parameter extraction records, the function call results, and the parameter information supplemented by the user, to form the historical interaction context information.

[0022] In the specific implementation process, a multi-stage natural language parsing process is adopted. First, the task instructions are segmented by word segmentation tools (such as Jieba and NLTK). Then, the task type is identified by pre-trained intent classification models (such as BERT (Bidirectional Encoder Representations from Transformers) fine-tuning model). Finally, key information (such as time, location, and object) is extracted by entity recognition models.

[0023] For example: The task instruction is: "Use a map tool to find the route from the company to the airport, and then use a weather tool to find the weather forecast for the destination tomorrow." The structured requirements are: {"Task Type": "Multi-tool Collaboration", "Subtask 1": {"Type": "Route Query", "Tool": "Map Tool", "Start Point": "Company", "Destination": "Airport"}, "Subtask 2": {"Type": "Weather Query", "Tool": "Weather Tool", "Location": "Destination", "Time": "Tomorrow"}}.

[0024] The database storing tool function attribute information uses a key-value pair structure, with the function's unique identifier as the key, linking information such as function description and parameter list, and supports millisecond-level query response; historical interaction context information is indexed by "task ID + timestamp + data type" to ensure that subsequent backtracking calls can be quickly made.

[0025] In the embodiments of this application, step S2 specifically includes: S21, Receive the structured task requirement information and combine it with the tool function attribute information database to perform tool matching and planning generation; S22, using a large language model, calculate semantic similarity, and compare the core objective of the task with the functional description text of each tool function based on the semantic similarity to select the tool functions with the target matching degree. S23. Based on the function call logic and dependencies, generate an ordered sequence of function call steps containing the step order, target function identifier and expected output, and add step metadata to obtain the task execution plan.

[0026] In the specific implementation process, a large language model is integrated to receive the output structured task requirement information, obtain the attribute information of all available external tool functions according to the tool query request, and combine the obtained attribute information of all available external tool functions to generate a task execution plan containing ordered function call steps. It also receives the stored historical interaction context information to optimize the generation of subsequent task execution plans. The large language model uses open-source models that support function calls, including but not limited to LLaMA 2-7B-Chat. It guides the generation of structured plans through prompt word engineering. In the tool matching stage, the model compares the core task objective (such as "route query") with the functional description text of the tool function using semantic vectors. It uses cosine similarity to calculate the matching degree (with a threshold of 0.7) to filter out qualified tool functions. The generated task execution plan includes step metadata.

[0027] For example: The following parameters are defined: `[{"Step Number": "Step_001", "Target Function ID": "MapTool_001", "Function Description": "Route Query", "Parameter Requirements": ["Start Point", "End Point"], "Preconditions": null, "Execution Priority": 1},` and `{"Step Number": "Step_002", "Target Function ID": "WeatherTool_001", "Function Description": "Weather Query", "Parameter Requirements": ["Location", "Date"], "Preconditions": "Step_001 Completed", "Execution Priority": 2}]`. These parameters clearly define the dependencies and execution order of each step.

[0028] In the embodiments of this application, step S3 specifically includes: S31, Receive the output task execution plan and identify the objective function of the current step to be executed; S32, Invoke the parameter template generator to generate a structured parameter extraction template based on the target parameter list of the target function; S33, using a contextual semantic retrieval model, parameters are matched from the structured task requirement information and the historical interaction context information, and the parameter format is verified by a parameter validator; S34, generate natural language prompts using contextual semantic relevance, and request the supplementation of missing parameters based on the natural language prompts.

[0029] In the specific implementation process, the task execution plan is received and the required parameters of the target function are extracted from the stored task requirement information and historical interaction context information for the target function specified in the current step to be executed in the plan, without extracting irrelevant parameters of other functions. The step parser first locks the target function of the current step to be executed (i.e., the completion tool function selection), calls the parameter template generator, and generates a structured parameter extraction template based on the required / optional parameter list of the function, i.e. the target parameter list (such as ["starting point", "end point"] of MapTool_001); During the extraction process, a contextual semantic retrieval model (such as Sentence-BERT) is used to match parameters from task requirements information and historical context. For example, "Starting point: XX Road XX No." is extracted from the historical interaction "Company address is XX Road XX No.". At the same time, a parameter validator is used to verify the parameter format through regular expressions (such as date parameters needing to match the "YYYY-MM-DD" format). Parameters that do not meet the type constraints are directly filtered to ensure that only valid parameters are extracted.

[0030] In the embodiments of this application, step S4 specifically includes: S41, dynamically adjust the calling order based on the priority of the target function specified in the current step to be executed; S42 automatically retrieves equivalent alternative functions for functions that fail to be called consecutively.

[0031] In the specific implementation process, the system receives the extracted parameters from the target function perception output, calls the corresponding stored tool function based on the extracted parameters to execute the task, and then obtains the execution result. The execution result is then fed back for result display and supports fine-grained control based on function call status and result. After the execution result is fed back, it is not only used for user display, but is also marked as 'function call result' and stored in the historical interaction context to provide raw data for the deviation rate analysis of the subsequent planning engine. Function calls are implemented through a standardized RESTful API interface. The extracted parameters are encapsulated into a JSON request body, and a 3-second timeout retry mechanism is set. In fine-grained management, priority is divided into 1-5 levels (level 1 is the highest). When both Step_001 and Step_002 meet the execution conditions, Step_001 with priority 1 is executed first. If the number of consecutive failed function calls reaches a preset threshold (default 3 times), the system automatically retrieves a substitute function with the same function from the utility function library and initiates the call. In the deviation rate verification, when Dev>0.3 (preset threshold), a second parameter extraction process is triggered to ensure that the execution result meets expectations.

[0032] Specifically, in this embodiment, optimizing the generation of subsequent task execution plans includes: analyzing the deviation rate between function call results and expected outputs, optimizing parameter extraction strategies based on user feedback, and dynamically adjusting the call priority or dependency conditions of similar functions in subsequent plans according to the deviation rate.

[0033] In the specific implementation process, the deviation rate of each function call result is calculated based on the function call results in the historical interaction context information and the planned expected output; the function calls are classified according to the magnitude of the deviation rate, for example, function calls with a deviation rate higher than a preset threshold are marked as high deviation calls, and function calls with a deviation rate lower than a preset threshold are marked as low deviation calls; Collect user feedback on the parameter extraction results, such as whether the user has modified the parameter extraction results or added missing parameters; adjust the parameter extraction template based on user feedback, such as adding new parameter extraction rules or modifying existing parameter extraction rules. Based on the deviation rate analysis of function call results, adjust the calling priority of similar functions in subsequent planning. For example, reduce the priority of functions with high deviation and increase the priority of functions with low deviation. Based on the deviation rate analysis of function call results, adjust the dependency conditions of similar functions in subsequent planning. For example, add new preconditions for high-deviation calls, or delete some preconditions for low-deviation calls.

[0034] In this embodiment, the task execution plan includes an ordered sequence of function call steps, wherein the current step to be executed specifies a unique target function; Historical interaction context information includes: user-inputted historical task instructions, system-generated historical planning schemes, parameter extraction records, function call results, and user-added parameter information. The historical interaction context information is stored in chronological order, specifically using a time-series database (such as InfluxDB), and supports data management by task lifecycle.

[0035] For example, when a user adds the parameter "the destination is Shanghai Pudong Airport", this information is associated with the original task ID and marked as "parameter supplement". This supplementary information can then be retrieved directly through the task ID without having to ask the user again.

[0036] In this embodiment, the parameter completion content perceived by the objective function includes: inferring missing parameters based on contextual semantic relevance, or generating natural language prompts to request the user to complete them; the contextual semantic relevance is calculated using a cosine similarity algorithm, and the formula is:

[0037] In the formula: Missing parameter With contextual text fragments Semantic relevance; The dimension is the word vector. Missing parameter The first word vector Dimensional components; For contextual text fragments The first word vector Dimensional components.

[0038] When a parameter is missing (e.g., "date" is not extracted), the system first retrieves text fragments containing relevant keywords from the historical context based on the parameter requirements of the objective function of the current step to be executed (e.g., the "date" parameter of WeatherTool_001) and calculates the semantic relevance. If the highest Sim(a,b) > 0.6, the parameter corresponding to the fragment is used as the reasoning result (e.g., reasoning "date: tomorrow" from "departing tomorrow"). If the reasoning fails, a standardized prompt message matching the parameter format of the function is generated: "Please supplement the specific date of the weather query (format: YYYY-MM-DD or 'tomorrow' 'the day after tomorrow')" and pushed to the user interface.

[0039] In this embodiment, irrelevant parameters perceived by the objective function refer to parameter information that does not belong to the list of required parameters or the list of optional parameters of the objective function of the current step to be executed, that is, parameters that do not match the data type constraints of the function parameters; the objective function perceives irrelevant parameters by comparing parameter names and data types.

[0040] In this embodiment, refined control includes: dynamically adjusting the calling order based on the priority of the target function of the current step to be executed; automatically retrieving equivalent functions for functions that fail to be called consecutively (based on stored function attribute information); and achieving closed-loop control by verifying the deviation rate between the execution result and the expected output of the function. The deviation rate is calculated using the following formula:

[0041] In the formula: The deviation rate of the execution result; This refers to the actual output value of the function. To plan the expected output value; The minimum value (takes a value of 1) e-6 (), used to avoid division by zero.

[0042] In this embodiment, the objective function perception process achieves targeted extraction through the following steps: Identify the unique identifier of the objective function in the current step to be executed; The required and optional parameter lists corresponding to the target function are called to generate a parameter extraction template. Match only the names and data types of parameters within the template from the task requirements information and historical interaction context information, and filter out non-matching items.

[0043] In this embodiment, the large language model performs the following steps: A1. Perform intent recognition on the output structured task requirement information and extract the core task objectives; In A1, the large language model focuses on core verb phrases in structured needs (such as "check route" and "check weather") through an attention mechanism, and accurately locates the task target by combining domain dictionaries (such as transportation domain and meteorological domain); the matching degree ranking results in step A2 serve as the core basis for tool selection. For example, in the "route query" task, MapTool_001 with a matching degree of 0.85 is selected over the general query tool with a matching degree of 0.6. A2. Calculate the matching degree based on the semantic similarity between the core objectives of the task and the text describing the function's functionality. Sort and filter tool functions according to the matching degree. The semantic similarity is calculated using the cosine similarity algorithm. A3. Generate an ordered sequence of function call steps, including the order of steps, the target function identifier, and the expected output, based on the function call logic and dependencies.

[0044] In this embodiment, the task execution plan is optimized in the following ways: Analyze the deviation rate between function call results and the planned expected output in the historical interaction context information; Specifically, the deviation rate analysis is grouped and statistically analyzed by "tool type + task scenario". For example, when the deviation rate of the "weather query tool" in the "travel scenario" is >0.2 for 3 consecutive times, the priority of calling the "high-precision weather tool" in this scenario will be increased, and "geolocation correction" will be added as a prerequisite step. User feedback data (such as the correction of the "date" parameter prompt) will be used as semantic model training data. By increasing the corpus weight of "date expression variants" (such as "next day" and "next Monday"), the accuracy of parameter inference will be improved.

[0045] In this embodiment, group statistics include the following steps: Tool clustering: The K-means algorithm clusters the data into 3 classes based on their functional descriptions; Scene labeling: Labels output by an intent classification model; Statistical period: The moving average deviation rate is calculated every 24 hours.

[0046] If the deviation rate continues to exceed the preset threshold, the calling priority or dependency conditions of similar functions in subsequent planning will be adjusted. Based on user feedback data regarding parameter completion requests, optimize the semantic relevance inference strategy.

[0047] like Figure 2 As shown, based on the same inventive concept, this application also provides a context-aware intelligent agent planning system corresponding to the above method; The system includes: The interaction and tool management module receives and parses user-input task instructions, outputs structured task requirement information, stores the attribute information of all available external tool functions, and records the user's historical interaction data to form historical interaction context information. The planning engine module receives the structured task requirement information, combines it with the acquired attribute information, generates a task execution plan containing ordered function call steps, and receives the stored historical interaction context information to optimize the generation of subsequent task execution plans. The objective function-aware parameter extraction module receives the task execution plan and, for the objective function specified in the current step to be executed in the plan, calls the required parameters of the objective function from the stored task requirement information and the historical interaction context information. The execution control module receives the required parameters, calls the corresponding stored tool functions based on the required parameters to execute the task, obtains the execution result, feeds back the execution result for result display, and performs execution control based on the function call status and the execution result.

[0048] Based on the same inventive concept, this application also provides an electronic device. The electronic device of this application includes at least one processor and at least one memory electrically connected to the processor. The memory is electrically connected to the processor, and the memory stores instructions executable by the at least one processor. These instructions are executed by the at least one processor to enable the at least one processor to perform the context-aware intelligent agent planning method as described above.

[0049] It should be noted that the electrical connections between the various units mentioned above do not necessarily represent the connections between lines. Any indirect connection method can be applied to the embodiments of this application as long as it achieves the purpose of this application.

[0050] Based on the same inventive concept, this application also provides a computer storage medium storing a computer program, which, when executed by a processor, implements the context-aware intelligent agent planning method described above.

[0051] Based on the same inventive concept, this application also provides a computer program product, which is stored in at least one storage medium; the computer program product includes several instructions to cause at least one computer device to execute the context-aware intelligent agent planning method described above.

[0052] Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A context-aware intelligent agent planning method, characterized in that, The method includes: It receives and parses the task instructions input by the user, outputs structured task requirement information, stores the attribute information of all available external utility functions, and records the user's historical interaction data to form historical interaction context information. The system receives the structured task requirement information, combines it with the acquired attribute information, generates a task execution plan containing ordered function call steps, and receives the stored historical interaction context information to optimize the generation of subsequent task execution plans. Receive the task execution plan, and for the target function specified in the current step to be executed in the plan, call the required parameters of the target function from the stored task requirement information and the historical interaction context information; The system receives the required parameters, calls the corresponding stored utility function based on the required parameters to execute the task, obtains the execution result, feeds back the execution result for result display, and performs execution control based on the function call status and the execution result.

2. The method according to claim 1, characterized in that, It receives and parses user-input task instructions, outputs structured task requirement information, stores the attribute information of all available external utility functions, and records the user's historical interaction data to form historical interaction context information, specifically including: The task instructions are segmented using a word segmentation tool to identify the task type and key information; Based on the task type and the key information, the task instruction is parsed into the structured task requirement information; Store the unique identifier, function description text, parameter list, and data type constraint information of each utility function to generate a utility function attribute information database; The system records the user's historical interaction data, including historical task instructions input by the user, historical planning schemes generated by the system, parameter extraction records, function call results, and parameter information supplemented by the user, forming the historical interaction context information.

3. The method according to claim 1, characterized in that, Receive the structured task requirement information, and combine it with the acquired attribute information to generate a task execution plan containing ordered function call steps, specifically including: Receive the structured task requirement information and combine it with the tool function attribute information database to perform tool matching and planning generation; Using a large language model, semantic similarity is calculated. Based on the semantic similarity, the core objective of the task is compared with the functional description text of each tool function, and tool functions with target matching degree are selected. Based on the function call logic and dependencies, an ordered sequence of function call steps, including the step order, target function identifier, and expected output, is generated, and step metadata is added to obtain the task execution plan.

4. The method according to claim 1, characterized in that, Receive the task execution plan, and for the objective function specified in the currently pending step in the plan, retrieve the required parameters of the objective function from the stored task requirement information and the historical interaction context information, specifically including: Receive the output task execution plan and identify the objective function of the current step to be executed; Invoke the parameter template generator to generate a structured parameter extraction template based on the target parameter list of the target function; Using a contextual semantic retrieval model, parameters are matched from the structured task requirement information and the historical interaction context information, and the parameter format is verified by a parameter validator. Natural language prompts are generated using contextual semantic relevance, and missing parameters are requested to be supplemented based on the natural language prompts.

5. The method according to claim 1, characterized in that, The system receives the required parameters, calls the corresponding stored utility function based on the parameters to execute the task, obtains the execution result, provides feedback on the execution result for display, and performs execution control based on the function call status and the execution result, specifically including: The calling order is dynamically adjusted based on the priority of the target function specified in the current step to be executed; Automatically retrieve equivalent alternative functions for functions that fail to be called consecutively.

6. The method according to claim 1, characterized in that, Receiving the stored historical interaction context information to optimize the generation of subsequent task execution plans specifically includes: Analyze the deviation rate between the function call results and the expected output of the plan, optimize the parameter extraction strategy based on user feedback, and dynamically adjust the call priority or dependency conditions of similar functions in subsequent planning according to the deviation rate.

7. A context-aware intelligent agent planning system, characterized in that, The system includes: The interaction and tool management module receives and parses user-input task instructions, outputs structured task requirement information, stores the attribute information of all available external tool functions, and records the user's historical interaction data to form historical interaction context information. The planning engine module receives the structured task requirement information, combines it with the acquired attribute information, generates a task execution plan containing ordered function call steps, and receives the stored historical interaction context information to optimize the generation of subsequent task execution plans. The objective function-aware parameter extraction module receives the task execution plan and, for the objective function specified in the current step to be executed in the plan, calls the required parameters of the objective function from the stored task requirement information and the historical interaction context information. The execution control module receives the required parameters, calls the corresponding stored tool functions based on the required parameters to execute the task, obtains the execution result, feeds back the execution result for result display, and performs execution control based on the function call status and the execution result.

8. An electronic device, characterized in that, Includes at least one processor and at least one memory electrically connected; The memory is electrically connected to the processor, wherein the memory stores instructions executable by at least one of the processors, the instructions being executed by at least one of the processors to enable at least one of the processors to perform the context-aware intelligent agent planning method as described in any one of claims 1-6.

9. A computer storage medium, characterized in that, The computer-readable storage medium stores a computer program. When the computer program is executed by the processor, it implements the context-aware intelligent agent planning method according to any one of claims 1-6.

10. A computer program product, characterized in that, The computer program product is stored in at least one storage medium; The computer program product includes a number of instructions for causing at least one electronic device to execute the context-aware intelligent agent planning method according to any one of claims 1-6.

Citation Information

Cited By

  • Tool plan execution method and device, electronic equipment and storage medium

    CN122086574A

  • Tool plan execution method, apparatus, electronic device, and storage medium

    CN122086574B