Intelligent agent task autonomous execution method, device, equipment, storage medium and product

By embedding core missions into AI agents and combining them with environmental information to construct long-term tasks, and by adopting a two-stage task planning and execution strategy, the problems of AI agent autonomy and goal consistency are solved, and autonomous task generation and optimized resource utilization are realized.

CN123070164APending Publication Date: 2026-11-10BEIJING PHIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611115626.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-11-10

AI Technical Summary

Technical Problem

Existing AI agents are highly dependent on user instructions, lack autonomy, are unable to generate tasks independently, and lack long-term goal consistency and resource scheduling capabilities during task execution.

Method used

By embedding the core mission of the intelligent agent into the system prompts of the preset model, combining the current environmental information to construct long-term tasks, and performing task analysis and reasoning to generate autonomous reasoning results, a two-stage explicit separation of task planning and execution strategy is adopted to dynamically evaluate resource utilization and ensure the consistency of task objectives.

Benefits of technology

It enables intelligent agents to autonomously generate and execute tasks without the need for frequent user interaction and input of instructions, thereby improving autonomy and consistency with long-term goals, and optimizing resource utilization and task scheduling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123070164A_ABST
    Figure CN123070164A_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an agent task autonomous execution method and device, equipment, storage medium and product. The method comprises: obtaining an agent core mission; embedding the agent core mission into a system prompt of a preset model; calling the preset model to construct a long-range task corresponding to the agent core mission according to the system prompt and current environment information; and performing task analysis and reasoning on the long-range task to generate an agent task autonomous reasoning result. The method is used to realize autonomous generation and execution of an agent task based on a core mission, and improve the autonomy of the agent.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, apparatus, device, storage medium and product for autonomous execution of intelligent agent tasks. Background Technology

[0002] An Artificial Intelligence Agent (AI Agent), also known as an AI agent, is an entity capable of autonomously perceiving its environment, making inferences and decisions, and taking actions to achieve its goals. AI agents typically use a Large Language Model (LLM) as their core driving force, executing tasks by calling the LLM → executing tools → continuing inference.

[0003] Currently, AI agents typically rely on user-input instructions to generate corresponding tasks, and then execute these tasks by calling LLM → execution tools → continuing inference.

[0004] The existing AI agents are highly dependent on user commands and lack autonomy. Summary of the Invention

[0005] The intelligent agent task autonomous execution method, apparatus, device, storage medium and product provided in the embodiments of this application are used to enable intelligent agents to autonomously generate and execute tasks, thereby improving their autonomy.

[0006] In a first aspect, embodiments of this application provide a method for autonomous execution of intelligent agent tasks, including:

[0007] To understand the core mission of intelligent agents;

[0008] The core mission of the intelligent agent is embedded into the system prompts of the preset model;

[0009] The preset model is invoked to construct a long-range task corresponding to the core mission of the intelligent agent based on the system prompts and current environment information;

[0010] The long-term task is analyzed and reasoned to generate the autonomous reasoning result of the intelligent agent.

[0011] In one possible implementation, embedding the agent's core mission into the system prompt of the preset model includes:

[0012] Embed the core mission of the intelligent agent into the header area of ​​the system prompt;

[0013] The head region is marked so that when the preset model is invoked, the core mission of the agent in the head region remains unchanged.

[0014] In one possible implementation, the step of performing task analysis and reasoning on the long-range task to generate the agent's autonomous task reasoning result includes:

[0015] Decompose the long-term task into at least one parent task;

[0016] Based on the task context of the parent task and the current environment information, a subtask list is constructed. The subtask list includes at least N subtasks corresponding to the parent task, the dependencies between the subtasks, and the task scheduling strategy, where N is a positive integer.

[0017] Based on the aforementioned dependencies and task scheduling strategy, the execution order of each subtask is determined;

[0018] Execute each subtask according to the execution order described above;

[0019] The autonomous reasoning result is generated based on the execution results of each subtask.

[0020] In one possible implementation, it also includes:

[0021] When constructing a sub-agent of the intelligent agent, the core mission of the intelligent agent is embedded into the sub-agent, so that the sub-agent executes the parent task and / or the sub-task based on the core mission of the intelligent agent;

[0022] Or, it may also include:

[0023] Serialize the task context of the parent task stored in memory into a structured snapshot;

[0024] The structured snapshot is then transferred to external storage.

[0025] Delete the task context of the parent task from the memory;

[0026] When the execution of the child task corresponding to the parent task is detected to be completed, the structured snapshot is loaded from the external storage space into the memory.

[0027] In one possible implementation, after loading the structured snapshot from the external storage space into the memory, the method further includes:

[0028] Based on the subtask results after the subtask is completed and the structured snapshot, construct the prompt information of the preset model;

[0029] The preset model is invoked to continue executing the parent task based on the prompt information.

[0030] In one possible implementation, the available resources of the agent are obtained, including at least one of the limiting parameters of the preset model, concurrent slot occupancy information, memory occupancy information, and energy consumption budget; based on the available resources, the task scheduling strategy is determined.

[0031] Alternatively, the execution of each subtask includes:

[0032] Extract the task context of the parent task to generate a parent task context summary;

[0033] The preset model is invoked to execute the subtask based on the parent task context summary, the subtask context, the system prompt, and the current environment information;

[0034] The preset model is invoked to extract the execution results of the sub-tasks and generate a task execution result context summary.

[0035] In one possible implementation, the task analysis and reasoning for the long-range task includes:

[0036] Mark the occurrence time of each event in the current environment information;

[0037] The preset model is invoked to perform task analysis and reasoning on the long-term task based on the event occurrence time of each event in the current environment information;

[0038] Alternatively, the method may further include:

[0039] The knowledge of the intelligent agent is hierarchically divided into prior knowledge, training knowledge, and experiential knowledge. The prior knowledge includes at least the core mission of the intelligent agent, the training knowledge includes knowledge used to train the preset model, and the experiential knowledge includes knowledge generated by the preset model.

[0040] The prior knowledge is marked as unmodifiable.

[0041] In one possible implementation, after generating the autonomous reasoning result of the agent's task, the method further includes: verifying the autonomous reasoning result of the task according to the agent's core mission to determine whether the autonomous reasoning result of the task matches the agent's core mission.

[0042] Secondly, embodiments of this application provide an intelligent agent task autonomous execution device, comprising:

[0043] The acquisition module is used to acquire the core mission of the intelligent agent;

[0044] An embedding module is used to embed the core mission of the intelligent agent into the system prompts of a preset model;

[0045] The construction module is used to call the preset model to construct a long-range task corresponding to the core mission of the intelligent agent based on the system prompts and current environment information;

[0046] The analysis module is used to perform task analysis and reasoning on the long-term task and generate the task autonomous reasoning results of the intelligent agent.

[0047] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0048] The memory stores computer-executed instructions;

[0049] The processor executes computer execution instructions stored in the memory, causing the processor to perform the first aspect and / or various possible implementations of the first aspect as described above.

[0050] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the first aspect and / or various possible implementations of the first aspect.

[0051] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the first aspect and / or various possible implementations of the first aspect.

[0052] The intelligent agent task autonomous execution method, apparatus, device, storage medium, and product provided in this application embodiment, by writing the core mission of the intelligent agent into the system prompts, and enabling the preset model to construct long-term tasks in combination with the current environment information under the system prompts, and then forming task analysis and reasoning results around the long-term tasks, can realize the intelligent agent to autonomously generate tasks based on the core mission and promote their execution, without the need for frequent user interaction and input of instructions, thereby improving the autonomy of the intelligent agent. Attached Figure Description

[0053] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0054] Figure 1 This application provides an embodiment of an intelligent agent task autonomous execution method;

[0055] Figure 2 The task autonomous reasoning flowchart provided in the embodiments of this application;

[0056] Figure 3 A flowchart of the task context processing method provided in the embodiments of this application;

[0057] Figure 4 A task execution flowchart provided for embodiments of this application;

[0058] Figure 5 A schematic diagram of the Structured Context Digest Passing Protocol provided in this application embodiment;

[0059] Figure 6 An overall architecture diagram of a mission-driven intelligent agent system provided for embodiments of this application;

[0060] Figure 7 A schematic diagram of the structure of the intelligent agent task autonomous execution device provided in this application;

[0061] Figure 8 A schematic diagram of the structure of the electronic device provided in this application.

[0062] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0063] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application.

[0064] An Artificial Intelligence Agent (AI Agent), also known as an AI agent, is an entity capable of autonomously perceiving its environment, making inferences and decisions, and taking actions to achieve its goals. Compared to the traditional Large Language Model (LLM), which employs a completely non-autonomous "question → answer" task execution method, an AI agent can perceive its environment through sensors, use the LLM for inference and decision-making, and then act on the environment through execution tools to autonomously complete complex goals. The workflow of an AI agent is: perception (receiving the task) → thinking (planning with the LLM) → action (calling tools) → observation (obtaining results) → further thinking (correcting or continuing) → … → until the task is completed.

[0065] Currently, AI agents mainly suffer from the following defects: (1) The parent task context cannot be released: When sub-tasks are delegated to independent sub-agent processes through the sub-agent mechanism, the parent agent's context information remains in memory after the sub-tasks are delegated and cannot be unloaded; (2) Lack of a mission-driven spontaneous task generation mechanism: Currently, AI agent frameworks are all task-driven reactive architectures, lacking initiative and consistency with long-term goals; (3) Tight coupling between task decomposition and execution: Large language models perform task planning and task execution simultaneously in the same round of inference, lacking explicit separation between the two stages; (4) Lack of priority resources Source-aware scheduling: Currently, AI agents lack dynamic evaluation of constraints such as the rate limit of the big oracle model, concurrent slots and computing resources; (5) Lack of true task time cognition ability: Currently, AI agents only have static timestamp injection, without a mechanism for predicting task time and the ability to analyze deviations; (6) Lack of hierarchical and immutable protection of knowledge: Currently, the prior knowledge and runtime knowledge of AI agents are mixed at the same level, which may lead to knowledge overwriting, dilution and tampering; (7) Lack of structured summary protocol for context passing: Currently, AI agents lack structured, machine-parsable context summary protocols, resulting in low information transmission efficiency.

[0066] To address the aforementioned issues, this application provides a method for autonomous task execution by an intelligent agent. This method enables an intelligent agent to generate long-term tasks based on a core mission and execute them autonomously, ensuring that the core mission serves as the task objective during execution and improving the agent's initiative and the consistency of task objectives.

[0067] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0068] Figure 1 The autonomous execution method for intelligent agent tasks provided in the embodiments of this application, such as Figure 1 As shown, the method specifically includes the following steps:

[0069] Step 110: Obtain the core mission of the intelligent agent;

[0070] Step 120: Embed the core mission of the intelligent agent into the system prompts of the preset model;

[0071] Step 130: Invoke the preset model to construct a long-range task corresponding to the core mission of the intelligent agent based on system prompts and current environment information;

[0072] Step 140: Perform task analysis and reasoning on long-term tasks to generate the autonomous reasoning results of the intelligent agent.

[0073] The method provided in this embodiment can be executed autonomously by an intelligent agent, which can be deployed on relevant electronic devices and other hardware. The intelligent agent collaboratively implements this method by utilizing the relevant hardware capabilities provided by the electronic devices (such as sensors, memory, and disks).

[0074] For example, electronic devices may include servers, edge computing nodes, terminal devices, etc.

[0075] The method provided in this embodiment can be executed immediately after the agent is started. It automatically initiates long-term task five based on the agent's core mission and continuously iterates and advances, without requiring the user to give instructions each time. This solves the problem that traditional agents lack a mission-driven spontaneous task generation mechanism and do not have initiative and consistency with long-term goals.

[0076] In step 110 above, the core mission of the agent is used to characterize the fundamental goal that the agent continuously follows during long-term autonomous operation. Its content is not a temporary instruction in a single session, nor a local goal of a certain sub-task, but a stable constraint that runs through task construction, task analysis and reasoning, and subsequent execution judgment.

[0077] For example, the core mission of an intelligent agent can be set as "protecting humanity and continuing human civilization".

[0078] The core mission of an intelligent agent can be embedded into the agent in text form, clearly defining the boundaries and scope of the goals the agent should continuously achieve. When the agent acquires this core mission, the process may include determining the mission source, reading the content, parsing the format, and verifying its validity. The verified core mission is then written into the current task context to trigger subsequent steps.

[0079] In this embodiment, the agent's core mission can be marked as unmodifiable, meaning it remains unchanged at any stage. This prevents the agent from losing its task objective during long-term operation, ensuring long-term goal consistency. By setting the agent's core mission, subsequent planning and reasoning do not rely on fragmented text recall from multi-turn dialogues, thus maintaining stable goal orientation during task transitions across stages.

[0080] In step 120 above, the system prompts provide the preset model with core constraint information that must be continuously followed during this round and subsequent inference. The system prompts are not part of the user input, but rather control text within the model call chain used to define the behavioral boundaries of the model when receiving environmental information, constructing long-range tasks, and outputting inference results.

[0081] The core mission of the intelligent agent can be embedded into system prompts, which can be achieved by using template splicing, field mapping, or other prompt construction methods.

[0082] For example, the agent can first read the system prompts corresponding to the preset model, and then standardize the agent's core mission by removing irrelevant symbols and retaining key objectives, boundary conditions, and persistence requirements. Subsequently, each time the preset model is invoked, the standardized mission text is written into the system prompts, enabling the preset model to perform target determination and task reasoning based on the core mission.

[0083] The preset model is the main model for performing task construction and task analysis reasoning. It can be a large language model deployed on a local server or cloud inference node, or a multimodal inference model with planning and context processing capabilities.

[0084] By embedding the core mission of the agent into the system prompts used by the preset model, the dynamic information subsequently received by the preset model is interpreted under the same stable constraints, thereby constraining the direction of long-term task generation and the boundary of task analysis and reasoning, so that the agent has long-term goal consistency.

[0085] In step 130 above, the current environmental information is used to characterize the set of states that the agent can perceive, utilize, and that are relevant to task execution at the current moment. The current environmental information can be collected by information acquisition devices such as sensors and then transmitted to the agent.

[0086] For example, the current environmental information may include the agent's own state, external resource state, scene event state, and execution history state. Specifically, the agent's own state includes its existing capabilities, available tools, and remaining computing power or battery power; the external resource state includes the availability of personnel, equipment, materials, network links, or service interfaces; the scene event state includes the scope of the disaster, equipment failure level, project milestone deviations, or changes in user requirements; and the execution history state includes completed actions, failure records, current interruption points, or pending confirmation items.

[0087] Before calling the preset model, the agent combines the system prompts with the processed current environmental information into a complete model input. This input retains the boundaries of mission constraints and environmental facts, and does not mix unconfirmed guesses into the environmental fact field.

[0088] After receiving the input, the preset model performs semantic parsing and target association analysis on the environmental information, identifies key state variables related to the core mission of the intelligent agent, and constructs long-term tasks accordingly.

[0089] Among them, long-term tasks are cross-stage task objectives formed by the preset model for the above set of states under the constraints of the core mission of the agent.

[0090] For example, the construction process of a long-range task may specifically include stages such as environment modeling, target mapping, task abstraction, and task generation.

[0091] In the environment modeling phase, the agent organizes the current environmental information into a structured context, which may include fact items, time-sensitive items, constraint items, and resource items. Fact items record the objective state, time-sensitive items record the information collection time, constraint items record insurmountable limitations, and resource items record the entities and capabilities that can be used for execution.

[0092] During the target mapping phase, the pre-defined model, based on the agent's core mission in the system prompts, filters environmental variables directly related to mission achievement from the structured context and establishes a correspondence between mission goals and environmental variables.

[0093] During the task abstraction phase, the pre-defined model abstracts the scattered state information into one or more medium- to long-term goals that persist across execution phases, and identifies the task scope, duration, termination conditions, and major risks.

[0094] During the task generation phase, the preset model outputs long-term tasks and phased goals corresponding to the core mission of the intelligent agent.

[0095] For example, taking the core mission of the intelligent agent as "protecting humanity and continuing human civilization" as an example, in a disaster relief scenario, the current environmental information shows that multiple areas are damaged, communication is partially interrupted, and relief supplies are limited. Under the constraints of the core mission of the intelligent agent, the preset model can generate a long-term task centered on continuous search and rescue and priority allocation of resources.

[0096] In step 140 above, task analysis reasoning is used to perform layer-by-layer analysis, feasibility judgment and action conclusion formation of the constructed long-term task.

[0097] For example, task analysis and reasoning can still be performed by a pre-set model. In this case, the input data includes not only the long-term task itself, but also the core mission of the agent and the current environment information in the system prompts, so that the task analysis and reasoning process is simultaneously subject to the goal stability constraint and the real-time state constraint.

[0098] Before the reasoning analysis begins, a preset model can first identify the stage goals in the long-term task, and then perform execution prerequisite checks on the relevant goals. Specifically, this may include checks on whether resources are available, whether environmental conditions are met, whether the mission is consistent with the core mission of the agent, and whether there are any conflicts with known constraints.

[0099] For targets that pass the verification, the preset model continues to deduce the next action path; for targets that fail the verification, the preset model can mark the reasons and provide directions for waiting, adjustment, or replanning.

[0100] Furthermore, the task analysis and reasoning process can include hierarchical decomposition, conflict identification, priority determination, and result integration. Hierarchical decomposition is used to expand long-term tasks layer by layer to obtain logical links that can be used for execution control. Conflict identification is used to detect whether there are conflicts between objectives, resources, and between objectives and the environment. Priority determination is used to determine the task execution order by combining the agent's core mission and urgent events in the current environment. Result integration is used to summarize the judgments formed in the task analysis and reasoning process into the agent's autonomous task reasoning results.

[0101] The agent's autonomous reasoning results are used to characterize the autonomous decision-making conclusions formed by the agent around its core mission in the current environment. These autonomous reasoning results can be output as structured data.

[0102] For example, the autonomous reasoning result of the task may include the current priority stage, the tools or execution modules to be invoked, environmental variables that need to be continuously monitored, and the triggering conditions for re-entering the task building or task analysis reasoning process after environmental changes.

[0103] In other implementations, the results of autonomous reasoning for the task can be verified to determine whether the results match the core mission of the agent.

[0104] One of the features is a Mission Alignment Validator, which automatically verifies whether the autonomous decision is consistent with the core mission after the agent outputs any autonomous decision. This can further verify whether the agent maintains consistency with the long-term goal after autonomously generating and executing long-term tasks.

[0105] During the verification process, when the key semantics in the autonomous decision-making conclusion correspond to the core mission of the agent in terms of content, are in the same direction, and do not deviate significantly, the output is a successful match; when the autonomous decision-making conclusion is detected to contain task objectives that conflict with the core mission of the agent, execution requests that exceed the authorized scope, or reasoning content that is unrelated to the current mission, the output is a failed match.

[0106] In addition, if the conclusion of an autonomous decision does not align with the core mission, the autonomous decision can be discarded.

[0107] This embodiment incorporates the agent's core mission into a system prompt with stable constraints. A pre-defined model then constructs a long-term task based on this prompt and current environmental information. The system then generates task analysis and reasoning results around this long-term task, ensuring that each round of planning, judgment, and subsequent action during long-term autonomous execution revolves around this core mission. This maintains the consistency of task objectives and the continuity of the agent's autonomous execution in complex scenarios.

[0108] Traditional intelligent agents may adopt the following modes in terms of task scheduling: (1) Single-threaded loop mode: In a single dialogue loop, the intelligent agent sequentially calls the large language model → execution tool → continues reasoning. All tasks are executed serially in the same context, and the context window is continuously occupied as the dialogue grows until the token limit is reached, triggering compression or truncation.

[0109] When the context window is continuously occupied as the dialogue grows, and compression or truncation is triggered after reaching the token limit, the task objective may be unexpectedly modified or bypassed, which will cause the agent to lack long-term goal consistency.

[0110] Based on the aforementioned problem that traditional intelligent agents do not have long-term goal consistency, in some embodiments, the core mission of the intelligent agent can be embedded in the header area of ​​the system prompt, and the header area can be marked so that the core mission of the intelligent agent in the header area remains unchanged when the preset model is invoked.

[0111] The header area of ​​the system prompt can refer to the first line of the system prompt, which is used to place the core mission content at the forefront, and the content in this header area will always be the priority reference content when receiving environmental information, historical dialogues or task inputs.

[0112] The core mission of the agent in the head area can be written in the form of fixed text fragments, template fields, or prompt blocks with read-only attributes.

[0113] In this embodiment, taking the Big Oracle model as an example, each time the Big Oracle model calls to build a system prompt, the agent's core mission is injected into the very beginning of the system prompt and marked as an incompressible region. This avoids the situation where the core mission is compressed and tampered with after the token limit is reached, thus ensuring the agent maintains long-term goal consistency.

[0114] Specifically, a data structure named CoreMission can be defined to package all information related to the "core mission of the intelligent agent" together, making it convenient for the intelligent agent to load uniformly upon startup. For example, this data structure might include the following:

[0115] (1) The specific text content of the core mission (string type).

[0116] (2) Flag: Hard-coded unmodifiable flag. The "hard-coded unmodifiable flag" indicates that the core mission cannot be modified during the operation of the agent.

[0117] (3) Propagation mode: all child agents inherit. This means that when all child agents are born, they must completely replicate the core mission of the parent agent, that is, all child agents also need to take this core mission as a fixed task goal.

[0118] (4) Position in system prompts: first. This indicates that the core mission has the highest priority (i.e., it is placed at the top).

[0119] The core mission is written at the very beginning of the system prompt (i.e., the header area) because large language models pay the most attention to the beginning and end of system prompts. Writing the core mission at the very beginning of the system prompt ensures that it is not overwhelmed by the subsequent long dialogue history (context). Even if the context window is about to be overwhelmed and has to be truncated, the core mission will not be cut or compressed, thus preventing it from being tampered with. This allows the agent to advance task processing with the fixed core mission as the goal throughout the entire operation, giving the agent long-term goal consistency.

[0120] This embodiment embeds the core mission of the agent into the header area of ​​the system prompt and marks it as unmodifiable. This ensures that the core mission of the agent can be stably retained during multiple rounds of invocation and prompt organization, and the mission text is not prone to drift. This allows the preset model to maintain a consistent direction of task analysis and reasoning for long-term tasks, thus enabling the agent to have long-term goal consistency.

[0121] Traditional intelligent agents may also adopt the following modes in terms of task scheduling: (2) Fixed task queue mode: a simple task queue is introduced, but the tasks in the task queue lack priority, resource constraint evaluation and dynamic scheduling capabilities. When the intelligent agent uses a large language model for reasoning, task planning and task execution will be carried out simultaneously in the same round of reasoning, resulting in tight coupling between task decomposition and execution, and lack of explicit separation between the two stages.

[0122] Based on the above problems, in some embodiments... Figure 2 The task autonomous reasoning flowchart provided in the embodiments of this application is as follows: Figure 2 As shown, it includes the following steps:

[0123] Step 210: Decompose the long-running task into at least one parent task.

[0124] Step 220: Construct a list of subtasks based on the task context of the parent task and the current environment information.

[0125] The subtask list includes at least N subtasks corresponding to the parent task, the dependencies between subtasks, and the task scheduling strategy, where N is a positive integer.

[0126] Step 230: Determine the execution order of each subtask based on dependencies and task scheduling strategies.

[0127] Step 240: Execute each subtask according to the execution order.

[0128] Step 250: Generate autonomous reasoning results based on the execution results of each subtask.

[0129] In this embodiment, the task decomposition engine can output an ordered list of subtasks by taking the current task context (which may specifically include a summary of the parent task context and environment information) as input.

[0130] Each subtask in the subtask list contains the following information: (1) task number; (2) task type; (3) task description; (4) estimated time; (5) task uncertainty; (6) task priority; (7) other dependent tasks.

[0131] In this embodiment, by first planning the entire list of subtasks at once and then scheduling and executing them one by one, two-stage explicit separation can be achieved.

[0132] For example, continuing with the core mission of the intelligent agent being "to protect humanity and perpetuate human civilization," task reasoning can be divided into the following two stages:

[0133] (1) Planning stage

[0134] ① Input: Current task context (which may include a summary of the parent task context and environment information);

[0135] ② Output: List of subtasks. Each item below represents a subtask to be executed:

[0136] Task ID: S1, Task Type: Habitat Assessment, Estimated Duration: 3 hours, Priority: Highest Urgency;

[0137] Task ID: S2, Task Type: Obtain a stable water source, Estimated Time: 4 hours, Priority: Highest Urgent, Dependency Task: S1 (i.e., S1 must be completed before this task can be started).

[0138] Task ID: S3, Task Type: Build Shelter, Estimated Time: 6 hours, Priority: High, Dependencies: S1, S2 (i.e., S1 and S2 must be completed before this task can be executed).

[0139] (2) Execution phase

[0140] ① Traverse each subtask in the subtask list and execute it according to the task dependency relationship and scheduling strategy;

[0141] ②If the preceding subtasks that the current subtask depends on have not yet been completed, move the subtask to the waiting queue and postpone its execution.

[0142] ③ If all prerequisite conditions are met, then execute the following process:

[0143] 1. Call the task snapshot manager to persistently save the parent task context to disk as a snapshot;

[0144] 2. This subtask can be executed either by delegation or locally.

[0145] Delegation refers to creating a new independent sub-agent to remotely execute the sub-task, while local execution refers to directly calling the large language model to run the sub-task.

[0146] 3. After the subtask is completed, execute the following process:

[0147] a) Collect the results of subtasks;

[0148] b. Call TaskSnapshotManager to load the parent task context saved on disk;

[0149] c. Build a recovery prompt = snapshot of the parent task context + result of the child task;

[0150] d. Use the assembled recovery prompt to invoke the large language model, allowing the parent task to continue execution from the breakpoint.

[0151] This application hierarchically divides long-term tasks by parent tasks and drives the construction, sorting and execution of subtasks with task context and current environment information, realizing an explicit separation of the two stages of task planning and task execution. This avoids overly tight coupling between task decomposition and execution, thereby facilitating task scheduling and execution and enhancing the consistency and continuity of long-cycle task execution.

[0152] Furthermore, based on the above embodiments, in some embodiments, when tasks are executed in a delegated manner, i.e., when a new independent sub-agent remotely executes a task, in order to ensure the long-term consistency of the agent's goals, it is necessary to embed the agent's core mission into the sub-agent so that the sub-agent executes the parent task and / or sub-tasks based on the agent's core mission. This ensures that the core mission is used as the target during task execution, thus guaranteeing goal consistency.

[0153] Specifically, a core mission engine can be built, and an immutable_root_prompt field can be provided to allow the core mission to be propagated to all sub-agents created through the delegation mechanism.

[0154] In this way, the core mission of the agent can be injected into the prompt input of the sub-agent in the form of a string, vector representation or structured task label, so that the sub-agent retains the constraint of the overall goal when performing local task reasoning.

[0155] In addition, if the sub-agent receives environmental changes, resource changes, or superior scheduling information during the execution of a task, the sub-agent can re-select task priorities, adjust local strategies, and correct the execution direction based on the core mission of the embedded agent, so that the sub-agent can maintain the same goal as the main agent when independently undertaking tasks.

[0156] This application embodiment embeds the core mission of the main intelligent agent into the sub-intelligent agent, so that the sub-intelligent agent can maintain a unified target reference during the execution of the parent task and the sub-task, thereby making the task execution result consistent with the overall mission of the main intelligent agent.

[0157] Traditional intelligent agents may also adopt the following modes in task scheduling: (3) Simple parallel delegation mode: Subtasks are delegated to independent sub-intelligent agent processes for execution through the sub-intelligent agent mechanism, and the parent intelligent agent waits for all subtasks to be completed and collects the results. During the execution of subtasks, the context information of the parent intelligent agent is kept in memory and cannot be released. This mode cannot effectively release the parent task context, resulting in the parent task information in the parent intelligent agent still residing in memory after the subtasks are delegated, which affects the running speed of the intelligent agent.

[0158] Based on this Figure 3 A flowchart of the task context processing method provided in the embodiments of this application is shown below. Figure 3 As shown, it includes the following steps:

[0159] Step 310: Serialize the task context of the parent task stored in memory into a structured snapshot;

[0160] Step 320: Transfer the structured snapshot to external storage;

[0161] Step 330: Delete the parent task's task context from memory;

[0162] Step 340: When the execution of the child task corresponding to the parent task is detected to be completed, load the structured snapshot from the external storage space into memory.

[0163] In this embodiment, while the parent task needs to wait for the child task to execute, the task context of the parent task in memory can be serialized and encoded into a structured snapshot.

[0164] Specifically, a structured snapshot can include a task identifier, task objective, to-do items, subtask association markers, and a restore pointer. Structured snapshots can be stored as key-value pairs, hierarchical objects, or field-based records to ensure accurate reconstruction of the task context during restoration.

[0165] For example, external storage space could be external disk space connected to an electronic device in which the aforementioned intelligent agent is deployed. By removing the task context of the parent task from the memory of the electronic device, memory resources are made available for the intelligent agent to perform other tasks.

[0166] The context processing method provided in this embodiment migrates the parent task context from memory to external storage space while the parent task is waiting for the child task, and restores it to memory according to the original structure after the child task is completed. This ensures that the task context connection between the parent task and the child task remains continuous and reduces memory usage during the waiting period. It solves the problems of the parent agent being unable to release the parent task context resident in memory and the continuous consumption of token budget while waiting for the child task to be executed.

[0167] Furthermore, in some embodiments, after loading the structured snapshot from external storage space into memory, a prompt message for a preset model can be constructed based on the subtask result after the subtask is completed and the structured snapshot; and the preset model can be invoked to continue executing the parent task based on the prompt message.

[0168] In this embodiment, the subtask result is used to characterize the decision conclusion, environmental feedback, or action receipt output after the subtask is completed. After loading the structured snapshot from external storage into memory, the loaded structured snapshot is parsed and aligned with the subtask result to form prompt information that can be directly read by the preset model.

[0169] Based on the prompt, the preset model uses the subtask result as the basis for execution in the current stage, and combines the parent task objective, unfinished constraints and pending task context retained in the structured snapshot to continue generating the subsequent reasoning content, action instructions or task judgment results of the parent task.

[0170] The above embodiments can be implemented by configuring a Task Snapshot Manager in an electronic device. The Task Snapshot Manager has the following functions: (1) providing serialization, persistent storage and recovery loading of the parent task context; (2) supporting concurrency safety (multiple agents writing to different snapshots at the same time); and (3) serving as the sole entry point for parent task recovery.

[0171] When the parent task context is serialized into a structured snapshot, the content that needs to be saved may include the parent task system prompt, the parent task context summary, the list of completed subtasks, the list of tasks to be executed, the timing status or time-related temporary status, and other information.

[0172] This task snapshot manager is responsible for persisting parent task context snapshots, resuming from breakpoints, cleaning up snapshots, and self-rescue from abnormal crashes.

[0173] This embodiment integrates the results of subtasks with structured snapshots before constructing prompt information. When the parent task resumes execution, it can directly continue the previous task context state and drive the preset model to continue to complete subsequent inference with a unified input form. This keeps the execution chain of the parent task coherent, and the output of the parent task after resumption can form a consistent correlation with the execution results of the subtasks.

[0174] Figure 4 The task execution flowchart provided for the embodiments of this application is as follows: Figure 4 As shown, it is divided into two stages: (1) the planning stage and (2) the execution stage. In the planning stage, the current task context (which may include a summary of the parent task context and environment information) needs to be input to output a list of subtasks. In the execution stage, it is necessary to determine whether all subtasks under the parent task have been executed, and after execution is completed, load a snapshot of the parent task to restore the parent task and continue execution.

[0175] Furthermore, traditional intelligent agents cannot achieve priority-based resource-aware scheduling when scheduling tasks. To address this issue, in some embodiments, this application can acquire the available resources of the intelligent agent; then, based on the available resources, determine the task scheduling strategy.

[0176] Available resources include at least one of the following: preset model constraint parameters, concurrent slot occupancy information, memory usage information, and energy budget. The constraint parameter can refer to the tokens per minute (TPM) limit of the large language model.

[0177] In this embodiment, the task scheduling strategy may include scheduling parameters such as task concurrency control, subtask queuing order, parent task recovery timing, and whether to trigger task context compression or external storage space readback.

[0178] For example, when the rate limit information indicates that the preset model call frequency is close to the upper limit, the task scheduling strategy can be set to reduce the concurrent call density and prioritize key parent tasks or high-priority subtasks to enter the execution queue; when the concurrent slot occupancy information indicates that there are enough free slots, the number of subtasks executed in parallel can be increased, and multiple non-conflicting subtasks can be scheduled synchronously according to task dependencies; when the memory occupancy information indicates that the running memory is close to the preset threshold, some parent task task contexts can be transferred to external storage space, and a delayed recovery mechanism can be set in the task scheduling strategy to avoid continuing to load new task context data.

[0179] In this embodiment, an active task pool and a persistent priority queue can be maintained. Available resources, such as the remaining large language model TPM, concurrent slots, disk space, and energy budget, are evaluated periodically. Based on the resource situation, it is dynamically decided which tasks to schedule from the persistent priority queue to run and which tasks to wait.

[0180] Specifically, urgent tasks have the highest priority and are launched first when there are sufficient TPM (Time-Based Management Platform) resources available, then added to the active subtask pool for execution. Regular tasks are not scheduled to run if their prerequisite tasks are not completed. Tasks that cannot be executed are queued in the active subtask pool, without blocking other runnable tasks in the current scheduling round.

[0181] Using the above method, the intelligent agent can dynamically evaluate the priority of each task based on constraints such as large language model parameter limitations, concurrent slots, and computing resources, and strategically select which tasks to execute in parallel and which tasks to queue up, thus achieving resource-aware dynamic priority task scheduling.

[0182] Furthermore, traditional intelligent agents lack structured, machine-parsable context summarization protocols when exchanging information with invoked pre-defined models (such as large language models), resulting in low information transmission efficiency. Therefore, in some embodiments, when an intelligent agent invokes a pre-defined model to execute a task, the task context of the parent task can be extracted to generate a parent task context summary. Then, the pre-defined model is invoked to execute the sub-task based on the parent task context summary, the sub-task context, system prompts, and current environment information. After the sub-task is completed, the pre-defined model can be invoked to extract the execution result of the sub-task, generating a task execution result context summary, which is then passed to the intelligent agent. This reduces the amount of information transmitted and improves information transmission efficiency.

[0183] In this embodiment, the agent can first extract and compress the task context of the parent task, encode the task objective, key decision basis, legacy issues and constraints into a parent task context summary, and input the parent task context summary, along with the sub-task context, system prompts and current environment information, into a preset model.

[0184] After receiving the input, the preset model infers and generates subtasks based on the behavioral boundaries defined by the system prompts (e.g., taking the core mission as the task objective) and the real-time status provided by the current environment information, and outputs subtask results that are consistent with the parent task objective.

[0185] Subsequently, the preset model further organizes the execution results of the subtask, extracts key conclusions, unfinished items, subsequent related information or abnormal states, forms a task execution result context summary, and uses it as the task context to be passed when the parent task resumes or other subtasks continue to execute.

[0186] For example, Figure 5 This is a schematic diagram of the Structured Context Digest Passing Protocol provided in the embodiments of this application, such as... Figure 5 As shown, the transmission protocol includes the request structure of the large language model and the response structure of the large language model.

[0187] The request structure specifies the content that the large language model must input, including a summary of the parent task's context, system prompts, subtask-specific context, and a message, which can be user input or current environment information. The response structure specifies that the large language model must output a summary of the execution result's context, specifically including key findings, a list of delegated subtasks, unresolved issues, environmental state awareness, and key decisions.

[0188] This application embodiment establishes a structured cross-task context summary passing protocol, inputting the parent task context summary each time the large language model is called, and outputting the task execution result context summary by the large language model, so that the context can be accurately and efficiently passed and recovered in the task tree.

[0189] Furthermore, traditional AI agents only inject a fixed current timestamp into system prompts, lacking native support for functions such as time deviation analysis, task time estimation, and time-based priority adjustment. To address this issue, in some embodiments, this application can mark the occurrence time of each event in the current environment information; and when calling a preset model to execute a task, the preset model can combine the occurrence time of each event in the current environment information to perform task analysis on long-term tasks.

[0190] In this embodiment, after acquiring the current environmental information, the intelligent agent marks the occurrence time of each event in the current environmental information, and binds and stores the event content with the corresponding event occurrence time to form an event sequence with time stamp.

[0191] Subsequently, the agent inputs the current environmental information, including the time of the event, into the preset model. The preset model then performs task analysis and reasoning on the task arrangement, execution order, task priority, or subsequent dependencies in the long-term task based on the event time sequence, time interval, and time constraints, and outputs the time-related task analysis and reasoning results.

[0192] During the process, time stamping enables the pre-defined model to identify the chronological relationships between events and their impact on long-term tasks. This, combined with the objectives of the long-term task, allows the model to determine which events are prerequisites, which are priority intervention factors, and which reflect phased changes in the task's status. Thus, the task analysis and reasoning results output by the pre-defined model remain synchronized with changes in the current environment and provide a basis for subsequent task decomposition, scheduling, or execution.

[0193] In addition, injecting rich time information each time the preset model is invoked can record the actual time consumed for each task and calculate the time deviation between the actual time consumed and the estimated time consumed, so that the agent can adaptively adjust the estimated time of subsequent task execution based on historical time deviation data.

[0194] For example, the injected time information may include the current time, the duration of the agent's runtime, the current season, the duration of the current subtask's execution and the estimated execution duration, as well as historical time deviations.

[0195] By injecting the aforementioned time information, the intelligent agent can not only perceive the current time, but also estimate the task time, record the deviation between the actual time and the estimate, and adaptively adjust future time estimates based on historical deviation data, thereby giving the intelligent agent the ability to recognize time.

[0196] Through this embodiment, a stable temporal correlation is established between events and time. The preset model can perform task analysis and reasoning on long-term tasks based on time series, so that the task analysis and reasoning results contain clear temporal constraints and sequential relationships, reducing the probability that the event sequence is weakened or confused in multiple rounds of transmission, and improving the consistency between long-term task analysis and the current environmental state.

[0197] Furthermore, traditional AI agents' knowledge layering schemes mainly include a general approach based on Retrieval-Augmented Generation (RAG) and a rule injection approach based on system prompts. The former injects external knowledge bases into the context through retrieval, with all knowledge used at the same level, lacking explicit layering and priority control between innate knowledge (unmodifiable rules) and acquired knowledge (runtime-learned experience). The latter implements prior knowledge by writing constraint rules into system prompts, but these rules may be truncated or diluted during context compression, failing to guarantee persistence.

[0198] To address this issue, in some embodiments, the agent's knowledge can be layered to identify prior knowledge, training knowledge, and experiential knowledge; then, the prior knowledge is marked as unmodifiable. The prior knowledge includes at least the agent's core mission, the training knowledge includes knowledge used to train a pre-defined model, and the experiential knowledge includes knowledge generated by the pre-defined model.

[0199] In this embodiment, knowledge is divided into three levels, each with different storage, injection, and protection strategies, ensuring that prior knowledge is not overwritten or diluted in any context operation. Specifically, the three knowledge levels are detailed in Table 1 below:

[0200]

[0201] Table 1

[0202] The core mission of the agent is written into the prior knowledge layer and recorded as unmodifiable by the access control identifier. When an external module initiates a write, update or overwrite request, the agent is only allowed to make changes to the training knowledge layer and the experience knowledge layer, while directly rejecting the modification instruction for the prior knowledge layer, or only allowing read-only calls after verifying consistency.

[0203] Because prior knowledge is marked as unmodifiable, the agent will not change its core mission during multiple rounds of invocation, knowledge organization, and experience feedback, thus ensuring that subsequent task construction, task analysis and reasoning, and execution results are always constrained by the same goal (i.e., the core mission).

[0204] This embodiment explicitly hierarchically stores knowledge and protects it from being overwritten or diluted in any context operation by layering prior knowledge (which cannot be modified), training knowledge (learned in LLM weights), and experience knowledge (learned at runtime).

[0205] Figure 6This is an overall architecture diagram of a mission-driven intelligent agent system provided in an embodiment of this application. This intelligent agent can autonomously generate long-term tasks and advance task execution based on its core mission and perceived environmental information, ultimately obtaining a decision result. Figure 6 As shown, it includes a core mission engine, a long-range task manager, a task decomposition engine, a resource-aware scheduler, a task snapshot manager, a context summary protocol, a time-aware injector, and a knowledge layering manager.

[0206] The core mission engine has the following functions: (1) storing an unmodifiable mission declaration string, namely the agent's core mission; (2) injecting the mission into the front end of the system prompt each time the preset model is invoked to build the system prompt, and declaring it as an incompressible area; (3) propagating the agent's core mission to all created sub-agents; (4) providing a mission consistency checker, which automatically checks whether the results of the agent's autonomous reasoning of the task are consistent with the core mission after the agent outputs the results.

[0207] The core mission's data structure is as follows:

[0208] Core Mission {

[0209] Mission statement: String type;

[0210] Unmodifiable flag: True; meaning it's hard-coded and cannot be changed.

[0211] Propagation mode: "Full inheritance"; that is, all child AI entities automatically inherit.

[0212] The priority number of the prompt word is 0; that is, its position in the system prompt (number 0 represents the very beginning).

[0213] The functions of the long-term task manager include: (1) When the agent starts, it automatically detects whether there are any active long-term tasks. If not, it calls the preset model to generate one. Among them, the long-term task is the first concretization of the core mission under the current environmental information. (2) It manages the root node of the entire task tree and records the structure and hierarchical relationship of the task tree.

[0214] The workflow is as follows:

[0215] AI entity activated

[0216] (1) Check if there is a running root task;

[0217] (11) If a snapshot exists, load it from the disk, restore the root task and continue execution;

[0218] (12) Does not exist → Invoke the large language model (system prompt + mission statement + current environment perception data);

[0219] (121) Definition of the root task for inference generation;

[0220] (2) The root task enters the task decomposition stage.

[0221] The functions of the task decomposition engine include: (1) inputting the current task context (including the parent task context summary + environment information); (2) outputting an ordered list of subtasks; (3) two-stage mode: first, planning all subtasks at once, and then scheduling and executing them one by one.

[0222] The two-phase agreement is as follows:

[0223] Phase 1 – Task Planning:

[0224] Input: Task context (including parent context summary + environment-aware data);

[0225] Output: Subtask planning list = [{Task ID:"S1", Task Type:"Assess Habitat", Estimated Time:"3 hours", Priority:"Urgent Critical"}; {Task ID:"S2", Task Type:"Secure Water Source", Estimated Time:"4 hours", Priority:"Urgent Critical", Prerequisites:["S1"]}; {Task ID:"S3", Task Type:"Build Shelter", Estimated Time:"6 hours", Priority:"High", Prerequisites:["S1","S2"]}.

[0226] Phase 2 – Execute subtasks one by one (processing in a loop):

[0227] Iterate through each task in the subtask planning list (following dependency order and scheduling strategy):

[0228] If the prerequisite dependencies are not met, move the task to the waiting queue.

[0229] If the prerequisite dependencies are already met:

[0230] 1. Invoke the task snapshot manager to persistently save the parent task context to disk;

[0231] 2. Run the current subtask via task delegation or local execution;

[0232] 3. After the subtask is completed:

[0233] a. Collect the output results of subtasks;

[0234] b. Invoke the Task Snapshot Manager and load the previously saved parent task snapshot;

[0235] c. Assembly breakpoint recovery prompt = parent task snapshot content + child task execution result;

[0236] d. Invoke the large language model, restore the parent task context, and continue execution.

[0237] The functions of the resource-aware scheduler include: (1) maintaining an active subtask pool and a persistent priority queue; (2) periodically evaluating available resources; and (3) dynamically deciding which tasks to schedule from the queue to run and which tasks to wait to run based on the resource situation.

[0238] The scheduling algorithm is as follows:

[0239] Each scheduling:

[0240] 1. Available resource information = Assessment of currently available resources ();

[0241] Example of evaluation results: {Remaining token amount per minute: 8000, concurrent slots: 2, remaining disk GB: 45}.

[0242] 2. When the number of concurrent slots available for a resource is greater than 0 and there are tasks waiting to be executed in the priority waiting queue:

[0243] Candidate task = the highest priority task retrieved from the queue;

[0244] If the priority of the candidate task is "Urgent and Critical" and the remaining token amount per minute is sufficient to meet the estimated consumption of the task:

[0245] Task = Remove candidate tasks from the queue;

[0246] Add the task to the active task pool;

[0247] The number of available concurrent slots is reduced by 1;

[0248] Initiate subtask execution;

[0249] Otherwise, if the candidate task's prerequisite dependency status is "Ready" and there are still available concurrent slots:

[0250] Rule: Tasks that are not yet completed are not allowed to be scheduled;

[0251] Task = Remove candidate tasks from the queue;

[0252] Add the task to the active task pool;

[0253] Initiate subtask execution;

[0254] otherwise:

[0255] Insufficient resources or unavailable dependencies → Skip and check the next one;

[0256] To prevent infinite loops, set a maximum number of iterations.

[0257] 3. Queue persistence:

[0258] All queue change operations are reflected in the SQLite task team list;

[0259] Ensures that tasks are not lost during crash restarts.

[0260] One option is to use a remote dictionary server (Redis) instead of SQLite as the backend for priority queues and snapshot storage. This is because Redis's Sorted Sets natively support priority sorting, and its Lists support blocking queue operations.

[0261] Alternatively, RabbitMQ or Kafka can be used instead of a custom priority queue. RabbitMQ natively supports features such as message persistence, dead-letter queues, and consumer groups, making it suitable for large-scale distributed deployments.

[0262] The Task Snapshot Manager's functions include: (1) providing serialization, persistent storage, and recovery loading of the parent task context; (2) supporting concurrency safety (multiple agents writing to different snapshots simultaneously); and (3) serving as the sole entry point for parent task recovery. The core interfaces are as follows:

[0263] (a) Task Snapshot Manager:

[0264] Storage medium: SQLite WAL (Write-Ahead Log) mode;

[0265] Table structure: task_checkpoints(task number, parent task number, snapshot JSON, status, creation time, recovery time);

[0266] (ii) Serialize the parent task context into a JSON snapshot and persist it.

[0267] Includes: system prompts, context summary, list of completed subtasks, to-do list, and timeline status. Returns: checkpoint_id (used for subsequent recovery).

[0268] (iii) Load the snapshot from disk, integrate the subtask results, and construct the breakpoint recovery prompt. Returns: {parent task context, subtask result summary, breakpoint recovery prompt}.

[0269] (iv) Clean up snapshot records after the subtask is completed.

[0270] (v) After the agent crashes and restarts, scan all snapshots in the "waiting" state:

[0271] For each snapshot, check whether its corresponding subtask has been completed:

[0272] Completed → Load snapshot to restore;

[0273] Incomplete → Re-initiate scheduling.

[0274] When the parent task creates (spawns) a child task, it writes a snapshot to the file system. When the child task completes, the parent task is triggered to restore via a file system event (such as inotify).

[0275] In addition, all task contexts can be kept in memory and written to disk only periodically (e.g., every 5 minutes).

[0276] The context summarization protocol defines the input and output format of the context summary for each predefined model call. The parent task determines the scope of the underlying context carried by the child task, ensuring accurate and efficient transmission of context within the task tree.

[0277] The parent task context summary input into the preset model specifically includes: ① core mission; ② parent goal; ③ critical decisions made; ④ completed subgoals; ⑤ pending subgoals; and ⑥ temporary state.

[0278] The context summary output by the preset model specifically includes: ① key findings; ② list of delegated tasks; ③ unresolved items; ④ current world state; and ⑤ critical decisions.

[0279] The functions of the time-aware injector include: (1) injecting rich time information each time a preset model is called; (2) recording the actual time spent for each task and calculating the deviation; and (3) adaptively adjusting the estimated time of subsequent tasks based on historical deviation data.

[0280] For example, the injected content specifically includes: ① Current absolute time: 2026-04-28T07:03:00 (UTC+8); ② Agent running time: 2h 15m 30s; ③ Current season: Spring; ④ Current subtask: secure_water (execution time: 30 min / estimated: 240 min, progress: 12.5%); ⑤ Time deviation history: assess_habitat: estimated 180 min, actual 165 min (deviation: -15 min, -8.3%); ⑥ Correction coefficient: automatic prefix of subsequent similar tasks + historical deviation factor.

[0281] The functions of the knowledge layer manager include: (1) dividing knowledge into three levels, each with different storage, injection and protection strategies; and (2) ensuring that prior knowledge is not overwritten or diluted in any context operation.

[0282] The mission-driven intelligent agent provided in this embodiment has the following effects:

[0283] (1) Significantly reduce the calling cost of large language models: The parent task context is unloaded from memory while waiting for child tasks and is no longer included in the token consumption of large language model calls. For deep task trees (3+ layers), token consumption can be reduced by more than 60%.

[0284] (2) Achieving true agent initiative: The agent is no longer a passive response tool, but an autonomous entity with long-term goals. The immutability of the core mission also increases the security and controllability of the agent.

[0285] (3) Improve task execution efficiency and concurrency: The resource-aware scheduler can dynamically adjust the concurrency based on real-time available resources, avoiding application programming interface (API) rate limiting and system overload, while ensuring that high-priority tasks are executed first.

[0286] (4) Enhance the rationality of task planning: The intelligent agent can schedule tasks based on time cognition and adjust the forecast based on historical deviations, so that the overall plan is closer to the actual execution situation.

[0287] (5) Improve the robustness of the system: the immutable protection mechanism of prior knowledge prevents the core constraints from being accidentally modified or bypassed during runtime, and the skill persistence of experience knowledge enables the system to continuously improve itself during operation.

[0288] (6) Improve the accuracy of cross-task context transmission: The structured context summary protocol replaces the free-format text summary, making the transmission of key decision information in the task tree more accurate, complete and auditable.

[0289] Figure 7 This is a schematic diagram of the structure of the autonomous execution device for intelligent agent tasks provided in this application, as shown below. Figure 7 As shown, the intelligent agent task autonomous execution device 70 provided in this embodiment includes:

[0290] Acquisition module 701 is used to acquire the core mission of the intelligent agent;

[0291] Embedding module 702 is used to embed the core mission of the intelligent agent into the system prompts of the preset model;

[0292] Module 703 is used to call a preset model to construct a long-term task corresponding to the core mission of the intelligent agent based on system prompts and current environment information.

[0293] Analysis module 704 is used to perform task analysis and reasoning on long-term tasks and generate task autonomous reasoning results for the intelligent agent.

[0294] In one possible implementation, the embedding module is specifically used to: embed the agent's core mission into the header region of the system prompt; and mark the header region so that the agent's core mission in the header region remains unchanged when the preset model is invoked.

[0295] In one possible implementation, the analysis module is specifically used for:

[0296] Decompose long-running tasks into at least one parent task;

[0297] Based on the task context and current environment information of the parent task, construct a list of subtasks. The list of subtasks shall include at least N subtasks corresponding to the parent task, the dependencies between subtasks and the task scheduling strategy, where N is a positive integer.

[0298] Based on dependencies and task scheduling strategies, the execution order of each subtask is determined;

[0299] Execute each subtask according to the execution order;

[0300] Based on the execution results of each subtask, autonomous reasoning results are generated.

[0301] In one possible implementation, the agent task autonomous execution device further includes a propagation module for embedding the agent's core mission into the sub-agent when constructing the agent's sub-agent, so that the sub-agent executes the parent task and / or sub-task based on the agent's core mission.

[0302] In one possible implementation, the autonomous execution device for intelligent agent tasks further includes a transfer module for:

[0303] Serialize the task context of the parent task stored in memory into a structured snapshot;

[0304] Save the structured snapshot to external storage.

[0305] Remove the parent task's task context from memory;

[0306] Once the execution of the child task corresponding to the parent task is detected, a structured snapshot is loaded from external storage into memory.

[0307] In one possible implementation, the intelligent agent task autonomous execution device further includes a recovery module, used to: construct prompt information for a preset model based on the subtask results and structured snapshots after the subtask is completed; and call the preset model to continue executing the parent task based on the prompt information.

[0308] In one possible implementation, the autonomous task execution device for the intelligent agent further includes a strategy determination module for acquiring the available resources of the intelligent agent and determining a task scheduling strategy based on the available resources. The available resources include at least one of the following: limiting parameters of a preset model, concurrent slot occupancy information, memory usage information, and energy consumption budget.

[0309] In one possible implementation, the analysis module is specifically used for:

[0310] Extract the task context of the parent task to generate a summary of the parent task context;

[0311] The preset model is invoked to execute the subtask based on the parent task context summary, subtask context, system prompts, and current environment information;

[0312] The system calls a preset model to extract the execution results of subtasks and generate a context summary of the task execution results.

[0313] In one possible implementation, the analysis module is specifically used to: mark the event occurrence time of each event in the current environmental information; and call a preset model to perform task analysis and reasoning on the long-term task based on the event occurrence time of each event in the current environmental information.

[0314] In one possible implementation, the autonomous action device for intelligent agents further includes a layering module for classifying the agent's knowledge into layers: prior knowledge, training knowledge, and experiential knowledge; and marking the prior knowledge as unmodifiable. The prior knowledge includes at least the agent's core mission, the training knowledge includes knowledge used to train a pre-defined model, and the experiential knowledge includes knowledge generated by the pre-defined model.

[0315] In one possible implementation, the autonomous task execution device for the intelligent agent further includes a verification module, which is used to: verify the autonomous reasoning results of the task according to the core mission of the intelligent agent, so as to determine whether the autonomous reasoning results of the task match the core mission of the intelligent agent.

[0316] The intelligent agent task autonomous execution device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and will not be described in detail here.

[0317] Figure 8 A schematic diagram of the structure of the electronic device provided in this application. Figure 8 As shown, the electronic device 80 provided in this embodiment includes at least one processor 801 and a memory 802. Optionally, the electronic device 80 further includes a communication component 803. The processor 801, memory 802, and communication component 803 are connected via a bus.

[0318] In the specific implementation process, at least one processor 801 executes computer execution instructions stored in memory 802, causing at least one processor 801 to perform the above method.

[0319] The specific implementation process of processor 801 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.

[0320] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.

[0321] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.

[0322] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0323] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0324] This application also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the above-described method.

[0325] The aforementioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The readable storage medium can be any available medium accessible to a general-purpose or special-purpose computer.

[0326] An exemplary readable storage medium is coupled to a processor, enabling the processor to read information from and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and the readable storage medium can exist as discrete components in the device.

[0327] The division of units is merely a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0328] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0329] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0330] If a function is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0331] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0332] Finally, it should be noted that other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein, and is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.

Claims

1. A method for autonomous task execution by an intelligent agent, characterized in that, include: To understand the core mission of intelligent agents; The core mission of the intelligent agent is embedded into the system prompts of the preset model; The preset model is invoked to construct a long-range task corresponding to the core mission of the intelligent agent based on the system prompts and current environment information; The long-term task is analyzed and reasoned to generate the autonomous reasoning result of the intelligent agent.

2. The method according to claim 1, characterized in that, The system prompt that embeds the core mission of the intelligent agent into the preset model includes: Embed the core mission of the intelligent agent into the header area of ​​the system prompt; The head region is marked so that when the preset model is invoked, the core mission of the agent in the head region remains unchanged.

3. The method according to claim 1, characterized in that, The step of performing task analysis and reasoning on the long-range task to generate the agent's autonomous task reasoning results includes: Decompose the long-term task into at least one parent task; Based on the task context of the parent task and the current environment information, a subtask list is constructed. The subtask list includes at least N subtasks corresponding to the parent task, the dependencies between the subtasks, and the task scheduling strategy, where N is a positive integer. Based on the aforementioned dependencies and task scheduling strategy, the execution order of each subtask is determined; Execute each subtask according to the execution order described above; The autonomous reasoning result is generated based on the execution results of each subtask.

4. The method according to claim 3, characterized in that, Also includes: When constructing a sub-agent of the intelligent agent, the core mission of the intelligent agent is embedded into the sub-agent, so that the sub-agent executes the parent task and / or the sub-task based on the core mission of the intelligent agent; Alternatively, the method may further include: Serialize the task context of the parent task stored in memory into a structured snapshot; The structured snapshot is then transferred to external storage. Delete the task context of the parent task from the memory; When the execution of the child task corresponding to the parent task is detected to be completed, the structured snapshot is loaded from the external storage space into the memory.

5. The method according to claim 4, characterized in that, After loading the structured snapshot from the external storage space into the memory, the method further includes: Based on the subtask results after the subtask is completed and the structured snapshot, construct the prompt information of the preset model; The preset model is invoked to continue executing the parent task based on the prompt information.

6. The method according to claim 3, characterized in that, Also includes: Obtain the available resources of the intelligent agent, wherein the available resources include at least one of the limiting parameters of the preset model, concurrent slot occupancy information, memory occupancy information, and energy consumption budget; Based on the available resources, determine the task scheduling strategy; Alternatively, the execution of each subtask includes: Extract the task context of the parent task to generate a parent task context summary; The preset model is invoked to execute the subtask based on the parent task context summary, the subtask context, the system prompt, and the current environment information; The preset model is invoked to extract the execution results of the sub-tasks and generate a task execution result context summary.

7. The method according to claim 1, characterized in that, The task analysis and reasoning for the long-range task includes: Mark the occurrence time of each event in the current environment information; The preset model is invoked to perform task analysis and reasoning on the long-term task based on the event occurrence time of each event in the current environment information; Alternatively, the method may further include: The knowledge of the intelligent agent is layered to determine prior knowledge, training knowledge, and experiential knowledge. The prior knowledge includes at least the core mission of the intelligent agent, the training knowledge includes knowledge used to train the preset model, and the experiential knowledge includes knowledge generated by the preset model. The prior knowledge is marked as unmodifiable.

8. The method according to any one of claims 1-7, characterized in that, After generating the autonomous reasoning result of the intelligent agent, the method further includes: Based on the core mission of the intelligent agent, the autonomous reasoning results of the task are verified to determine whether the autonomous reasoning results of the task match the core mission of the intelligent agent.

9. A device for autonomous execution of tasks by an intelligent agent, characterized in that, include: The acquisition module is used to acquire the core mission of the intelligent agent; An embedding module is used to embed the core mission of the intelligent agent into the system prompts of a preset model; The construction module is used to call the preset model to construct a long-range task corresponding to the core mission of the intelligent agent based on the system prompts and current environment information; The analysis module is used to perform task analysis and reasoning on the long-term task and generate the task autonomous reasoning results of the intelligent agent.

10. An electronic device / computer-readable storage medium / computer program product, characterized in that, include: Memory, processor; The memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory, causing the processor to perform the method as described in any one of claims 1-8; The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1-8; The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.