Agent self-correction method based on solver feedback and behavior constraint verification
By combining solver feedback with behavioral constraint verification, self-correcting actions are generated and verified, solving the problem of uncontrolled correction of agents in complex tasks. This enables multi-round self-correction within the safety boundary, improving the feasibility and safety of task solving.
Patent Information
- Application Number
- CN202611575680.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-12
- Publication Date
- 2026-11-24
AI Technical Summary
Existing intelligent agent systems lack a mechanism to structure solver feedback into controlled corrective actions, which may lead to violations of behavioral constraints in complex tasks and make it impossible to guarantee the feasibility, compliance and security of the results.
By acquiring task objectives and context data and converting them into task instances, the solver is called to extract feedback vectors, and behavior constraint verification is performed in conjunction with a behavior verifier. Candidate self-correcting actions are generated and verified at the action level. Finally, the results are output when the self-correction termination condition is met.
It enables intelligent agents to perform multi-round self-correction within deterministic tools and safety boundaries, improving the feasibility, security, and automation of solving complex tasks.
Smart Images

Figure CN123159395A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and safe and controllable automation technology, and in particular to a self-correction method for intelligent agents based on solver feedback and behavioral constraint verification. Background Technology
[0002] With the development of artificial intelligence technology, intelligent agents are widely used for complex task processing. Intelligent agents can understand user goals, invoke tools or models, generate action plans, and continue to complete tasks based on the execution results. However, in real-world engineering scenarios, complex tasks often involve numerous constraints, external system states, and security boundaries. Relying solely on the natural language reasoning of intelligent agents or a single tool invocation makes it difficult to guarantee the feasibility, compliance, and traceability of the results.
[0003] Solvers can compute constraints, objectives, and resources in complex tasks, and output candidate solutions or action sequences. For example, constraint programming solvers can handle resource mutual exclusion and timing constraints, optimizers can handle cost and efficiency objectives, test executors can discover failed use cases in software tasks, and rule engines can determine whether business processes meet the conditions.
[0004] However, existing intelligent agent systems typically treat the solver output as the final result or error message, failing to fully utilize the failure reasons, conflict sets, objective function components, and resource bottleneck information in the solver feedback. Even if the agent can see the solver feedback, it often lacks a structured mechanism to transform the solver feedback into controlled corrective actions. On the other hand, even if candidate solutions to complex tasks are feasible at the solver level, they may violate behavioral constraints. For example, the tool invocation order may not meet the preconditions, resource states may change, interface permissions may be insufficient, approval processes may not be completed, the execution action may disrupt the frozen state, or the external system may not allow certain types of automatic writing.
[0005] Therefore, how to generate controlled self-correcting actions so that intelligent agents can automatically correct complex tasks in multiple rounds within safe boundaries is a problem that urgently needs to be solved. Summary of the Invention
[0006] This invention provides an agent self-correction method based on solver feedback and behavioral constraint verification. It addresses the shortcomings of existing technologies that lack a mechanism to structure solver feedback into controlled correction actions and combine it with behavioral constraint verification to perform safety checks on candidate solutions. This results in insufficient utilization of solver feedback and the possibility that candidate solutions are unexecutable, non-compliant, or unsafe at the behavioral level. The invention enables the agent to perform multiple rounds of self-correction under the constraints of deterministic tools and safety boundaries, rather than directly relying on free text reasoning or unconstrained automatic execution, thereby improving the feasibility, safety, and automation of solving complex tasks.
[0007] This invention provides a self-correction method for intelligent agents based on solver feedback and behavioral constraint verification. The method is applied to intelligent agents and includes: Obtain the task objective and the context data associated with the task objective, and convert the task objective and the context data into a task instance; The solver is invoked to solve the problem using the task instance as input. When no candidate solution is generated, the solver feedback is extracted from the solver operation process. When a candidate solution is generated, the solver feedback is extracted from the solver operation process and the candidate solution to generate a feedback vector. The behavior validator performs behavior constraint verification on the task instance and action boundary when no candidate solution is generated, and performs behavior constraint verification on the task instance, the candidate solution and action boundary when a candidate solution is generated, to obtain the behavior verification result. Based on the feedback vector and the behavior verification result, candidate self-correcting actions are generated; The candidate self-correcting actions are verified at the action level to obtain verified self-correcting actions, and the verified self-correcting actions are applied to the task instance to update the task instance. The next round of solving and verification is performed based on the updated task instance until the self-correcting termination condition is met, and the final output result is obtained; the final output result is the final candidate solution or termination information.
[0008] According to the present invention, an agent self-correction method based on solver feedback and behavioral constraint verification is provided, wherein generating candidate self-correction actions based on the feedback vector and the behavioral verification result includes: The feedback vector and the behavior verification result are fused into a problem state diagram; wherein, the nodes of the problem state diagram are used to represent target nodes, variable nodes, resource nodes, action nodes, tool nodes, external interface nodes or approval nodes, and the edges of the problem state diagram are used to represent conflict relationships, dependency relationships, blocking relationships, substitution relationships or correction relationships. Based on the feedback vector, the behavior verification result, the problem state diagram, the action boundary, and the historical audit records, the candidate self-correcting action is generated.
[0009] According to the present invention, an agent self-correction method based on solver feedback and behavioral constraint verification is provided. The candidate self-correction actions include at least one of the following: adjusting target weights, supplementing missing inputs, replacing resources, splitting tasks, changing execution order, adding pre-checks, rolling back the previous action, switching to a backup solver, increasing the search time budget, reducing the search space, requesting manual approval, pausing external writing, and generating an interpretation report. The action-level verification of the candidate self-correction actions includes: If the candidate self-correcting action is not in the action whitelist, the parameters exceed the boundary, the calling permission is insufficient, the external system state is damaged, the hard constraints are violated, or the manual approval is bypassed, then the candidate self-correcting action is rejected or transferred to manual review.
[0010] According to the self-correction method for intelligent agents based on solver feedback and behavioral constraint verification provided by the present invention, after satisfying the self-correction termination condition and obtaining the final output result, it further includes: Output the final output results, explanatory information, and traceable audit records; The traceable audit records are written into the audit chain; the audit chain is used for similar problem retrieval, strategy recommendation, risk warning and rule optimization for subsequent tasks; The explanatory information includes at least one of the following: result summary, key indicators, correction process description, remaining risks, and manual approval items; the traceable audit record includes at least one of the following: task objective, input data summary, solver feedback, behavior verification results, candidate self-correcting actions, verified self-correcting actions, updated task instance, final status, and manual approval results.
[0011] According to the present invention, an agent self-correction method based on solver feedback and behavioral constraint verification is provided, wherein the context data includes at least one of resource status, task dependencies, historical execution records, business rules, external interface permissions, data quality status, executed steps, callable tools, solver configuration, and manual approval requirements; The task instance includes at least one of the following: target set, input variables, resource set, candidate action set, hard constraint set, soft target set, execution boundary, verification rule, and evaluation metric.
[0012] According to the present invention, an agent self-correction method based on solver feedback and behavioral constraint verification is provided, wherein the candidate solution is at least one of the following: task plan, resource allocation scheme, execution step sequence, configuration parameter set, path scheme, scheduling result, code modification scheme, and data processing flow. The solver is at least one of the following: an optimization solver, a rule solver, a planner, a tester, a compiler, and a simulator.
[0013] According to the present invention, an agent self-correction method based on solver feedback and behavioral constraint verification is provided, wherein each feedback item of the feedback vector includes at least one of feedback type, severity level, associated variable, associated resource, associated action, numerical evidence, error information, candidate solution quality, conflict constraint and traceable source; The feedback types include at least one of the following: infeasibility feedback, timeout feedback, local optimum feedback, constraint conflict feedback, objective function degradation feedback, resource bottleneck feedback, execution failure feedback, input data anomaly feedback, and insufficient candidate solution quality feedback.
[0014] According to the present invention, an agent self-correction method based on solver feedback and behavioral constraint verification is provided. The behavioral constraint verification includes at least one of resource mutual exclusion, step dependency, state transition legality, permission legality, interface call order, data consistency, security policy, approval status, external system writable boundary, and audit field integrity. Each verification item in the behavior verification result includes at least one of the following: problem type, severity level, rule violation, evidence field, associated object, whether execution is blocked, suggested handling direction, and audit requirements.
[0015] This invention also provides an agent self-correction system based on solver feedback and behavioral constraint verification, the system being applied to an agent and comprising: The data acquisition module is used to acquire the task objective and the context data related to the task objective, and to convert the task objective and the context data into a task instance; The solution feedback extraction module is used to call the solver, perform the solution with the task instance as input, extract solver feedback from the solver operation process when no candidate solution is generated, and extract solver feedback from the solver operation process and the candidate solution when a candidate solution is generated, and generate a feedback vector. The behavior constraint verification module is used to perform behavior constraint verification on the task instance and action boundary when no candidate solution is generated, and to perform behavior constraint verification on the task instance, the candidate solution and action boundary when a candidate solution is generated, so as to obtain the behavior verification result. The self-correction generation module is used to generate candidate self-correction actions based on the feedback vector and the behavior verification result; An action-level verification module is used to perform action-level verification on the candidate self-correcting actions, obtain verified self-correcting actions, and apply the verified self-correcting actions to the task instance to update the task instance. The iterative solution verification module is used to perform the next round of solution and verification based on the updated task instance until the self-correcting termination condition is met, and obtain the final output result; the final output result is the final candidate solution or termination information.
[0016] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the agent self-correction method based on solver feedback and behavioral constraint verification as described above.
[0017] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the agent self-correction method based on solver feedback and behavioral constraint verification as described above.
[0018] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the agent self-correction method based on solver feedback and behavioral constraint verification as described above.
[0019] This invention provides an agent self-correction method based on solver feedback and behavioral constraint verification. It unifies task objectives and context data through task instances, uses a solver with the task instance as input to solve the problem and extract feedback vectors, employs a behavioral verifier to verify behavioral constraints, and uses the agent to generate candidate self-correction actions based on the feedback vectors and behavioral verification results. These candidate actions are then verified at the action level, updating the task instance. Finally, the updated task instance is used for the next round of solving and verification until the self-correction termination condition is met, yielding the final output. Therefore, this invention achieves an agent self-correction process combining solver feedback and behavioral constraint verification, enabling the agent to perform multiple rounds of self-correction under the constraints of deterministic tools and safety boundaries, rather than directly relying on free text reasoning or unconstrained automatic execution. This improves the feasibility, security, and automation of solving complex tasks. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this invention 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 invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the agent self-correction method based on solver feedback and behavioral constraint verification provided in this embodiment of the invention.
[0022] Figure 2 This is a schematic diagram of the structure of the intelligent agent self-correction system based on solver feedback and behavioral constraint verification provided in an embodiment of the present invention.
[0023] Figure 3 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0024] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0025] In the description of embodiments of the present invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Those skilled in the art will understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0026] Figure 1 This is a flowchart illustrating the agent self-correction method based on solver feedback and behavioral constraint verification provided in an embodiment of the present invention. (Refer to...) Figure 1 This invention provides a self-correction method for intelligent agents based on solver feedback and behavioral constraint verification. The method specifically includes the following steps: Step 101: Obtain the task objective and the context data related to the task objective, and convert the task objective and the context data into a task instance; It should be noted that the execution subject of the intelligent agent self-correction method based on solver feedback and behavioral constraint verification provided in this embodiment of the invention can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. For example, a mobile electronic device can be a mobile phone, tablet computer, laptop computer, PDA, wearable device, ultra-mobile personal computer (UMPC), netbook, or personal digital assistant (PDA), etc., while a non-mobile electronic device can be a server, network attached storage (NAS), personal computer (PC), television (TV), ATM, or self-service machine, etc. This embodiment of the invention does not specifically limit these. The following embodiments of the invention use a server as an example for description.
[0027] An intelligent agent can be defined as a software entity capable of receiving task objectives, understanding task states, invoking external tools or solvers, reading feedback results, generating corrective actions, and triggering the next round of execution. This intelligent agent can be implemented using a rule engine, a planning strategy model, a large language model auxiliary module, a state machine, a workflow engine, or a combination thereof.
[0028] The embodiments of this invention can be applied to a single intelligent agent or to a system (referred to as an intelligent agent system) in which a master intelligent agent calls multiple tool modules. The single intelligent agent or intelligent agent system can run on a server to execute the intelligent agent self-correction method based on solver feedback and behavioral constraint verification provided in the embodiments of this invention.
[0029] The deployment of intelligent agent systems is not limited to local applications; it can also be implemented using cloud services, private deployment, edge nodes, plug-in services, microservices, or embedded execution environments.
[0030] It should be noted that this invention can be applied to scenarios such as industrial manufacturing, intelligent equipment, logistics scheduling, resource allocation, software engineering automation, data processing, equipment maintenance, inventory replenishment, energy scheduling, and robot task planning. It can be applied to production planning, equipment maintenance, quality re-inspection, material replenishment, and capacity adjustment in intelligent manufacturing. It can also be applied to logistics route planning, warehouse operation orchestration, energy scheduling, robot task planning, software construction and testing, automatic data pipeline repair, cloud resource orchestration, financial risk control processes, emergency response processes, and enterprise operation decisions, as well as other complex task scenarios that require solver calculation and behavioral verification constraints.
[0031] For example, in industrial scenarios, this invention can combine task plan solvers, inventory constraints, equipment maintenance rules, approval and release access control, and audit traceability mechanisms to achieve safe and controllable plan modification; in software engineering scenarios, this invention can transform feedback from compilers, testers, static analyzers, or deployment checkers into controlled modification actions of intelligent agents, and prevent unauthorized modifications, incorrect deployments, or destructive operations through behavior verification; in business process automation scenarios, this invention can integrate rule engines, process status, and interface feedback, enabling intelligent agents to automatically supplement materials, adjust process paths, or transfer manual processing without bypassing permissions and approvals.
[0032] In this embodiment of the invention, after receiving a complex task objective, the task objective and context data are uniformly converted into task instances, and the task instances drive the solver to solve the problem. In addition to the solver feedback, a behavior verifier is introduced to perform behavioral constraint verification on the candidate solutions and action boundaries when generating candidate solutions. Then, the agent generates candidate self-correcting actions based on the solver feedback and behavior verification results. After action-level verification, these actions are applied only to the task instances to update the task instances and trigger the next round of solving and verification, thereby forming a controlled, convergent, and traceable agent self-correction closed loop.
[0033] Complex tasks can refer to tasks that include multiple objectives, multiple constraints, multiple execution steps, multiple resources, or multiple external system interfaces; specifically, complex tasks can be production planning, logistics scheduling, equipment maintenance, software construction, data processing, order fulfillment, energy scheduling, resource allocation, or other tasks that require solving and verification.
[0034] A task objective can refer to a task description that an agent needs to complete, and it can come from users, external systems, or upstream processes. Contextual data can refer to information related to the task objective that affects task solving and execution. A task instance can refer to a computational object that structures the objective, input data, resource status, constraint rules, execution boundaries, and evaluation metrics of a complex task at a certain moment; task instances can be processed by solvers or checked by behavioral constraint verifiers.
[0035] In some embodiments, task objectives and context data can be obtained through API calls, data parsing, field mapping, rule extraction, etc., and then converted into task instances. Task instances can have structured fields for solver reading and behavior validator checking. Task instances can also be configured with identification information to distinguish between different versions or rounds of task instances during multi-round self-correction.
[0036] The task objectives and context data for complex tasks often come from different sources and have different formats. If these are directly processed by the solver or agent, it can easily lead to missing constraints, semantic inconsistencies, or verification difficulties. This invention first converts the task objectives and context data into a unified task instance, ensuring that subsequent solving, verification, correction, and updates are all based on the same task instance. This guarantees data flow consistency and improves the standardization and traceability of complex task processing.
[0037] Step 102: Invoke the solver and solve the problem using the task instance as input. If no candidate solution is generated, extract the solver feedback from the solver's operation. If a candidate solution is generated, extract the solver feedback from the solver's operation and the candidate solution to generate a feedback vector.
[0038] A solver is a solution engine capable of performing computations based on task instances. A candidate solution is the solution output generated by the solver based on the task instance. Solver feedback refers to the structured feedback information generated by the solver when solving task instances, searching for candidate solutions, or executing toolchains. This feedback can include feasibility status, reasons for failure, unmet constraints, conflict sets, resource bottlenecks, objective function components, quality metrics, error logs, execution time, candidate solution scores, and suggested relaxation terms. The feedback vector is the data obtained by structured representation of the solver feedback.
[0039] In this embodiment of the invention, after calling the solver to solve the problem with the task instance as input, there may be feedback such as infeasibility or timeout. At this time, there may be no candidate solution. The solver feedback can still be extracted from the solver operation to generate a feedback vector and continue to execute the subsequent agent self-correction process. When generating candidate solutions, the solver feedback is extracted from the solver operation and candidate solutions to generate a feedback vector and continue to execute the subsequent agent self-correction process.
[0040] In some embodiments, one or more solvers can be invoked to generate candidate solutions with the task instance as input. Solver feedback during candidate solution generation can be extracted from the solver execution process and candidate solutions, and generated as a feedback vector according to a preset format. The feedback vector may contain one or more feedback items for subsequent agent processing.
[0041] This invention improves the automation of solving complex tasks by extracting solver feedback into a feedback vector, enabling the agent to perform subsequent self-correction using solver feedback. This eliminates the need to rely solely on candidate solutions or simple error messages for subsequent processing.
[0042] Step 103: Using a behavior validator, perform behavior constraint verification on the task instance and action boundary when no candidate solution is generated, and perform behavior constraint verification on the task instance, the candidate solution, and the action boundary when a candidate solution is generated, to obtain the behavior verification result.
[0043] Behavioral constraints can refer to the rules that intelligent agents, tools, solvers, candidate solutions, or external execution systems must follow during operation. These can include resource mutual exclusion, temporal dependencies, permission boundaries, state transitions, data consistency, security policies, approval processes, interface protocols, execution preconditions, and audit requirements.
[0044] In some embodiments, behavioral constraints may be described using program rules, rule engines, state machines, sequential logic, SysML models, knowledge graphs, process models, formal constraint expressions, or combinations thereof.
[0045] A behavior validator can refer to a software module that performs behavior constraint verification. In this embodiment of the invention, the behavior validator can read task instances, candidate solutions, and action boundaries, verify the candidate solutions or action sequences obtained from the candidate solutions, and output behavior verification results. The behavior verification results can be used by the agent to generate candidate self-correcting actions.
[0046] In some embodiments, the behavior validator can read task instances, candidate solutions, action sequences, execution logs, and constraint rules, and output validation passed, blocking issues, warning issues, evidence data, suggested processing directions, and audit fields.
[0047] The feasibility of a candidate solution at the solver level does not necessarily imply its feasibility at the behavioral level. This invention employs a behavior validator to perform behavioral constraint verification by combining task instances, candidate solutions, and action boundaries during candidate solution generation. This allows for the identification of behavioral constraint issues before candidate solutions are further modified or output, thereby reducing the risk of unexecutable, non-compliant, or unauthorized actions entering subsequent processes and improving the overall security and compliance of the solution.
[0048] Step 104: Based on the feedback vector and the behavior verification result, generate candidate self-correcting actions.
[0049] Self-correcting actions can refer to controlled corrective operations generated by an agent based on solver feedback and behavioral constraint verification results.
[0050] In some embodiments, the agent can generate one or more candidate self-correcting actions based on feedback vectors and behavior verification results. These candidate self-correcting actions can be represented in a structured form for subsequent action-level verification.
[0051] In some embodiments, the agent may generate self-correcting actions in ways not limited to rule mapping, but may also use policy tables, case retrieval, reinforcement learning, decision trees, planning models, large language models to assist in generation, or manually configure policies.
[0052] This invention solves the problem of how feedback information is difficult to be automatically converted into correction actions by automatically converting solver feedback and behavior verification results into candidate self-correction actions, thus providing a foundation for subsequent controlled update task instances.
[0053] Step 105: Perform action-level verification on the candidate self-correcting actions to obtain verified self-correcting actions, and apply the verified self-correcting actions to the task instance to update the task instance.
[0054] In some embodiments, action-level verification can be performed by a standalone module or by verification logic outside the agent. The verified self-correcting action can be used to update relevant data in the task instance, such as constraints, variables, configurations, or states, so that the task instance reflects the correction result.
[0055] This invention provides an embodiment that performs action-level verification on candidate self-correcting actions to determine whether they can be applied. Verified self-correcting actions are applied only to task instances to update them, and the updated task instances trigger the next round of solving and verification, thus forming a controlled update process. This avoids the security risks caused by the agent directly modifying the external system and improves the controllability of the self-correction process.
[0056] Step 106: Perform the next round of solving and verification based on the updated task instance until the self-correcting termination condition is met, and obtain the final output result; the final output result is the final candidate solution or termination information.
[0057] A self-correcting termination condition refers to a preset condition used to determine whether the self-correcting process has ended. The self-correcting termination condition can be preset according to actual needs. For example, the self-correcting termination condition can be set to reaching the time budget or the maximum number of iterations.
[0058] Termination information can refer to information used to indicate the end of a self-correction process when the self-correction process meets the self-correction termination condition but fails to obtain an output final candidate solution.
[0059] In some embodiments, each iteration can be based on the task instance updated in the previous round. If the self-correction termination condition is not met, the next iteration can continue. When the self-correction termination condition is met, it is determined whether a candidate solution that passes behavioral verification and meets the output conditions has been obtained. If a candidate solution that passes behavioral verification and meets the output conditions is obtained, the candidate solution is output as the final output result. If no candidate solution is generated or no candidate solution that passes behavioral verification and meets the output conditions is obtained, termination information is output as the final output result to indicate the end of the self-correction process, and the corresponding termination reason is explained (no candidate solution was generated, the candidate solution failed behavioral verification, etc.), thereby avoiding directly outputting generated but unverified candidate solutions as normal results.
[0060] The embodiments of the present invention improve the self-correction capability and convergence of complex task processing by continuously utilizing solver feedback and behavior verification results in multiple iterations for controlled self-correction until the final output result is obtained.
[0061] This invention unifies task objectives and context data through task instances. A solver uses the task instance as input to solve the problem and extract feedback vectors. A behavior verifier verifies behavioral constraints. An agent generates candidate self-correcting actions based on the feedback vectors and behavior verification results. These candidate actions undergo action-level verification, and the task instance is updated. Finally, the next round of solving and verification is performed based on the updated task instance until the self-correction termination condition is met, yielding the final output. Therefore, this invention achieves an agent self-correction process combining solver feedback and behavior constraint verification. This allows the agent to perform multiple rounds of self-correction under the constraints of deterministic tools and safety boundaries, rather than directly relying on free text reasoning or unconstrained automatic execution. This improves the feasibility, security, and automation of solving complex tasks.
[0062] Based on any of the above embodiments, the context data includes at least one of resource status, task dependencies, historical execution records, business rules, external interface permissions, data quality status, executed steps, callable tools, solver configuration, and manual approval requirements; the task instance includes at least one of target set, input variables, resource set, candidate action set, hard constraint set, soft target set, execution boundary, verification rules, and evaluation indicators.
[0063] Among these, resource status refers to the current status information of computing resources, storage resources, network resources, device resources, and external system resources involved in task execution, such as resource availability, occupancy rate, remaining capacity, and health status. Task dependency refers to the dependency relationship between the current task and other tasks, such as predecessor tasks, successor tasks, parallel tasks, serial tasks, and triggering conditions. Historical execution records refer to records generated during the past execution of tasks that are the same or similar to the current task, such as execution results, reasons for failure, time consumption, resource consumption, and human intervention. Business rules refer to the business logic, compliance requirements, approval rules, and permission rules that task execution must follow. External interface permissions refer to the permission information that an agent or system has when calling external interfaces, tools, or services, such as read / write permissions, calling scope, and frequency limits. Data quality status refers to the quality information such as the completeness, consistency, accuracy, and timeliness of task input data or context data. Executed steps refer to one or more steps that the current task has completed and their execution results. Callable tools refer to the tools, functions, interfaces, services, or models that the agent can call during task execution. Solver configuration refers to the configuration information required when calling the solver, such as solver type, solution parameters, time budget, search space, and target weights. Manual approval requirements refer to nodes, conditions, or rules that require manual approval, review, or confirmation during task execution.
[0064] The task instance is defined as follows: **Target Set:** This refers to one or more task objectives to be achieved, including primary objectives, sub-objectives, and optimization objectives. **Input Variables:** Input variables refer to the input parameters, data, or conditions required by the solver or behavior verifier when processing the task instance. **Resource Set:** This refers to the available resource objects in the task instance, such as computing resources, storage resources, network resources, equipment resources, and human resources. **Candidate Action Set:** This refers to one or more candidate actions that the agent or solver can choose from in the task instance. **Hard Constraints:** These are constraints that candidate solutions, actions, or plan versions must not violate, such as resource non-conflict, task dependency non-inversion, permission non-extra-authority, security rule non-bypass, external interface protocol non-violation, and unapproved results non-publication. **Soft Objectives:** These are metrics that can be weighed and optimized, such as cost, timeliness, success rate, resource utilization, disturbance amount, stability, user satisfaction, energy consumption, risk level, or task completion quality. **Execution Boundary:** This refers to the execution scope, permission boundary, writable boundary, or operational boundary defined in the task instance. **Verification Rules:** These are rules used by the behavior verifier to check whether candidate solutions or action sequences satisfy behavioral constraints. Evaluation metrics are indicators used to evaluate the quality of candidate solutions, the effectiveness of task execution, or the self-correction effect. Examples include performance metrics, cost metrics, efficiency metrics, and compliance metrics.
[0065] In some embodiments, contextual data related to the task objective can be obtained from user input, external systems, databases, logs, configuration files, or historical records through methods such as interface querying, data parsing, field mapping, rule extraction, and semantic transformation. For example, resource status can be read from a resource management system, task dependencies from a task scheduling system, historical execution records from a historical database, business rules from a rule base, external interface permissions from a permission system, data quality status from a data quality monitoring system, executed steps from execution logs, callable tools from a tool registry, solver configuration from a solver configuration file, and manual approval requirements from an approval system.
[0066] When converting contextual data into task instances, mapping relationships can be established. For example, task objectives can be converted into a set of objectives, input parameters or input data into input variables, available resources into a set of resources, executable actions into a set of candidate actions, rules that must be met into a set of hard constraints, optimization objectives into a set of soft objectives, permission boundaries or writable ranges into execution boundaries, rules required for behavior verification into verification rules, and evaluation criteria into evaluation metrics. Task instances can be represented using structured data formats such as objects, tables, trees, graphs, JSON, and XML, and can be assigned task identifiers, version numbers, timestamps, and source identifiers for updating, tracing, and auditing during multiple rounds of self-correction.
[0067] In some embodiments, the target set, input variables, resource set, candidate action set, hard constraint set, soft target set, execution boundary, verification rules, and evaluation metrics in a task instance can be dynamically adjusted according to the task type. For example, for scheduling tasks, the hard constraint set may include timing constraints and resource mutual exclusion constraints; for code modification tasks, verification rules may include compilation pass, test pass, and interface compatibility rules; for business process tasks, the execution boundary may include approval status and external system writable boundaries. In this way, task instances can adapt to different types of complex tasks and support the collaborative processing of solvers and behavior verifiers.
[0068] In this embodiment of the invention, various types of information in the context data are uniformly mapped to the corresponding components of the task instance, enabling the task instance to be processed by the solver to generate candidate solutions and to be checked by the behavior verifier for behavioral constraint verification. Since the task instance contains at least one of the following: target set, input variables, resource set, candidate action set, hard constraint set, soft target set, execution boundary, verification rules, and evaluation metrics, the subsequent agent self-correction process can be updated and re-solved based on the same task instance, thereby improving the completeness, verifiability, and security of solving complex tasks. Simultaneously, it facilitates the structuring of dispersed context information, reducing constraint omissions and semantic inconsistencies, and providing a stable and traceable data foundation for multi-round self-correction closed loops.
[0069] Based on any of the above embodiments, the candidate solution is at least one of the following: task plan, resource allocation scheme, execution step sequence, configuration parameter set, path scheme, scheduling result, code modification scheme, and data processing flow; the solver is at least one of the following: optimization solver, rule solver, planner, tester, compiler, and simulator.
[0070] Among these, a task plan refers to an execution plan generated for a task objective, such as task decomposition, execution sequence, time arrangement, and responsibility allocation. A resource allocation scheme refers to a plan for allocating available resources to one or more tasks, steps, or actions, such as computing resource allocation, storage resource allocation, equipment resource allocation, and human resource allocation. An execution step sequence refers to one or more execution steps required to complete a target task and their sequential relationship. A configuration parameter set refers to the parameter configurations required to complete a task, such as system parameters, model parameters, tool parameters, interface parameters, and runtime parameters. A path scheme refers to the path selection results involved in completing a task, such as logistics paths, network paths, processing paths, and call paths. A scheduling result refers to the result obtained after scheduling tasks, resources, actions, or events, such as time scheduling, sequential scheduling, and resource scheduling. A code modification scheme refers to a code change scheme generated for a software task, such as code patching, function modification, configuration modification, and interface adjustment. A data processing flow refers to a process scheme for processing data, such as data collection, cleaning, transformation, calculation, storage, or output.
[0071] The solver can refer to a computational module that generates candidate solutions, action sequences, scheduling schemes, resource allocation schemes, path schemes, plan versions, or configuration schemes based on a task instance. This includes, but is not limited to, constraint programming solvers, mixed integer programming solvers, heuristic searchers, path planners, rule inferencers, genetic algorithm solvers, greedy solvers, local searchers, compilers, test executors, multi-objective optimizers, simulators, code analyzers, or any other tool capable of generating candidate solutions and feedback information.
[0072] In some embodiments, one or more solvers can be selected based on the task type. For example, for resource allocation tasks, an optimization solver can be selected to generate resource allocation schemes; for process planning tasks, a planner can be selected to generate a sequence of execution steps or a task plan; for business rule judgment tasks, a rule solver can be selected to generate results that satisfy business rules; for software testing tasks, a tester can be selected to generate test results or failed test case information; for code repair tasks, a compiler can be selected to generate compilation results or code modification schemes; and for system behavior prediction tasks, a simulator can be selected to generate simulation results or scheduling results.
[0073] In some embodiments, multiple solvers can be invoked collaboratively to generate candidate solutions. These solvers can be invoked sequentially, in parallel, or according to priority. For example, a rule-based solver can first determine the feasible range, and then an optimization solver can optimize within that range; alternatively, a planner can first generate an initial sequence of execution steps, and then a simulator can verify the sequence through simulation. The candidate solutions output by different solvers can have a unified structured representation to facilitate subsequent extraction of solver feedback, verification of behavioral constraints, and generation of candidate self-correcting actions.
[0074] Different types of complex tasks require different types of solvers, and the candidate solutions generated by different solvers may also have different forms. This invention supports multiple types of solvers generating multiple forms of candidate solutions, thus adapting to various task types and solving scenarios. Furthermore, a unified form of candidate solution facilitates subsequent extraction of solver feedback, verification of behavioral constraints, and generation of controlled self-correcting actions, which helps improve the flexibility, adaptability, and automation of the self-correcting process for complex tasks.
[0075] Based on any of the above embodiments, each feedback item in the feedback vector includes at least one of the following: feedback type, severity level, associated variable, associated resource, associated action, numerical evidence, error information, candidate solution quality, conflict constraint, and traceable source; the feedback type includes at least one of the following: infeasibility feedback, timeout feedback, local optimum feedback, constraint conflict feedback, objective function degradation feedback, resource bottleneck feedback, execution failure feedback, input data anomaly feedback, and candidate solution quality inadequate feedback.
[0076] A feedback vector is a data object obtained by structuring the feedback information reflected in the solver's operation and / or candidate solutions. A feedback vector may include one or more feedback items. A feedback item is a structured feedback record in the feedback vector, used to describe a specific problem, solution status, or candidate solution quality.
[0077] Feedback type refers to the problem category represented by the feedback item. Infeasibility feedback indicates that the solver cannot find a candidate solution that satisfies all constraints. Timeout feedback indicates that the solver has not completed the solution before reaching the preset time or computational resource budget. Local optimum feedback indicates that the solver has found a local optimum but not the global optimum, or that the candidate solution is better locally but still has room for improvement. Constraint conflict feedback indicates that multiple constraints in the task instance conflict with each other, making it impossible to satisfy them simultaneously. Objective function degradation feedback indicates that the objective function value of the candidate solution deteriorates during optimization, or that the current candidate solution deteriorates in the objective function compared to historical candidate solutions. Resource bottleneck feedback indicates that the task execution or candidate solution implementation is limited by the amount, capacity, availability, or performance of resources. Execution failure feedback indicates that the candidate solution fails during simulation, test execution, or actual invocation. Input data anomaly feedback indicates that the input data of the task instance has problems such as missing, incorrect, inconsistent, expired, or abnormal format. Insufficient candidate solution quality feedback indicates that although a candidate solution can be generated, its quality, accuracy, completeness, stability, or compliance does not meet the preset requirements.
[0078] Among these, severity level refers to the degree of severity of the problem represented by the feedback item. Severity levels can be divided into different levels according to actual needs, such as blocking level, critical level, warning level, and alert level, so that the agent can determine the processing priority. Associated variables refer to variables or parameters in the task instance related to the feedback item. Associated resources refer to resource objects related to the feedback item. Associated actions refer to actions, steps, or operations related to the feedback item. Numerical evidence refers to numerical information used to support the judgment of the feedback item, such as the number of constraint conflicts, objective function value, resource gap, timeout time, error value, number of test failures, etc. Error information refers to error descriptions, error codes, exception information, or log information output by the solver or related execution process. Candidate solution quality refers to the quality evaluation information of candidate solutions in terms of feasibility, optimization degree, completeness, stability, resource consumption, execution efficiency, etc. Conflicting constraints refer to mutually conflicting constraints or sets of constraints that lead to the generation of feedback items. Traceable source refers to the source information of the feedback item, such as solver identifier, solution round, timestamp, log location, constraint identifier, candidate solution version, operating environment identifier, etc., for subsequent traceability and auditing.
[0079] In some embodiments, solver feedback information can be extracted from the solver execution process and candidate solutions. For example, timeout information, exception information, and iteration information can be extracted from the solver log; feasibility status, objective function value, optimality status, and solution status can be extracted from the solver return value; conflict constraints and infeasible subsets can be extracted from the constraint conflict set; the values and degradation status of each objective term can be extracted from the objective function components; resource bottlenecks and resource gaps can be extracted from resource usage data; execution failure feedback can be extracted from test execution results; input data anomaly feedback can be extracted from input data inspection results; and insufficient candidate solution quality feedback can be extracted from candidate solution evaluation results.
[0080] In some embodiments, the extracted feedback information can be normalized and mapped to feedback items in a uniform format. Feedback information output by different solvers can be merged into the same feedback vector through field mapping, semantic transformation, and identifier alignment. Multiple feedback items in the feedback vector can be sorted, aggregated, deduplicated, or grouped. For example, they can be sorted by severity level, prioritizing blocking and severe feedback items; feedback items associated with the same variable, resource, or action can be aggregated for centralized processing by the agent.
[0081] In some embodiments, the traceable source of a feedback item may include solver identifier, solver version, call time, iteration round, candidate solution identifier, task instance version, log file location, log line number, constraint identifier, resource identifier, action identifier, etc. By tracing the source, the solution round and candidate solution version corresponding to the feedback item can be determined during subsequent self-correction processes, and the generation and processing of the feedback item can be recorded in the audit chain. The feedback item can also be set with a timestamp and status marker, such as unprocessed, processing, processed, transferred to manual intervention, etc., to track the problem status during multiple rounds of self-correction.
[0082] This invention structures the solver's operation process and feedback information in candidate solutions into feedback vectors, with each feedback item carrying multiple pieces of information. This allows the agent to not only know what result the solver has given, but also the type of problem, its severity, the variables, resources, and actions involved, the numerical evidence, the source of conflict constraints, and whether the problem's origin is traceable. This helps to solve the problems of existing agent systems that merely treat the solver output as the final result or error message, and fail to fully utilize the failure reasons, conflict sets, objective function components, and resource bottleneck information in the solver feedback. As a result, the generation of subsequent candidate self-correcting actions is more accurate and targeted, and the automation, interpretability, and traceability of the self-correction process for complex tasks are improved.
[0083] Based on any of the above embodiments, the behavioral constraint verification includes at least one of resource mutual exclusion, step dependency, state transition legality, permission legality, interface call order, data consistency, security policy, approval status, external system writable boundary, and audit field integrity; each verification item of the behavioral verification result includes at least one of problem type, severity level, rule violation, evidence field, associated object, whether execution is blocked, suggested processing direction, and audit requirements.
[0084] Behavioral constraint verification refers to examining candidate solutions, execution actions, plan versions, or tool call sequences to determine whether they meet behavioral constraints. Behavioral constraint verification can examine physical resource behavior, as well as software process behavior, business process behavior, permission behavior, and API call behavior.
[0085] Resource mutual exclusion refers to the inability of the same resource to be occupied by more than two actions simultaneously at the same time or in the same execution phase, or the inability of certain resources to be used simultaneously. Step dependency refers to the existence of pre-requirement, post-requirement, sequential, or conditional dependencies between actions or steps; for example, an action can only be executed after another action has been completed. State transition legality means that the system state change caused by the execution of an action must conform to preset state transition rules, and cannot transition from one state to another that was never allowed. Permission legality refers to whether the subject, intelligent agent, or system executing the action has the necessary permissions to execute the action. Interface call order refers to the order or conditions that must be followed when calling external interfaces, tools, or services. Data consistency means that related data should remain consistent before and after the execution of an action, and there should be no data contradictions, data loss, or data errors. Security policy refers to the security rules that task execution must meet, such as not exceeding authorized access, not disclosing sensitive data, and not compromising the system's security state. Approval status refers to whether an action requiring manual approval has been approved or is in an approved state that allows execution. External system writable boundary means that writing to, modifying, or publishing to an external system cannot exceed the allowed scope or boundary. Audit field completeness means that the audit fields related to the execution of actions should be complete so that subsequent traceability and auditing can be carried out.
[0086] The behavior verification result refers to the verification conclusion output by the behavior verifier, which may include one or more verification items. A verification item is a structured record in the behavior verification result, used to describe the verification status of a specific behavior constraint.
[0087] The verification item is categorized into several parts: Problem Type: This refers to the category of problems represented by the verification item, such as resource conflicts, unmet step dependencies, insufficient permissions, or incomplete approvals. Severity Level: This refers to the severity of the problem represented by the verification item, such as blocking, severe, warning, and alert levels. Rule Violation: This refers to the specific behavioral constraint rules violated by the verification item. Evidence Fields: This refers to the evidence information used to support the judgment of the verification item, such as resource usage records, dependency data, permission information, status data, and call logs. Associated Objects: This refers to objects related to the verification item, such as tasks, variables, resources, actions, tools, interfaces, and approval nodes. Execution Blocking: This refers to whether the verification item prevents candidate solutions or action sequences from continuing execution or entering the next stage. Suggested Handling Direction: This refers to the handling suggestions given for the verification item, such as modifying actions, supplementing approvals, adjusting the order, replacing resources, or transferring to manual review. Audit Requirements: This refers to the audit information or audit operation requirements that need to be recorded for the verification item.
[0088] In some embodiments, multiple verification items in the behavior verification results can be sorted, aggregated, deduplicated, or grouped. For example, they can be sorted by severity level, with blocking and severity level verification items being output first; verification items associated with the same object, the same action, or the same resource can be aggregated for centralized processing by subsequent agents.
[0089] The feasibility of a candidate solution at the solver level does not necessarily imply its feasibility at the behavioral level. Therefore, in addition to solver feedback, a behavior verifier is needed to verify the behavioral constraints of task instances, candidate solutions, and action boundaries. This invention effectively prevents candidate solutions that are feasible at the solver level but infeasible, non-compliant, or exceed authority at the behavioral level from entering subsequent execution or output stages, improving the safety and compliance of complex task processing, and providing a structured basis for the subsequent generation of controlled self-correcting actions by the intelligent agent.
[0090] Based on any of the above embodiments, generating candidate self-correcting actions based on the feedback vector and the behavior verification result includes: fusing the feedback vector and the behavior verification result into a problem state graph; wherein, the nodes of the problem state graph are used to represent target nodes, variable nodes, resource nodes, action nodes, tool nodes, external interface nodes, or approval nodes, and the edges of the problem state graph are used to represent conflict relationships, dependency relationships, blocking relationships, substitution relationships, or correction relationships; and generating the candidate self-correcting actions based on the feedback vector, the behavior verification result, the problem state graph, the action boundaries, and historical audit records.
[0091] A problem state graph is a structured graph representation used to integrate solver feedback and behavioral verification results, expressing the objects and their relationships within a task instance in a graph-like manner. A problem state graph can be represented as a set of nodes and edges, where nodes represent entities involved in task solving and self-correction, and edges represent constraints, conflicts, dependencies, or corrective relationships between entities. Through the problem state graph, the agent can gain a holistic understanding of the problems with the current candidate solution, the relationships between these problems, and possible corrective directions.
[0092] In this diagram, target nodes represent task objectives or sub-objectives. Variable nodes represent input variables, decision variables, parameter variables, or state variables within a task instance. Resource nodes represent resources required for task execution or available resources. Action nodes represent candidate actions, executed actions, self-correcting actions, or action sequences. Tool nodes represent callable tools, functions, services, or models. External interface nodes represent external system interfaces, external service interfaces, or external data interfaces. Approval nodes represent manual approval, manual review, or approval process nodes.
[0093] Among these, a conflict relationship refers to a mutually exclusive relationship between two nodes, meaning they cannot be simultaneously satisfied or executed. A dependency relationship refers to a relationship where the execution or satisfaction of one node requires another node as a prerequisite. A blocking relationship refers to a relationship where a problem in one node prevents another node from continuing to execute, failing verification, or outputting results. A substitution relationship refers to a relationship where one node can be replaced by another node to circumvent conflicts, bottlenecks, or unavailable resources. A corrective relationship refers to a relationship where a problem represented by one node can be corrected through actions, variable adjustments, or resource substitution represented by another node.
[0094] Historical audit records refer to audit records generated during historical self-correction processes or historical task processing. These records may include at least one of the following: historical task objectives, input data summaries, solver feedback, behavior verification results, candidate self-correcting actions, action filtering results, final status, and manual approval results. Historical audit records can be used for at least one of the following: similar problem retrieval, strategy recommendation, risk alerts, and rule optimization.
[0095] In some embodiments, the problem state graph can be represented using a graph data structure, such as an adjacency list, adjacency matrix, attribute graph, knowledge graph, or graph database. It can also be represented using tables, tree structures, state vectors, constraint conflict sets, event flows, or other data structures capable of expressing the relationship between feedback and verification issues. Structured information in the feedback vector and behavior verification results can be preserved through node attributes and edge attributes.
[0096] In some embodiments, multiple feedback items in the feedback vector and multiple verification items in the behavior verification result can be aligned, merged, and deduplicated. For example, if a feedback item and a verification item are both associated with the same action node, the action node can be treated as a common associated object in the problem state graph, and corresponding conflict edges, blocking edges, or correction edges can be set on the action node. If multiple feedback items or verification items point to the same resource node, information such as resource bottlenecks, resource mutual exclusion, or external writable boundaries can be aggregated on the resource node. Through aggregation, redundant nodes and redundant edges in the problem state graph can be reduced, improving the agent's processing efficiency.
[0097] In some embodiments, the problem state graph can be updated with each iteration of the self-correcting closed loop. After each round of solving and verification, the node states, edge relationships, severity levels, and blocking states in the problem state graph can be updated based on the new feedback vectors and behavioral verification results. The updated problem state graph can be used to generate candidate self-correcting actions for the next round. The problem state graph can also be set with version identifiers and iteration round identifiers for subsequent traceability and auditing.
[0098] In some embodiments, when an agent generates candidate self-correcting actions, it may prioritize processing nodes and edges with blocking relationships in the problem state graph, then process nodes and edges with conflict relationships, and finally process non-blocking quality, efficiency, or cost issues.
[0099] In this embodiment of the invention, feedback vectors and behavioral verification results are fused into a problem state graph, enabling solver feedback, behavioral verification results, task instance objects, and their interrelationships to be expressed within the same graph structure. The problem state graph helps the agent identify the root cause of the problem, blocked paths, and correctable directions holistically. Furthermore, the agent generates candidate self-correcting actions based on feedback vectors, behavioral verification results, the problem state graph, action boundaries, and historical audit records. This ensures that candidate self-correcting actions not only target individual feedback or verification items but also consider the relationships between problems, the safety boundaries of actions, and historical experience. Therefore, this embodiment of the invention helps solve the problem of the lack of integrated expression of solver feedback, execution logs, verification problems, business rules, and historical audit information, improving the accuracy, globality, security, and traceability of candidate self-correcting action generation, and supporting the continuous convergence of multi-round self-correcting closed loops.
[0100] Based on any of the above embodiments, the candidate self-correcting actions include at least one of the following: adjusting target weights, supplementing missing inputs, replacing resources, splitting tasks, changing execution order, adding pre-checks, rolling back the previous action, switching to a backup solver, increasing the search time budget, reducing the search space, requesting manual approval, pausing external writing, and generating an explanation report; the action-level verification of the candidate self-correcting actions includes: if the candidate self-correcting action is not in the action whitelist, the parameters exceed the boundary, the calling permissions are insufficient, it damages the external system state, violates hard constraints, or bypasses manual approval, then the candidate self-correcting action is rejected or transferred to manual review.
[0101] Candidate self-correcting actions are actions generated by an agent based on feedback vectors and behavior verification results, used to correct task instances or adjust subsequent solution processes. Candidate self-correcting actions can be represented as structured actions for action-level verification and application.
[0102] Adjusting target weights refers to adjusting the weight or priority of one or more targets in a task instance, such as increasing the weight of targets related to hard constraints and decreasing the weight of soft targets, to change the solver's solution direction. Supplementing missing inputs refers to supplementing missing input data or parameters in a task instance in response to abnormal input data feedback or missing input variables. Replacing resources refers to replacing currently unavailable, conflicting, or restricted resources with other available resources to eliminate resource bottlenecks or resource mutual exclusion. Splitting tasks refers to breaking down a complex task into multiple subtasks or sub-steps to reduce solution complexity or avoid constraint conflicts. Changing the execution order refers to adjusting the sequence of actions or execution steps to satisfy step dependencies, interface call order, or state transition legality. Adding pre-checks refers to adding check steps before executing an action, such as permission checks, data consistency checks, approval status checks, or resource availability checks. Rolling back the previous action refers to undoing or reverting the self-correcting actions or task instance updates applied in the previous round to restore the previous state. Switching to a backup solver refers to switching from the current solver to a backup solver to utilize the solving capabilities of different solvers or avoid problems such as timeouts and local optima in the current solver. Increasing the search time budget refers to increasing the solver's computation time or number of iterations to obtain better or feasible candidate solutions. Reducing the search space refers to decreasing the solver's search range or variable space to improve solving efficiency or avoid infeasible regions. Requesting manual approval refers to generating a manual approval request for actions or issues requiring manual review and transferring it to the manual review process. Suspending external writes refers to suspending write, modification, or publishing operations to external systems to avoid disrupting the external system's state or exceeding writable boundaries. Generating an explanatory report refers to generating an explanatory report explaining the cause of the problem, the correction process, remaining risks, or suggested handling directions.
[0103] Action-level verification refers to verifying the legality, security, and executability of candidate self-correcting actions to determine whether the action can be applied. An action whitelist is a predefined set of actions that an agent is allowed to execute or is recommended to execute. Corrective actions generated by an agent can only be applied to a task instance or enter the approval process after falling into the action whitelist and passing parameter boundary checks, permission checks, and behavior verification. Parameter exceeding boundaries means that the parameter values carried by the candidate self-correcting action exceed the preset value range or constraint range. Insufficient calling permissions means that the permissions required to execute the candidate self-correcting action are not possessed by the current agent or system. Damaging external system state means that if the candidate self-correcting action is executed, it may lead to unauthorized modification of the external system's state, data corruption, or service unavailability. Violating hard constraints means that the candidate self-correcting action conflicts with the set of hard constraints in the task instance. Bypassing manual approval means that the candidate self-correcting action may take effect or be executed directly without necessary manual approval.
[0104] In some embodiments, action-level verification can be performed by a separate action security filtering module or by verification logic outside the agent. Verified candidate self-correcting actions can be applied to task instances, while unverified candidate self-correcting actions can be recorded in the audit chain with a rejection reason. Candidate self-correcting actions transferred to manual review can generate a manual review request and pause the automatic correction process until manual processing is completed.
[0105] The action safety filtering module can be deployed inside the intelligent agent, or it can be implemented as an independent policy gateway, external approval service, interface proxy, or runtime sandbox.
[0106] In some embodiments, candidate self-correcting actions can be prioritized. For example, actions related to blocking hard constraints are processed first, followed by actions related to quality, efficiency, or cost. If multiple candidate self-correcting actions pass action-level verification, the action with the highest priority or the best expected effect can be selected and applied to the task instance.
[0107] In some embodiments, the manual review process can be dynamically determined based on the task type. For high-risk actions, manual approval can be mandatory; for low-risk actions, they can be executed automatically and audited; for uncertain actions, suggestions can be generated but not automatically applied.
[0108] While candidate self-correcting actions generated by the agent based on feedback vectors and behavior verification results may be intended to correct problems, they may also pose risks of exceeding authority, being non-compliant, unexecutable, or disrupting the state of external systems. Therefore, action-level verification is required before applying candidate self-correcting actions to task instances. This invention enables the agent to generate various types of candidate self-correcting actions to address different issues in solver feedback and behavior verification results. Furthermore, by performing action-level verification on candidate self-correcting actions, it ensures that only actions that do not exceed the action whitelist, parameter boundaries, permission range, hard constraints, and manual approval requirements can be applied. This effectively prevents the agent from generating actions that exceed authority, are unexecutable, non-compliant, or disrupt the state of external systems, improving the security, compliance, and controllability of the self-correction process, and providing a reliable, controlled action basis for multi-round self-correction loops.
[0109] Based on any of the above embodiments, after satisfying the self-correction termination condition and obtaining the final output result, the method further includes: outputting the final output result, explanatory information, and traceable audit records; writing the traceable audit records into the audit chain; the audit chain is used for similar problem retrieval, strategy recommendation, risk warning, and rule optimization for subsequent tasks; wherein, the explanatory information includes at least one of result summary, key indicators, correction process description, remaining risk, and manual approval items; the traceable audit records include at least one of task objective, input data summary, solver feedback, behavior verification result, candidate self-correction action, verified self-correction action, updated task instance, final state, and manual approval result.
[0110] The explanatory information refers to descriptive information explaining how the final candidate solution was obtained, why it is credible, what risks exist, and whether manual approval is required. The results summary is a brief description of the core content, scope of application, and conclusions of the final candidate solution. Key performance indicators (KPIs) are data used to evaluate the performance, cost, efficiency, quality, resource consumption, or compliance of the final candidate solution. The correction process description explains the multi-round solution process, feedback extraction, behavior verification, candidate self-correction action generation, action-level verification, and task instance update. Residual risks refer to risks, uncertainties, and unresolved issues that still exist after the final candidate solution passes verification. Manual approval items refer to matters requiring manual confirmation, approval, or review.
[0111] Traceable audit logs are structured records used to document key evidence throughout the entire task processing process, enabling subsequent tracing, auditing, reuse, and rule optimization.
[0112] The audit chain refers to a data chain organized by traceable audit records according to a certain order, timestamp, round, or version relationship. It can be used to record the relationships between task objectives, input data, solver configuration, solver feedback, behavior verification results, self-correcting actions, action filtering results, resolving results, manual approval, and final output. The audit chain can be implemented using chained storage, hash association, timestamp marking, version identification, or log sequences. Similarity problem retrieval refers to retrieving similar problems from historical audit records based on the similarity between the current task and historical tasks in terms of task objectives, input data, solver feedback, behavior verification results, or candidate self-correcting actions. Strategy recommendation refers to recommending candidate self-correcting actions or processing strategies for the current or subsequent tasks based on successful or failed correction strategies in historical audit records. Risk warning refers to providing risk warnings for the current or subsequent tasks based on risk information, remaining risks, or manual approval items in historical audit records. Rule optimization refers to optimizing at least one of the following: behavior verification rules, action boundaries, solver configuration, or business rules, based on feedback, verification results, and processing results in historical audit records.
[0113] In some embodiments, the final output results, explanatory information, and traceable audit records may be output in at least one of the following forms: structured data, reports, messages, interface returns, files, or visualizations.
[0114] In some embodiments, traceable audit logs can be organized according to task identifiers and iteration rounds. Each iteration can record at least one of the following: task objective, input data summary, solver feedback, behavior verification results, candidate self-correcting actions, verified self-correcting actions, and updated task instances. When the self-correction process ends, the final state and manual approval results can be recorded. Traceable audit logs can be set with timestamps, version numbers, hash values, or chain pointers to form an audit chain. The audit chain can be stored in a database, log system, blockchain, distributed ledger, or dedicated audit storage.
[0115] In some embodiments, the large language model can participate in generating result summaries, correction process descriptions, or residual risk descriptions in the explanatory information. The output of the large language model can be converted into structured explanatory information and can be output after verification. The large language model cannot directly modify external formal systems, nor can it bypass action-level verification and manual approval.
[0116] When candidate solutions are available, the agent self-correction process for complex tasks also needs to ensure that the final candidate solution is interpretable, traceable, and reusable. If only the final candidate solution is output, users or approvers will find it difficult to understand how it was obtained through multiple rounds of solving, feedback extraction, behavior verification, and controlled correction, and will also find it difficult to determine whether there are any remaining risks or matters requiring manual approval. Therefore, after obtaining the final candidate solution, embodiments of the present invention can further output explanatory information and traceable audit records, and write the traceable audit records into an audit chain. The audit chain is used for similar problem retrieval, strategy recommendation, risk warning, and rule optimization in subsequent tasks, enabling the reuse of historical self-correction experience. This improves the interpretability, traceability, reusability, and continuous optimization capability of the agent self-correction method, and further enhances the security and controllability of complex task processing.
[0117] To enable those skilled in the art to better understand the embodiments of the present invention, a specific embodiment is described below.
[0118] The existing technical solutions include the following: Existing Solution 1: Manual handling of complex tasks. This solution involves manually modifying input parameters, execution tools, checking results, and retrying based on task objectives, system feedback, and empirical rules. While flexible, this method is inefficient, and the basis for corrections is difficult to structure and solidify.
[0119] Existing Solution 2: Single Solver Invocation. This solution transforms complex tasks into constraint or optimization models and invokes the solver to obtain candidate solutions. While this method can automatically calculate results, manual analysis and remodeling are typically required when the solution fails, the result quality is poor, or the execution environment changes.
[0120] Existing Solution 3: Rule-based workflow automation. This solution pre-configures fixed processes and conditional branches. When a step fails, it retryes according to fixed rules or switches to manual intervention. This method is stable and controllable, but it is difficult to dynamically generate new correction strategies based on fine-grained feedback from the solver.
[0121] Existing Solution 4: Agent Self-Reflection Based on Large Language Models. This solution allows the agent to read execution results or error logs and generate a next step plan through natural language reflection. This approach has a certain generalization ability, but if behavioral constraint verification and action boundary control are lacking, it is prone to generating unexecutable, unauthorized, or non-compliant corrective suggestions.
[0122] Existing Solution 5: Post-Verification Mechanism. This solution uses a verifier or tester to check candidate solutions after generation, and outputs error terms when problems are found. This method can identify risks, but it usually does not integrate the verification results with the solver feedback into the next round of self-correction.
[0123] However, existing technical solutions have the following drawbacks: (1) Existing intelligent agent systems lack a mechanism to structure solver feedback into a self-correcting basis. Solver feedback often remains at the level of logs, error codes, or index tables, failing to automatically drive the next round of task correction.
[0124] (2) Existing self-reflective agents mostly rely on natural language reasoning and lack action whitelists, parameter boundaries, permission boundaries and behavior verification boundaries, which can easily generate actions that cannot be executed or have security risks.
[0125] (3) Existing verification mechanisms are mostly post-event blocking, and cannot further map verification problems into corrective actions such as task splitting, constraint adjustment, resource replacement, tool switching or manual review.
[0126] (4) The existing complex task solving process lacks the fusion expression of solver feedback and behavior verification results, making it difficult to distinguish different types of problems such as infeasible solution model, abnormal input data, changes in external environment, insufficient permissions, and unmet process requirements.
[0127] (5) The existing system lacks a complete audit chain from task input, solution, verification, self-correction, resolving to final output, making it difficult to trace the source of automated results, the reasons for correction, and the security boundaries.
[0128] (6) Existing solutions are usually designed for a specific domain and are difficult to abstract into a general intelligent agent self-correction framework that can be used in different complex task scenarios.
[0129] Therefore, the present invention mainly solves the following technical problems: (1) Solve the problem that the solver feedback cannot be automatically converted into the agent's corrective actions during the execution of complex tasks.
[0130] (2) Solve the problem that the lack of behavioral constraint verification for intelligent agents' self-correction can easily lead to unauthorized, unexecutable or non-compliant actions.
[0131] (3) Solve the problem that after the candidate solution is verified, it can only be passively prompted for error and cannot automatically enter the controlled correction closed loop.
[0132] (4) Solve the problem of lack of integrated expression of solver feedback, execution log, verification issues, business rules and historical audit information.
[0133] (5) Solve the problem that intelligent agents cannot simultaneously consider automation efficiency, deterministic constraints and human approval boundaries when calling external tools or systems.
[0134] (6) Solve the problems of lack of convergence judgment, transfer to manual conditions and traceable audit chain in the multi-round self-correction process.
[0135] (7) Solve the problem that the self-correction method for complex tasks relies too much on rules of a single domain and is difficult to extend to different task types.
[0136] To address the aforementioned technical problems, this invention proposes a self-correcting agent method based on solver feedback and behavioral constraint verification. The overall technical approach is as follows: After receiving a complex task objective, the agent first converts the task objective, context data, resource status, and constraint rules into a task instance; then, it calls the solver to generate candidate solutions or action sequences; the system extracts solver feedback and checks whether the candidate solutions and action sequences satisfy behavioral constraints through a behavior verifier; the agent generates controlled self-correcting actions based on the solver feedback and behavior verification results, updates the task instance after filtering by an action whitelist, permission boundaries, and hard constraints, and then triggers the next round of solving and verification until it reaches a state of pass, convergence, timeout, no available actions, or requires manual review.
[0137] In one specific embodiment, the method includes the following steps: Step 1: Receive task target and context data.
[0138] The system receives complex task objectives from users, external systems, or upstream processes and obtains contextual data related to those objectives. Contextual data includes resource status, task dependencies, historical execution records, business rules, external interface permissions, data quality status, executed steps, callable tools, solver configuration, and manual approval requirements.
[0139] Step 2: Construct a unified task instance.
[0140] The system transforms task objectives and context data into a unified task instance. This task instance includes at least a set of objectives, input variables, resources, candidate actions, hard constraints, soft objectives, execution boundaries, validation rules, and evaluation metrics. The task instance can be processed by the solver and examined by the behavior validator.
[0141] Step 3: Determine action boundaries and security strategies.
[0142] The system generates an action whitelist, parameter value boundaries, prohibited action set, and conditions for transferring to human intervention based on task type, user permissions, external system status, and business rules. Any subsequent self-correcting actions generated by the agent must not exceed these action boundaries.
[0143] Step 4: Call the solver to generate candidate solutions.
[0144] The system invokes at least one solver to generate candidate solutions based on the task instance. Candidate solutions can be represented as task plans, resource allocation schemes, execution step sequences, configuration parameter sets, path schemes, scheduling results, code modification schemes, data processing flows, or other verifiable outputs. Solvers can be optimization solvers, rule solvers, planners, testers, compilers, simulators, or combinations thereof.
[0145] Step 5: Extract solver feedback and form a feedback vector.
[0146] The system extracts solver feedback from the solver's execution process and candidate solutions, forming a feedback vector F={f1,f2,...,f n Each feedback item f i This includes feedback type, severity level, associated variables, associated resources, associated actions, numerical evidence, error messages, candidate solution quality, conflict constraints, and traceable sources.
[0147] Feedback types include, but are not limited to, infeasibility feedback, timeout feedback, local optimum feedback, constraint conflict feedback, objective function degradation feedback, resource bottleneck feedback, execution failure feedback, input data anomaly feedback, and candidate solution quality inadequate feedback.
[0148] Step 6: Perform behavioral constraint verification.
[0149] The behavior validator reads the task instance, candidate solutions, action sequence, and execution boundary, and performs behavioral constraint verification on them. The verification content includes at least resource mutual exclusion, step dependency, legality of state transition, legality of permissions, order of interface calls, data consistency, security policy, approval status, writable boundaries of external systems, and integrity of audit fields.
[0150] Step 7: Generate verification results and problem status diagram.
[0151] The behavior validator outputs the validation result V={v1,v2,...,v...} m Each verification item v i This includes the problem type, severity level, rule violation, evidence fields, associated objects, whether execution should be blocked, suggested handling direction, and audit requirements. The system further integrates solver feedback and verification results into a problem state diagram, where nodes represent objectives, variables, resources, actions, tools, external interfaces, or approval nodes, and edges represent conflict, dependency, blocking, substitution, or correction relationships.
[0152] Step 8: Generate candidate self-correcting actions by the agent.
[0153] The agent receives a feedback vector F, a verification result V, a problem state graph G, an action boundary B, and historical audit memory M, and maps them to a set of candidate self-correcting actions A={a1,a2,...,a...}.k When generating actions, the agent prioritizes handling hard constraints that create obstacles, and then addresses soft objectives such as insufficient quality, inefficiency, or high cost.
[0154] Candidate self-correcting actions include, but are not limited to: adjusting target weights, supplementing missing inputs, replacing resources, splitting tasks, changing execution order, adding pre-checks, rolling back the previous action, switching to a backup solver, increasing the search time budget, reducing the search space, requesting manual approval, pausing external writes, or generating an interpretation report.
[0155] Step 9: Perform action-level verification on the self-correcting actions.
[0156] The system performs action-level verification on candidate self-correcting actions. If an action is not in the action whitelist, its parameters exceed the boundaries, its calling permissions are insufficient, it may damage the state of external systems, it may violate hard constraints, or it may bypass manual approval, then the action is rejected, downgraded to a suggestion, or transferred to manual review.
[0157] Step 10: Apply the validated action and update the task instance.
[0158] The system applies self-correcting actions, verified at the action level, to task instances instead of directly modifying the external production system. Updated task instances may include new constraint sets, corrected variables, adjusted action candidate sets, updated solver configurations, supplementary input data, locked execution states, or newly added manual review nodes.
[0159] Step 11: Solve again and form a self-correcting closed loop.
[0160] The system calls the solver again based on the updated task instance and repeats the steps of feedback extraction, behavior verification, action generation, and action filtering. This closed loop continues to run until the candidate solution passes behavior verification, all remaining problems are transferred to manual review, the maximum number of iterations is reached, the time budget is met, no self-correcting actions are available, or a blocking problem is detected in the input data.
[0161] Step 12: Output candidate results, explanations, and audit logs.
[0162] When the system receives candidate results that have passed behavioral verification, it generates a result summary, key metrics, a description of the correction process, remaining risks, manual approval items, and traceable audit logs. If a task needs to be published externally or written back to the system, it must go through a publication access control or approval process.
[0163] Step Thirteen: Consolidate historical memories and use them for subsequent tasks.
[0164] The system writes the task objective, input data summary, solver feedback, behavior verification results, self-correcting actions, action filtering results, final status, and manual approval results into the audit chain. The historical audit chain can be used for similar problem retrieval, strategy recommendation, risk warning, and rule optimization in subsequent tasks.
[0165] In some embodiments, the large language model can participate in natural language interpretation, candidate action generation, or policy recommendation, but its output cannot directly modify external systems. All candidate actions must be converted into structured actions and undergo action whitelisting, behavioral constraint verification, and necessary manual approval before they become effective.
[0166] In summary, the present invention has the following technical effects: (1) This invention transforms solver feedback from logs or metrics into a basis for agent self-correction, enabling failure reasons, conflict constraints and resource bottlenecks in complex tasks to automatically drive the next round of correction.
[0167] (2) The present invention embeds behavioral constraint verification into the agent closed loop, so that the candidate solutions and action sequences generated by the agent are protected by resource, permission, process, security and audit constraints before execution.
[0168] (3) This invention avoids the intelligent agent from directly executing free text commands or modifying external systems without authorization by using action whitelists, parameter boundaries and action-level verification.
[0169] (4) The present invention can distinguish different problem types such as infeasibility of solution, abnormal input, resource conflict, insufficient permissions, incomplete process and insufficient result quality, thereby generating more accurate correction actions.
[0170] (5) This invention supports multi-round complex solution and convergence determination, reduces repeated manual trial and error, and improves the success rate and stability of automated processing of complex tasks.
[0171] (6) The present invention forms an audit chain from task input, solution, feedback, verification, correction, re-solution to output, which facilitates post-event traceability, compliance review and strategy optimization.
[0172] (7) This invention is not limited to a specific industry or task form, but can be used as a general intelligent agent safety self-correction framework and applied to different complex task scenarios.
[0173] (8) This invention allows large language models to participate in interpretation and strategy suggestions, but delegates key calculations, behavior verification and action activation to solvers, verifiers and action safety filtering modules respectively, thereby taking into account both generalization ability and engineering reliability.
[0174] The following describes the agent self-correction system based on solver feedback and behavioral constraint verification provided by the present invention. The agent self-correction system based on solver feedback and behavioral constraint verification described below can be referred to in correspondence with the agent self-correction method based on solver feedback and behavioral constraint verification described above.
[0175] Figure 2 This is a schematic diagram of the structure of the agent self-correction system based on solver feedback and behavioral constraint verification provided in an embodiment of the present invention. (Refer to...) Figure 2 This invention provides an agent self-correction system based on solver feedback and behavioral constraint verification. The system is applied to an agent and may specifically include the following modules: Data acquisition module 210 is used to acquire task objectives and context data related to the task objectives, and convert the task objectives and the context data into task instances; The solution feedback extraction module 220 is used to call the solver, perform the solution with the task instance as input, extract solver feedback from the solver operation process when no candidate solution is generated, and extract solver feedback from the solver operation process and the candidate solution when a candidate solution is generated, and generate a feedback vector. The behavior constraint verification module 230 is used to perform behavior constraint verification on the task instance and action boundary when no candidate solution is generated, and to perform behavior constraint verification on the task instance, the candidate solution and action boundary when a candidate solution is generated, so as to obtain the behavior verification result. The self-correction generation module 240 is used to generate candidate self-correction actions based on the feedback vector and the behavior verification result; Action-level verification module 250 is used to perform action-level verification on the candidate self-correcting actions, obtain the verified self-correcting actions, and apply the verified self-correcting actions to the task instance to update the task instance. The iterative solution verification module 260 is used to perform the next round of solution and verification based on the updated task instance until the self-correcting termination condition is met, and obtain the final output result; the final output result is the final candidate solution or termination information.
[0176] This invention unifies task objectives and context data through task instances. A solver uses the task instance as input to solve the problem and extract feedback vectors. A behavior verifier verifies behavioral constraints. An agent generates candidate self-correcting actions based on the feedback vectors and behavior verification results. These candidate actions undergo action-level verification, and the task instance is updated. Finally, the next round of solving and verification is performed based on the updated task instance until the self-correction termination condition is met, yielding the final output. Therefore, this invention achieves an agent self-correction process combining solver feedback and behavior constraint verification. This allows the agent to perform multiple rounds of self-correction under the constraints of deterministic tools and safety boundaries, rather than directly relying on free text reasoning or unconstrained automatic execution. This improves the feasibility, security, and automation of solving complex tasks.
[0177] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute an agent self-correction method based on solver feedback and behavioral constraint verification. This method includes: acquiring a task objective and context data related to the task objective, and converting the task objective and the context data into a task instance; calling a solver to solve the task instance as input; extracting solver feedback from the solver's operation when no candidate solution is generated, and extracting solver feedback from the solver's operation and the candidate solution when a candidate solution is generated, generating a feedback vector; and verifying the task instance and behavioral constraints using a behavior verifier when no candidate solution is generated. The action boundary is subjected to behavioral constraint verification. When generating candidate solutions, behavioral constraint verification is performed on the task instance, the candidate solutions, and the action boundary to obtain behavioral verification results. Based on the feedback vector and the behavioral verification results, candidate self-correcting actions are generated. The candidate self-correcting actions are subjected to action-level verification to obtain verified self-correcting actions, and the verified self-correcting actions are applied to the task instance to update the task instance. The next round of solving and verification is performed based on the updated task instance until the self-correction termination condition is met to obtain the final output result. The final output result is the final candidate solution or termination information.
[0178] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, 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 described in the various embodiments of the present 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.
[0179] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the agent self-correction method based on solver feedback and behavioral constraint verification provided by the above methods. The method includes: acquiring a task objective and context data related to the task objective, and converting the task objective and the context data into a task instance; invoking a solver to solve the problem using the task instance as input; extracting solver feedback from the solver operation process when no candidate solution is generated; and extracting solver feedback from the solver operation process and the candidate solution when a candidate solution is generated. Feedback is generated to form a feedback vector. A behavior validator is used to perform behavior constraint verification on the task instance and action boundaries when no candidate solutions are generated, and to perform behavior constraint verification on the task instance, the candidate solutions, and the action boundaries when candidate solutions are generated, obtaining behavior verification results. Based on the feedback vector and the behavior verification results, candidate self-correcting actions are generated. Action-level verification is performed on the candidate self-correcting actions to obtain verified self-correcting actions, which are then applied to the task instance to update it. The next round of solving and verification is performed based on the updated task instance until the self-correction termination condition is met, obtaining the final output result. The final output result is the final candidate solution or termination information.
[0180] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the agent self-correction method based on solver feedback and behavioral constraint verification provided by the above methods. The method includes: acquiring a task objective and context data related to the task objective, and converting the task objective and the context data into a task instance; invoking a solver to solve the problem using the task instance as input; extracting solver feedback from the solver's operation when no candidate solution is generated, and extracting solver feedback from the solver's operation and the candidate solution when a candidate solution is generated, generating a feedback vector; and verifying the behavior. The algorithm performs behavioral constraint verification on the task instance and action boundary when no candidate solution is generated, and performs behavioral constraint verification on the task instance, the candidate solution, and the action boundary when a candidate solution is generated, to obtain behavioral verification results. Based on the feedback vector and the behavioral verification results, candidate self-correcting actions are generated. The candidate self-correcting actions are verified at the action level to obtain verified self-correcting actions, and the verified self-correcting actions are applied to the task instance to update the task instance. The next round of solving and verification is performed based on the updated task instance until the self-correction termination condition is met, to obtain the final output result. The final output result is the final candidate solution or termination information.
[0181] The device embodiments described above are merely illustrative. 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0182] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0183] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention 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 the present invention.
Claims
1. A self-correcting method for intelligent agents based on solver feedback and behavioral constraint verification, characterized in that, The method is applied to an intelligent agent, including: Obtain the task objective and the context data associated with the task objective, and convert the task objective and the context data into a task instance; The solver is invoked to solve the problem using the task instance as input. When no candidate solution is generated, the solver feedback is extracted from the solver operation process. When a candidate solution is generated, the solver feedback is extracted from the solver operation process and the candidate solution to generate a feedback vector. The behavior validator performs behavior constraint verification on the task instance and action boundary when no candidate solution is generated, and performs behavior constraint verification on the task instance, the candidate solution and action boundary when a candidate solution is generated, to obtain the behavior verification result. Based on the feedback vector and the behavior verification result, candidate self-correcting actions are generated; The candidate self-correcting actions are verified at the action level to obtain verified self-correcting actions, and the verified self-correcting actions are applied to the task instance to update the task instance. The next round of solving and verification is performed based on the updated task instance until the self-correcting termination condition is met, and the final output result is obtained; the final output result is the final candidate solution or termination information.
2. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1, characterized in that, The step of generating candidate self-correcting actions based on the feedback vector and the behavior verification result includes: The feedback vector and the behavior verification result are fused into a problem state diagram; wherein, the nodes of the problem state diagram are used to represent target nodes, variable nodes, resource nodes, action nodes, tool nodes, external interface nodes or approval nodes, and the edges of the problem state diagram are used to represent conflict relationships, dependency relationships, blocking relationships, substitution relationships or correction relationships. Based on the feedback vector, the behavior verification result, the problem state diagram, the action boundary, and the historical audit records, the candidate self-correcting action is generated.
3. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1 or 2, characterized in that, The candidate self-correcting actions include at least one of the following: adjusting target weights, supplementing missing inputs, replacing resources, splitting tasks, changing execution order, adding pre-checks, rolling back the previous action, switching to a backup solver, increasing the search time budget, reducing the search space, requesting manual approval, pausing external writes, and generating an explanation report; the action-level verification of the candidate self-correcting actions includes: If the candidate self-correcting action is not in the action whitelist, the parameters exceed the boundary, the calling permission is insufficient, the external system state is damaged, the hard constraints are violated, or the manual approval is bypassed, then the candidate self-correcting action is rejected or transferred to manual review.
4. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1, characterized in that, After satisfying the self-correcting termination condition and obtaining the final output, the following is also included: Output the final output results, explanatory information, and traceable audit records; The traceable audit records are written into the audit chain; the audit chain is used for similar problem retrieval, strategy recommendation, risk warning and rule optimization for subsequent tasks; The explanatory information includes at least one of the following: result summary, key indicators, correction process description, remaining risks, and manual approval items; the traceable audit record includes at least one of the following: task objective, input data summary, solver feedback, behavior verification results, candidate self-correcting actions, verified self-correcting actions, updated task instance, final status, and manual approval results.
5. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1, characterized in that, The context data includes at least one of the following: resource status, task dependencies, historical execution records, business rules, external interface permissions, data quality status, executed steps, callable tools, solver configuration, and manual approval requirements. The task instance includes at least one of the following: target set, input variables, resource set, candidate action set, hard constraint set, soft target set, execution boundary, verification rule, and evaluation metric.
6. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1, characterized in that, The candidate solution is at least one of the following: task plan, resource allocation scheme, execution step sequence, configuration parameter set, path scheme, scheduling result, code modification scheme, and data processing flow. The solver is at least one of the following: an optimization solver, a rule solver, a planner, a tester, a compiler, and a simulator.
7. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1, characterized in that, Each feedback item in the feedback vector includes at least one of the following: feedback type, severity level, associated variable, associated resource, associated action, numerical evidence, error message, candidate solution quality, conflict constraint, and traceable source. The feedback types include at least one of the following: infeasibility feedback, timeout feedback, local optimum feedback, constraint conflict feedback, objective function degradation feedback, resource bottleneck feedback, execution failure feedback, input data anomaly feedback, and insufficient candidate solution quality feedback.
8. The agent self-correction method based on solver feedback and behavioral constraint verification according to claim 1, characterized in that, The behavioral constraint verification includes at least one of the following: resource mutual exclusion, step dependency, state transition legality, permission legality, interface call order, data consistency, security policy, approval status, external system writable boundary, and audit field integrity. Each verification item in the behavior verification result includes at least one of the following: problem type, severity level, rule violation, evidence field, associated object, whether execution is blocked, suggested handling direction, and audit requirements.
9. A self-correcting agent system based on solver feedback and behavioral constraint verification, characterized in that, The system is applied to intelligent agents and includes: The data acquisition module is used to acquire the task objective and the context data related to the task objective, and to convert the task objective and the context data into a task instance; The solution feedback extraction module is used to call the solver, perform the solution with the task instance as input, extract solver feedback from the solver operation process when no candidate solution is generated, and extract solver feedback from the solver operation process and the candidate solution when a candidate solution is generated, and generate a feedback vector. The behavior constraint verification module is used to perform behavior constraint verification on the task instance and action boundary when no candidate solution is generated, and to perform behavior constraint verification on the task instance, the candidate solution and action boundary when a candidate solution is generated, so as to obtain the behavior verification result. The self-correction generation module is used to generate candidate self-correction actions based on the feedback vector and the behavior verification result; An action-level verification module is used to perform action-level verification on the candidate self-correcting actions, obtain verified self-correcting actions, and apply the verified self-correcting actions to the task instance to update the task instance. The iterative solution verification module is used to perform the next round of solution and verification based on the updated task instance until the self-correcting termination condition is met, and obtain the final output result; the final output result is the final candidate solution or termination information.
10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the agent self-correction method based on solver feedback and behavioral constraint verification as described in any one of claims 1 to 8.
