A Reliable Execution Method and System for Intelligent Agents Based on Semantic Transactions
By dividing the execution operations of the intelligent agent into semantic transaction units and performing confidence assessment and multi-dimensional consistency verification in the exploration, execution, and verification phases, the problems of redundant interference and hidden errors in the intelligent agent system are solved, and the reliability and stability of the execution results are achieved.
Patent Information
- Application Number
- CN202611231559.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-13
- Publication Date
- 2026-11-17
AI Technical Summary
Existing intelligent agent systems lack quantitative assessment of the value of information during the exploration phase in long-term autonomous execution, leading to redundant interference and the propagation of hidden errors. Furthermore, the verification of execution results only focuses on surface compliance, neglecting semantic intent consistency, and the recovery strategy is insufficient.
The execution operations of the intelligent agent are divided into semantic transaction units. Through the exploration, execution and verification phases, the information gain is evaluated using confidence and multi-dimensional consistency verification is performed. Uncommitted intermediate states are revoked to ensure the consistency of the execution results.
It effectively avoids redundant interference, reduces the risk of accumulating hidden errors, improves the reliability and stability of execution results, and ensures the consistency of execution results with task objectives.
Smart Images

Figure CN123114572A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a reliable execution method and system for intelligent agents based on semantic transactions. Background Technology
[0002] As large language models (LLMs) continue to improve their capabilities in natural language understanding, task planning, and code generation, intelligent agent systems based on LLMs are gradually evolving from traditional single-turn question-and-answer models to long-cycle autonomous execution models for complex tasks. In practical applications such as data analysis and software development, intelligent agents can typically automatically plan complex task steps based on user-input goals and autonomously complete long-cycle execution processes by calling external tools, executing code scripts, and accessing underlying data resources.
[0003] However, the aforementioned long-cycle autonomous execution process faces reliability challenges. In existing intelligent agent frameworks, the agent's execution flow typically consists of multiple steps linked together, such as task planning, tool invocation, and code execution, with intermediate results from each step directly passed to subsequent stages. When an error occurs in a step, it propagates downstream along the execution flow, and existing frameworks generally lack the ability to manage and recover from the execution process as a whole. Although some research has attempted to mitigate these issues by introducing methods such as failure retries or state rollbacks, these methods still face the following limitations when dealing with the inherent probabilistic outputs and dynamic interaction uncertainties of large language models.
[0004] On the one hand, existing intelligent agent execution systems lack the ability to quantitatively assess the value of information collected during the exploration phase before the agent enters the execution phase. Every interaction of the agent in a dynamic environment may trigger state changes. When faced with complex environmental feedback, the agent has difficulty judging which exploration information has a substantial contribution to subsequent decisions and which is redundant interference. This leads to meaningless intermediate states being directly substituted into subsequent stages, thereby causing the uncontrollable propagation of hidden errors throughout the workspace.
[0005] On the other hand, current intelligent agent frameworks mainly rely on logical compliance reviews or preset rule matching models when validating results. This type of validation mostly focuses only on the surface execution correctness of a single operation node, ignoring the relationship between the model's internal decision-making process and the overall task objective. This makes it easy for the system to allow execution results that are syntactically and executionally legal, but have deviated from the original task constraints in terms of overall semantic intent.
[0006] Furthermore, existing solutions have significant shortcomings in their recovery strategies when verification fails or execution fails. Current rollback mechanisms are typically limited to undoing externalized operational side effects, such as reversing committed state changes through compensatory operations, which may lead to the same or similar errors occurring again during retries.
[0007] In summary, accurately assessing the information value during the agent exploration phase to avoid redundant interference, and performing multi-dimensional deep consistency verification of execution results to prevent the submission of hidden errors, are pressing technical challenges that need to be addressed in this field. Summary of the Invention
[0008] This application proposes a reliable execution scheme for intelligent agents based on semantic transactions, which can accurately evaluate the information value in the agent exploration phase to avoid redundant interference, and perform multi-dimensional deep consistency verification on the execution results to block the submission of implicit errors.
[0009] According to one aspect of this application, a reliable execution method for an intelligent agent based on semantic transactions is proposed, the method comprising: The execution operations generated by the intelligent agent in response to the target task are divided into semantic transaction units; For each semantic transaction unit, the exploration phase, execution phase, and verification phase are performed sequentially. During the exploration phase, a read-only exploration operation is generated, and the information gain of the current exploration operation is evaluated based on the difference in confidence output by the language model under the first context and the second context. The exploration is then terminated based on the information gain. The first context includes the current exploration result, and the second context includes the current exploration result and the historical exploration result. After the exploration is terminated, the current exploration result and the historical exploration result are used as exploration evidence. In the execution phase, an execution plan is generated and executed based on the exploratory evidence to obtain candidate execution results; During the verification phase, the candidate execution results are verified for consistency from multiple dimensions based on the task objective, execution constraints, and the exploratory evidence. When the verification results of the multiple dimensions all meet the corresponding preset consistency conditions, the candidate execution result is submitted to the target state space. When the verification result of any of the multiple dimensions does not meet the corresponding preset consistency conditions, the uncommitted intermediate state generated by the current semantic transaction unit is revoked, and execution is restarted from the exploration phase.
[0010] According to another aspect of this application, a reliable execution system for intelligent agents based on semantic transactions is proposed, comprising: The transaction partitioning module is used to divide the execution operations generated by the intelligent agent for the target task into semantic transaction units; The semantic transaction execution module is used to sequentially perform an exploration phase, an execution phase, and a verification phase for each semantic transaction unit. In the exploration phase, a read-only exploration operation is generated, and the information gain of the current exploration operation is evaluated based on the difference in confidence levels output by the language model under a first context and a second context. The module then determines whether to terminate the exploration based on the information gain. The first context includes the current exploration result, and the second context includes the current exploration result and historical exploration results. After terminating the exploration, the current exploration result and the historical exploration result are used as exploration evidence. In the execution phase, an execution plan is generated and executed based on the exploration evidence to obtain candidate execution results. In the verification phase, the candidate execution results are verified for consistency from multiple dimensions based on the task objective, execution constraints, and the exploration evidence. The transaction commit module is used to commit the candidate execution result to the target state space when the verification results of the multiple dimensions all meet the corresponding preset consistency conditions, and to cancel the uncommitted intermediate state generated by the current semantic transaction unit and trigger the semantic transaction execution module to re-execute from the exploration phase when the verification result of any of the multiple dimensions does not meet the corresponding preset consistency conditions.
[0011] The semantic transaction-based intelligent agent reliable execution scheme proposed in this application divides the execution operations generated by the intelligent agent for the target task into semantic transaction units, and sequentially performs exploration, execution, and verification phases, thereby achieving standardized control over the agent's unstructured interaction behavior. Based on this, in the exploration phase, read-only exploration operations are generated, and the information gain of the current exploration operation is evaluated based on the difference between the confidence scores of a first context containing only the current exploration result and a second context superimposed with historical exploration results to determine whether to terminate the exploration, overcoming the context redundancy defect caused by invalid probing during agent execution. Furthermore, in the verification phase, candidate execution results are verified for consistency from multiple dimensions based on task objectives, execution constraints, and exploration evidence. If any dimension fails to meet the standard, the unsubmitted intermediate state is revoked and execution is restarted from the exploration phase, significantly reducing the risk of accumulating erroneous states caused by probabilistic biases and avoiding the recurrence of the same or similar errors during retries.
[0012] Other features and advantages of the technical solution proposed in this application are described below. Attached Figure Description
[0013] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this specification and, together with the description, serve to explain the principles of this specification.
[0014] Figure 1A flowchart illustrating a reliable execution method for an intelligent agent based on semantic transactions, provided as an embodiment of this application; Figure 2 A schematic diagram of the architecture of a reliable execution system for an intelligent agent based on semantic transactions is provided for an exemplary embodiment of this application; Figure 3 A schematic diagram of a confidence-guided exploration and consistency verification mechanism provided for an exemplary embodiment of this application; Figure 4 A schematic diagram of the hardware structure of an electronic device provided in at least one embodiment of this application. Detailed Implementation
[0015] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0016] This application addresses the problems faced by intelligent agent systems based on large language models during the execution of complex tasks, such as unrecoverable intermediate states, inconsistencies between execution results and task objectives, semantic conflicts during multi-agent parallelism, and long-term loss of execution states. It proposes a reliable execution scheme for intelligent agents based on semantic transactions. According to the proposed scheme, the execution operation of the intelligent agent is divided into semantic transaction units. Each semantic transaction unit undergoes three phases: exploration, execution, and verification. Through confidence-guided exploration termination judgment and multi-dimensional consistency verification, the consistency between the execution result and the task objective is guaranteed. If verification fails, uncommitted intermediate states are revoked and re-executed, thus providing the intelligent agent system with reliability guarantees similar to those of database transaction standards.
[0017] Please refer to Figure 1 , Figure 1 This is a flowchart illustrating a reliable execution method for an intelligent agent based on semantic transactions, provided in one embodiment of this application. The method described in this embodiment can be applied to an intelligent agent system based on a Large Language Model (LLM). This system can receive task requests from users and autonomously complete target tasks by calling external tools, executing code, accessing data resources, and updating the workspace. The method includes the following steps S1 to S5.
[0018] Step S1: Divide the execution operations generated by the intelligent agent for the target task into semantic transaction units.
[0019] During the execution of a target task, an intelligent agent can generate various types of execution operations, including model inference, tool invocation, code execution, data processing, and workspace modification. According to this application, the system can organize a group of semantically related operations into a manageable transactional execution unit, called a semantic transaction unit. Each semantic transaction unit corresponds to a complete "exploration-execution-verification" closed loop. The division of semantic transaction units is not pre-defined according to fixed task sub-goals or operation types, but is dynamically determined based on the closed loop in the agent's execution trajectory. The transaction granularity can be adjusted based on task complexity, execution risk, verification cost, and model confidence. For example, steps with high execution risk can be broken down into multiple fine-grained transaction units; for continuous operation phases with high confidence, multiple operations can be merged into a larger-grained transaction unit.
[0020] Step S2: For each semantic transaction unit, an exploration phase is performed. In the exploration phase, a read-only exploration operation is generated, and the information gain of the current exploration operation is evaluated based on the difference in confidence output by the language model under the first context and the second context. The exploration is then terminated based on the information gain. The first context includes the current exploration result, and the second context includes the current exploration result and the historical exploration result. After the exploration is terminated, the current exploration result and the historical exploration result are used as exploration evidence.
[0021] The exploration phase is used to accumulate sufficient evidence to support the subsequent execution phase. In this phase, the agent can generate read-only exploration operations based on the task description, the current semantic state, and historical exploration summaries. Read-only exploration operations refer to operations that only acquire information without modifying the external state. The agent can obtain data, environmental information, and candidate evidence related to the task objective by executing these read-only exploration operations. The read-only nature of these exploration operations can be ensured by limiting the set of tools that can be invoked during the exploration phase and by restricting the process's ability to write to files through file permissions.
[0022] After obtaining the exploration results, the system can evaluate the information gain of the current exploration operation. In this application, information gain refers to the contribution of the current exploration operation to subsequent decision-making by comparing the difference in confidence levels of the language model outputs in the first and second contexts.
[0023] In some implementations, the confidence score of the language model output is the exponent of the average log probabilities at the word level in the target output sequence. Specifically, for a target output sequence containing T words generated by the language model during autoregressive generation, the system can obtain the log probability value of each word, i.e., the log likelihood value assigned to that word by the language model. The system can sum the log probabilities of the T words and divide by T to obtain the average log probability, and then take the exponentiation of this average to obtain the confidence score of the language model output. According to this implementation, the probability information at the word level is aggregated into a sequence-level confidence score measure, which can be used to quantify the degree of confidence of the model in a specific output sequence. This confidence score calculation method can be used in both the exploration and verification phases of this application.
[0024] The system can construct two contexts: the first context contains only the results of the current exploration, and the second context overlays historical exploration results onto the first context. The system can calculate the output confidence of the language model in both contexts and determine whether the current exploration operation has brought effective new information based on the difference in confidence between the two contexts. When the confidence difference exceeds a preset confidence difference threshold, it indicates a significant difference between the model output based solely on the current exploration results and the model output after overlaying historical exploration results. This means the marginal information gain of the current exploration results is low, and the new exploration has not brought effective new information; in this case, the exploration can be terminated. When the confidence difference does not exceed the preset confidence difference threshold, the next round of exploration can continue. This confidence difference threshold can be set according to task requirements.
[0025] After exploration terminates, the system can solidify valid exploration evidence into the current semantic transaction context for use in subsequent execution phases. This exploration evidence may include runtime feedback generated by executed code, test results, documentation information, external knowledge retrieval results, historical task execution records, and other intermediate results generated by agents.
[0026] Step S3: Perform an execution phase for each semantic transaction unit. In the execution phase, generate an execution plan based on the exploratory evidence and execute it to obtain candidate execution results.
[0027] After accumulating evidence during the exploration phase, the agent can proceed to the execution phase. In this phase, the agent can generate an execution plan based on the exploratory evidence and perform operations such as code generation, tool invocation, data processing, or external resource access, producing candidate execution results. These candidate execution results remain in an unsubmitted state until they pass the subsequent verification phase.
[0028] Step S4: Perform a verification phase for each semantic transaction unit. In the verification phase, based on the task objective, execution constraints, and the exploration evidence, verify the consistency of the candidate execution results from multiple dimensions.
[0029] The goal of the validation phase is to verify whether the candidate execution results are consistent with the task objectives, execution constraints, and supporting evidence obtained in the exploration phase. The system can validate candidate execution results from multiple dimensions.
[0030] The multiple dimensions may include some or all of the following dimensions: execution error dimension, decision consistency dimension, code consistency dimension, and reflection feedback dimension.
[0031] Consistency verification of the candidate execution results from the perspective of execution errors may include: detecting tool call failures, code execution exceptions, and resource access errors; Verifying the consistency of the candidate execution results from the perspective of decision consistency may include: calculating the confidence level of the candidate decision formed in the exploration phase and the confidence level of the actual decision adopted in the execution phase output by the language model under the exploration evidence, respectively; when the difference between the confidence levels of the two exceeds the corresponding preset decision consistency threshold, it is determined that there is a risk of inconsistency in the actual decision. Verifying the consistency of the candidate execution results from the code consistency dimension may include: performing static code analysis on the generated code to identify key code segments; calculating the generation confidence of the language model for the key code segments in a first code context and a second code context, respectively; and determining a code confidence deviation index based on the difference in generation confidence in the two code contexts. The first code context includes the task instructions and the code preceding the key code segment; the second code context superimposes the exploratory evidence on top of the first code context; and when the code confidence deviation index exceeds the corresponding preset code consistency threshold, it is determined that there is a risk of inconsistency between the behavior of the key code segment and the task objective. Consistency verification of the candidate execution results from the reflection and feedback dimension may include: using the language model to reflect on and analyze the execution process and candidate execution results of the execution phase, and identifying potential semantic deviations in the candidate execution results.
[0032] The system can aggregate verification results from multiple dimensions and determine whether candidate execution results pass consistency verification based on whether each dimension meets the corresponding consistency conditions. The consistency conditions for each dimension can be preset according to task requirements.
[0033] Step S5: When the verification results of the multiple dimensions all meet the corresponding preset consistency conditions, the candidate execution result is submitted to the target state space; when the verification result of any of the multiple dimensions does not meet the corresponding preset consistency conditions, the uncommitted intermediate state generated by the current semantic transaction unit is revoked, and execution is restarted from the exploration phase.
[0034] When the verification results across multiple dimensions all meet their respective preset consistency conditions, the system can determine that the candidate execution result has passed the consistency verification and then submit the state update generated by the current semantic transaction unit to the target state space. The target state space refers to the external environment state operated by the agent when executing the task, and may include the file system, database, workspace, etc. After submission, the execution result of this semantic transaction unit becomes the system's confirmed state, which can be used by subsequent semantic transaction units or other agents.
[0035] When the verification result of any of the multiple dimensions fails to meet its corresponding preset consistency condition, the system can revoke the uncommitted intermediate state generated by the current semantic transaction unit. The uncommitted intermediate state refers to a temporary modification generated during the execution of the semantic transaction unit but not yet passed consistency verification. The system can isolate the failed execution context and use the verification result of that dimension as constraint information to re-execute the current semantic transaction unit from the exploration phase. This constraint information can be used to mark known error patterns and exclude previously failed decision paths during re-execution, thereby guiding subsequent exploration and execution to avoid repeatedly entering the same failure path. In one example, each semantic transaction unit may allow, for example, two retries. When the preset retry threshold is reached, if an execution result that meets the consistency condition is still not obtained, the system can generate corresponding termination status information and perform subsequent processing. This subsequent processing may include: returning the task incomplete status and failure reason information to the user; outputting the current optimal candidate execution result; outputting the exploration trajectory, verification feedback, and failure reason analysis during the execution process; requesting the user to provide supplementary constraints or manual confirmation; transferring the task to other agents for further processing; and / or adjusting the execution strategy and reinitializing the execution environment.
[0036] In some implementations, the method further includes: executing multiple independent proxy runs for the same task request, obtaining the task score corresponding to each execution, calculating the task score variance based on the task scores of the multiple executions; evaluating the output behavior stability of the language model based on the task score variance, and adjusting the invocation strategy, prompting strategy, or skill selection strategy of the language model based on the stability evaluation results.
[0037] The system can evaluate the stability of the language model's output behavior through multiple independent executions. Specifically, the system can execute multiple independent proxy runs for the same task request, for example, five independent runs, and obtain the task score for each run. The task score is a comprehensive score obtained after quantitatively evaluating the result of a single proxy run based on dimensions such as task completion and execution result correctness. It can be determined based on indicators such as task decision consistency, code generation consistency, tool call path consistency, execution result consistency, and the degree to which the task objective is met. The system can calculate the task score variance based on the task scores from multiple executions. The smaller the task score variance, the higher the consistency of the proxy's execution results under the same task conditions. When the task score variance exceeds a preset task deviation threshold, the system can adjust the language model's calling strategy, prompting strategy, or skill selection strategy based on the stability evaluation results. For example, it can lower the language model's sampling temperature to reduce output randomness, increase constraints in prompts to narrow the output range, or switch to a more stable skill object, thereby improving the proxy's execution stability in long-cycle tasks.
[0038] This application also provides a reliable execution system for intelligent agents based on semantic transactions. This system may include a transaction partitioning module, a semantic transaction execution module, and a transaction commit module. The transaction partitioning module can be used to divide the execution operations generated by the intelligent agent for a target task into semantic transaction units. The semantic transaction execution module can be used to sequentially perform an exploration phase, an execution phase, and a verification phase for each semantic transaction unit. The transaction commit module can be used to decide whether to commit or revoke the current semantic transaction unit based on the verification result of the verification phase. The transaction partitioning module passes the partitioned semantic transaction units to the semantic transaction execution module. After completing the exploration, execution, and verification, the semantic transaction execution module passes the verification result to the transaction commit module. If the verification fails, the transaction commit module can trigger the semantic transaction execution module to re-execute from the exploration phase.
[0039] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the architecture of a semantic transaction-based intelligent agent reliable execution system provided as an exemplary embodiment of this application. This example system... Figure 1 Building upon the method shown, further extended capabilities such as skill reuse, multi-agent isolation, operation-level isolation, and semantic memory persistence are provided.
[0040] Figure 2The right side illustrates the internal flow of the atomic semantic transaction unit. The execution phase of the semantic transaction unit includes two stages: code generation and code execution (appending to files). After execution, a re-execution judgment can be initiated. The "Confidence-Guided Data Exploration" area within the atomic semantic transaction unit demonstrates the exploration phase flow. The agent can acquire exploration evidence through operations such as generating code, executing code (read-only files), and obtaining observation results. Based on the language model, it outputs a confidence score P_LLM(exploration|evidence) to determine whether the exploration is redundant. When the confidence score is high, the exploration is terminated and the evidence is solidified. The "Confidence-Based Semantic Consistency Detection" area within the atomic semantic transaction unit demonstrates the verification phase flow. The system can verify decision consistency by extracting decisions in a structured manner and comparing confidence differences, and verify code consistency by analyzing key logic fragments of the generated code and comparing confidence differences. After successful verification, candidate execution results can be submitted; if verification fails, re-execution with feedback can be performed. The detailed flows of the exploration and verification phases described above will be discussed later. Figure 3 Further explanation.
[0041] The following are Figure 2 The expansion capabilities of each module shown are introduced.
[0042] like Figure 2 As shown in the "Collecting Code Repositories / Papers / Execution Processes" and "Test-Driven Skill Construction" sections of the Security Skill Library module, the security skill library can encapsulate historical semantic transaction execution trajectories that meet preset consistency conditions into skill objects. Each skill object is a reusable execution unit formed by structurally encapsulating a verified proxy execution process. The historical semantic transaction execution trajectory may include information such as task description, proxy decision-making process, tool call sequence, code execution process, and execution verification results. The encapsulated skill object may include tool call interface, execution process description, input / output parameter configuration, semantic verification rules, state recovery strategy, and rollback or compensation strategy. By encapsulating verified execution processes into skill objects, when encountering similar tasks subsequently, the skill object can be directly invoked to execute the corresponding semantic transaction unit, thereby improving execution consistency and reducing the overhead of repeated exploration.
[0043] When a skill object matching the target task exists, the system can... Figure 2The system selects skills through "load and data feature-aware skill routing." The skill routing process can be divided into three stages. In the skill feature extraction stage, the system obtains the applicable task type, tool dependencies, resource requirements, and historical execution results for each candidate skill object. In the task matching stage, the system calculates the matching degree between the target task and multiple candidate skill objects based on the target task's task semantics, workload status, and data features. It then selects the target skill object whose matching degree meets preset skill matching conditions and executes the corresponding semantic transaction unit by calling the target skill object. The task semantics refer to the structured features extracted after semantic parsing of the task description, such as task type, operation objects, and constraints. The matching degree can be calculated based on dimensions such as task semantic similarity, workload matching degree, and data feature adaptability. Workload status can include task type, task complexity, and resource consumption, while data features can include data size, data structure, and data access patterns.
[0044] The system can dynamically adjust the selection weights of the candidate skills based on the results of historical transaction executions. These historical transaction results may include information such as skill execution feedback and verification results. Through this dynamic adjustment, the skill routing strategy can be continuously optimized as execution experience accumulates.
[0045] During skill execution, the execution state can be managed through idempotency flags, operation logs, checkpoints, and automatic compensation. Idempotency flags can be used to identify duplicate execution requests, preventing the same operation from being executed multiple times. Operation logs can record state changes before and after execution, providing a basis for rollback. Checkpoints can save recoverable execution states, restoring to the most recent checkpoint in the event of execution failure. Automatic compensation can restore the state of external resources in the event of execution failure. These methods prevent unrecoverable states from arising in the event of execution failure or abnormal situations.
[0046] like Figure 2 As shown in the "Intelligent Agent Generation Tool and Semantic Dependency Aware Isolation Optimization" module, when multiple sub-agents execute in parallel for a target task, the system can select different isolation modes based on the task dependency relationships between the sub-agents. Figure 2 The text indicates three execution modes: independent execution, collaborative execution, and competitive execution.
[0047] In independent execution mode, different sub-agents can access isolated sets of resources and execute their respective subtasks in parallel. Sub-agents do not share intermediate state in this mode. This mode is suitable for scenarios where there are no resource dependencies between subtasks.
[0048] In collaborative execution mode, different sub-agents can execute corresponding subtasks in their respective independent working branches and merge execution results through structured information exchange. Each independent working branch refers to an independent execution environment copy allocated to each sub-agent, with the states of each branch isolated from each other. Each sub-agent can exchange structured context information based on a preset synchronization period or event-triggered conditions. This structured context information can be used to describe intermediate states and stage results during agent execution, and may include subtask execution status, completed operation records, modification information of target resources, intermediate generated content or candidate results, resource dependencies, semantic reasoning context information, version identifiers, and change metadata, etc. The structured context information can be represented using predefined data structures or a hybrid form combining natural language descriptions and structured metadata.
[0049] When multiple sub-agents modify shared resources based on different work branches, the system can obtain the change records of each independent work branch and detect resource modification conflicts based on one or more of the following: resource identifier conflict detection, operation type conflict detection, version dependency conflict detection, and semantic consistency conflict detection. Resource identifier conflict detection determines whether multiple sub-agents have modified the same resource object, such as the same code file, the same data record, or the same semantic memory entry. Operation type conflict detection determines whether there is a mutually exclusive relationship between different modification operations, such as one sub-agent deleting a resource while another sub-agent modifies it. Version dependency conflict detection can determine whether multiple modifications are based on different states, using resource version numbers, modification timestamps, or change chains. Semantic consistency conflict detection uses semantic analysis models to determine whether multiple modifications express contradictory goals or logic.
[0050] When multiple sub-agents are detected making conflicting modifications to the same resource, the system can determine the final version based on a preset merging strategy. For example, it can select the target modification result based on the sub-agent's task priority, or based on the modification confidence level, or retain the latest modification based on the resource version's age, or submit multiple modification results to an arbitration agent or language model for semantic consistency judgment, or generate conflict records awaiting manual confirmation for conflicts that cannot be automatically merged. After merging, the system can generate a new target working state and synchronize the merging result to the relevant sub-agents or subsequent execution stages.
[0051] In competitive execution mode, multiple sub-agents can execute different candidate solutions in an isolated environment, and the system can select the execution result that meets the preset winning criteria from multiple execution results. This mode is suitable for scenarios where there are multiple feasible execution paths and a best-of-breed selection is required.
[0052] In addition to the agent-level isolation mentioned above, the system can also implement operation-level isolation during the execution of semantic transaction units to prevent a single failed operation from affecting the shared state. Operation-level isolation can be achieved through access control, versioned workspace management, snapshot execution, optimistic validation, and effect annotation.
[0053] Access control achieves isolation by restricting the scope of resource access for operations. Versioned workspace management maintains independent workspace versions for different operations or agents, ensuring that modifications to each operation are isolated from each other before commit. Snapshot execution saves a snapshot of the current state before operation execution and restores to the snapshot state if the operation fails. Optimistic validation allows operations to be executed first, and checks for conflicts with other operations upon commit; if a conflict exists, the execution is rolled back.
[0054] Effect annotation can be divided into two categories: expected effect annotation information and actual effect annotation information. For each operation during the execution of the semantic transaction unit, expected effect annotation information describing the expected scope of impact of the operation can be generated before each operation is executed, based on the operation definition and parameters. Expected effect annotation information may include read, modify, create, delete, call, or other state changes that may occur to data resources, system states, external services, file resources, or other accessible objects. For each operation during the execution of the semantic transaction unit, actual effect annotation information describing the actual impact of the operation can be generated based on the actual execution results after each operation is executed.
[0055] Before each operation is executed, the expected effect annotation information can be compared with the isolation conditions of the current execution environment (such as permission constraints, resource access policies, etc.) to determine whether the operation matches the current isolation policy. If they do not match, the execution of the operation can be restricted or adjusted. After each operation is executed, the actual effect annotation information can be compared with the expected effect annotation information. When the actual impact exceeds the expected impact range described by the expected effect annotation information, isolation processing is triggered.
[0056] like Figure 2 As shown in the "Persistent Semantic Transaction State Management" module, the system can use a graph structure to persistently save the valid state during the agent execution process. Figure 2The "contextual memory (graph structure)" uses semantic memory entries as nodes and semantic associations, temporal associations, entity associations, and causal associations as edges, recording the specific attributes of each entry through key-value fields. The semantic memory entries are structured memory units generated during agent execution and may contain task status, execution results, key evidence, and / or decision-making basis. Among the four edge types, semantic associations represent semantic similarity relationships between entries, temporal associations represent temporal sequence relationships between entries, entity associations represent common entity reference relationships between entries, and causal associations represent causal reasoning relationships between entries. The system can persistently save the above information generated during agent execution through this graph structure.
[0057] Figure 2 The "memory update operation" can dynamically update the graph structure through four operations: insertion, merging, splitting, and deletion. The insertion operation extracts new semantic memory entries from the agent's original execution trajectory and adds them as new nodes to the graph structure, or updates the descriptions of existing nodes. The merging operation aggregates multiple semantic memory entries that revolve around the same object and have semantic associations and overlapping information into a single comprehensive entry. For example, during the execution of a data processing task, the agent may generate multiple semantic memory entries regarding missing values in a data file, consecutive null values in a field, and the failure of subsequent calculations due to these missing values. When the system determines that these entries all revolve around the same data object and have overlapping content, they can be merged into a single comprehensive entry. The splitting operation decomposes semantic memory entries containing multiple semantic contents that can be independently represented or changed into multiple fine-grained entries, making the semantic boundaries of each entry clearer. For example, when a semantic memory entry records both the data acquisition method and the data quality assessment conclusion, the system can split it into two entries describing the data acquisition method and the data quality assessment conclusion, so that subsequent tasks can independently reference or update them as needed. The deletion operation can identify semantic memory entries that have become invalid or replaced due to changes in task status and remove them from the graph structure.
[0058] The system can also use an append-only workspace to save operation records during agent execution. Figure 2 The "Append File Workspace" can record language model interaction records, tool call records, file change records, and execution version information. When a task fails, the system can restore the execution environment corresponding to the failed task based on the above records, thereby supporting the re-execution of the task.
[0059] Please refer to Figure 3 , Figure 3 A schematic diagram of a confidence-guided exploration and consistency verification mechanism provided for an exemplary embodiment of this application.
[0060] Figure 3The left half details the process of an exemplary exploration phase. The agent can generate read-only exploration operations based on the task description, the current semantic state, and historical exploration summaries. These read-only exploration operations may include generating code, executing the code as a read-only file, and obtaining observations as the results of this exploration. The system can update the exploration semantic state based on these results and evaluate the information gain of the current exploration operation.
[0061] like Figure 3 As shown, information gain is evaluated by comparing the difference in confidence levels of the language model output under two contexts. The system can construct a first context and a second context: the first context contains only the results of the current exploration, while the second context superimposes historical exploration results onto the first context. The system can obtain the confidence levels of the language model's output under the two contexts and calculate the difference in confidence levels.
[0062] If the confidence difference does not exceed the preset confidence difference threshold, the next round of exploration can continue, and the system can continue to accumulate exploration evidence. If the confidence difference exceeds the preset confidence difference threshold, it indicates that the new exploration operation has not produced effective information gain, and the system can terminate further exploration. After exploration is terminated, if... Figure 3 As shown, the system can solidify valid exploration evidence into the current semantic transaction context. The confidence difference threshold for exploration termination can be set, for example, to 0.30–0.70, with a typical value of, for example, 0.45. The exploration round budget can be set, for example, to 1–8 rounds, with a typical value of, for example, 1–4 rounds. In some implementations, as the task progresses, the upper limit of the exploration rounds for subsequent semantic transaction units can be gradually reduced, for example, by decreasing in a linear decay manner, but at least one exploration round is retained.
[0063] Figure 3 The right half shows the process of verifying the consistency of candidate execution results from four dimensions during the verification phase.
[0064] The following combination Figure 3 The right half of the process explains the verification methods for each of the four dimensions.
[0065] exist Figure 3 In "Dimension 1: Execution Error Verification," the system can detect whether tool call failures, code execution exceptions, and resource access errors have occurred during the execution phase. This dimension of verification targets explicit errors at the execution level and does not involve confidence calculation.
[0066] like Figure 3As shown in "Dimension Two: Decision Consistency Verification" and its subsequent "Detailed Decision Consistency Verification" process, the system can compare the degree of consistency between candidate decisions formed during the exploration phase and the actual decisions adopted during the execution phase. The candidate decisions refer to the set of decision schemes formed during the exploration phase based on the exploration results, while the actual decisions refer to the decisions actually adopted during the execution phase. Specifically, the system can extract candidate decisions from the execution trajectory of the exploration phase and actual decisions from the execution trajectory of the execution phase. Given a task description and exploration evidence as context, the system can calculate the confidence scores of the language model outputting candidate decisions and the actual decisions, respectively. When the confidence score of the actual decision is significantly lower than that of the candidate decision, it indicates that the actual decision lacks sufficient support under the current exploration evidence. When the difference in confidence scores exceeds a preset decision consistency threshold, the system can determine that there is a risk of inconsistency in the actual decision. The preset decision consistency threshold can be set, for example, from 0.10 to 0.40, with a typical value of, for example, 0.25.
[0067] like Figure 3 As shown in "Dimension Three: Code Consistency Verification" and its subsequent "Code Consistency Verification Refinement" process, the system can analyze key code snippets in the generated code to determine whether the code behavior is consistent with the task objective. Specifically, the system can perform static code analysis on the generated code to identify key code snippets. These key code snippets may include conditional branch statements, loop control structures, function call paths, data flow propagation paths, access operations to external resources, and state modification operations, etc.
[0068] For the identified key code snippets, the system can calculate the generation confidence of the language model for the key code snippet in a first code context and a second code context, respectively. The first code context may include the task instructions and the code preceding the key code snippet, while the second code context can be built upon the first code context with additional exploratory evidence.
[0069] The system can calculate the generation confidence of key code snippets under two different code contexts and determine a code confidence deviation index based on the difference between the two. This code confidence deviation index reflects whether code generation relies on the support of exploratory evidence. When there is a significant difference in generation confidence under the two code contexts, it indicates that exploratory evidence has significantly influenced the generation of the key code snippet, and the behavior of the code snippet may lack sufficient evidence support. When the code confidence deviation index exceeds a preset code consistency threshold, the system can determine that there is a risk of inconsistency between the behavior of the key code snippet and the task objective. The preset code consistency threshold can be set, for example, to 0.30–0.70, with a typical value of, for example, 0.50.
[0070] like Figure 3As shown in "Dimension Four: Reflective Feedback Validation," the system can use a language model to reflect on and analyze the execution process and candidate execution results during the execution phase, identifying potential semantic biases in the candidate results. In addition to using the language model itself for reflective analysis, an independent validation model can also be used to cross-validate the execution results.
[0071] The system can aggregate the verification results from multiple dimensions. When the verification result of any dimension fails to meet the corresponding preset consistency condition, the system can revert the uncommitted intermediate state generated by the current semantic transaction unit and re-execute from the exploration phase with feedback. When the verification results of each dimension meet the corresponding preset consistency condition, the system can submit the candidate execution result to the target state space.
[0072] The following example, based on an environmental data analysis task, illustrates the complete execution process of this application.
[0073] The user inputs a task into the intelligent agent system: "Calculate the Pearson correlation coefficient between rainfall over the past 3 days and Enterococcus pollution levels in the Boston Harbor Beach community, where over 90% of the population has an environmentally conscious population."
[0074] After receiving the task, the system can identify the data source, analysis objective, calculation indicators and constraints involved in the task, and generate the corresponding task semantic state.
[0075] The system can divide the execution operations of this task into semantic transaction units. In this example, the semantic transaction unit corresponding to this task may include data query, data cleaning, indicator calculation, and result verification, and the transaction state is initialized to uncommitted.
[0076] Upon entering the exploration phase, the agent can generate read-only query code to query monitoring data for the target beach, obtain historical rainfall data, and aggregate pollution indicators. These operations are executed in read-only mode, and the results are saved to a temporary exploration space. The system can construct a first context and a second context, calculate the output confidence of the language model for each, and evaluate the information gain of the current exploration operation based on the confidence difference. When the confidence difference exceeds a preset confidence difference threshold, the system can terminate the exploration and solidify the valid exploration evidence into the current semantic transaction context.
[0077] Once the execution phase begins, the agent can generate an execution plan based on the explored evidence, execute code for data cleaning and Pearson correlation coefficient calculation, and produce candidate execution results.
[0078] Once in the verification phase, the system can verify the consistency of candidate execution results from multiple dimensions. From the perspective of execution errors, the system can detect whether anomalies occur during data querying and code execution. From the perspective of decision consistency, the system can compare whether the decisions made in the exploration phase and the execution phase are consistent. For example, in the exploration phase, the agent may discover two data aggregation methods: one is to aggregate data from multiple monitoring locations into daily averages and then calculate the correlation coefficient; the other is to directly calculate using location-date as an independent observation sample. The system can compare the confidence differences between the two aggregation decisions under the same task description and exploratory evidence to determine whether the aggregation method used in the execution phase has sufficient evidence to support it. From the perspective of code consistency, the system can identify key code snippets in the generated code to determine whether the data selection conditions, aggregation logic, and calculation methods are consistent with the task objectives. From the perspective of reflection and feedback, the system can use a language model to reflect on and analyze the execution process and calculation results to identify potential semantic biases.
[0079] When the verification results of each dimension meet the corresponding preset consistency conditions, the system can submit the candidate execution results to the target state space, update the semantic memory, write the results to the append-only workspace, and save the execution trajectory. The transaction state changes from uncommitted to committed. If, during the verification process, it is detected that a candidate execution result does not meet the corresponding consistency condition in a certain dimension, such as finding that the currently selected data aggregation method lacks supporting evidence, the system can revoke the uncommitted intermediate state generated by the current semantic transaction unit, clear the failed execution context, retain the historical successful transaction state, and re-execute from the exploration phase using the detection feedback as constraint information.
[0080] Figure 4 An electronic device provided in at least one embodiment of this application includes a memory and a processor. The memory is used to store computer instructions that can be executed on the processor. The processor is used to implement the semantic transaction-based intelligent agent reliable execution method described in any embodiment or implementation of this application when executing the computer instructions.
[0081] At least one embodiment of this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the semantic transaction-based intelligent agent reliable execution method described in any embodiment or implementation of this application.
[0082] This application achieves transactional management of the intelligent agent's execution process by dividing the execution operations of the intelligent agent into semantic transaction units and sequentially exploring, executing, and verifying each semantic transaction unit. The confidence-guided exploration termination judgment reduces invalid exploration and accumulates sufficient evidence to support subsequent executions. Consistency verification from four dimensions—execution errors, decision consistency, code consistency, and reflective feedback—can detect potential semantic deviations before the execution result is submitted. Combined with extended capabilities such as skill reuse, multi-agent isolation, operation-level isolation, and semantic memory persistence, this application improves the execution reliability and state recoverability of the intelligent agent system in complex task scenarios.
[0083] Those skilled in the art will understand that the embodiments of this application can be provided as methods, systems, electronic devices, or computer program products, and can be implemented in a completely hardware, completely software, or a combination of hardware and software. The embodiments in this specification are described in a progressive manner, and identical or similar parts can be referred to mutually.
[0084] The processing flow and logical sequence depicted in the accompanying drawings are not necessarily required to be executed in the specific order or sequence shown. Where there is no conflict, the operation steps may be executed in a different order than that shown in the embodiments, or parallel processing may be used to achieve the desired result. Furthermore, the separation of the various system modules and components described above should not be construed as requiring such separation in all embodiments; the described program components and systems can typically be integrated into a single software or hardware product.
[0085] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.
Claims
1. A method for reliable execution of intelligent agents based on semantic transactions, characterized in that, The method includes: The execution operations generated by the intelligent agent in response to the target task are divided into semantic transaction units; For each semantic transaction unit, the exploration phase, execution phase, and verification phase are performed sequentially. During the exploration phase, a read-only exploration operation is generated, and the information gain of the current exploration operation is evaluated based on the difference in confidence output by the language model under the first context and the second context. The exploration is then terminated based on the information gain. The first context includes the current exploration result, and the second context includes the current exploration result and the historical exploration result. After the exploration is terminated, the current exploration result and the historical exploration result are used as exploration evidence. In the execution phase, an execution plan is generated and executed based on the exploratory evidence to obtain candidate execution results; During the verification phase, the candidate execution results are verified for consistency from multiple dimensions based on the task objective, execution constraints, and the exploratory evidence. When the verification results of the multiple dimensions all meet the corresponding preset consistency conditions, the candidate execution result is submitted to the target state space. When the verification result of any of the multiple dimensions does not meet the corresponding preset consistency conditions, the uncommitted intermediate state generated by the current semantic transaction unit is revoked, and execution is restarted from the exploration phase.
2. The method of claim 1, wherein, The confidence score of the language model output is the exponent of the average log probability of each word in the target output sequence.
3. The method of claim 1, wherein, Determining whether to terminate the exploration based on the information gain includes: The exploration is terminated when the difference in confidence level between the language model output in the first context and the second context exceeds a preset confidence difference threshold.
4. The method of claim 1, wherein, The multiple dimensions include some or all of the following: execution error dimension, decision consistency dimension, code consistency dimension, and reflection feedback dimension, wherein: Consistency verification of the candidate execution results from the perspective of execution errors includes: detecting tool call failures, code execution exceptions, and resource access errors; Verifying the consistency of the candidate execution results from the perspective of decision consistency includes: calculating the confidence level of the candidate decision formed in the exploration phase and the confidence level of the actual decision adopted in the execution phase output by the language model under the exploration evidence; when the difference between the two confidence levels exceeds a preset decision consistency threshold, it is determined that there is a risk of inconsistency in the actual decision. The consistency verification of the candidate execution results from the code consistency dimension includes: performing static code analysis on the generated code to identify key code segments; calculating the generation confidence of the language model for the key code segments in a first code context and a second code context, respectively; and determining a code confidence deviation index based on the difference in generation confidence in the two code contexts. The first code context includes the task instructions and the code preceding the key code segment; the second code context superimposes the exploratory evidence on the basis of the first code context; and when the code confidence deviation index exceeds a preset code consistency threshold, it is determined that there is a risk of inconsistency between the behavior of the key code segment and the task objective. Consistency verification of the candidate execution results from the reflection and feedback dimension includes: using the language model to reflect on and analyze the execution process and candidate execution results of the execution phase, and identifying potential semantic deviations in the candidate execution results.
5. The method according to claim 1, characterized in that, The method further includes: The historical semantic transaction execution trajectory that meets the preset consistency conditions is encapsulated as a skill object. The historical semantic transaction execution trajectory includes task description, agent decision-making process, tool call sequence, code execution process and execution verification result. The skill object includes tool call interface, execution flow description, input and output parameter configuration, semantic verification rules and state recovery strategy. When a skill object that matches the target task exists, the matching degree between the target task and multiple candidate skill objects is calculated based on the task semantics, workload status and data characteristics of the target task. The target skill object whose matching degree meets the preset skill matching conditions is selected, and the corresponding semantic transaction unit is executed by calling the target skill object. The selection weight of the candidate skill object is dynamically adjusted based on the historical transaction execution results.
6. The method according to claim 1, characterized in that, When multiple sub-agents execute the target task in parallel, an isolation mode is selected based on the task dependencies between the sub-agents. The isolation modes include: Independent execution mode allows different sub-agents to access isolated sets of resources and execute their respective subtasks in parallel; The collaborative execution mode enables different sub-agents to execute corresponding sub-tasks in independent work branches and merge execution results through structured information exchange. Each sub-agent exchanges structured context information based on a preset synchronization period or event triggering conditions. The structured context information includes the sub-task execution status, modification information of the target resource, resource dependencies, and version identifiers. When multiple sub-agents modify shared resources, they obtain the change records of each independent work branch and detect resource modification conflicts based on at least one of the following methods: resource identifier conflict detection, operation type conflict detection, version dependency conflict detection, and semantic consistency conflict detection. The competitive execution mode allows multiple sub-agents to execute different candidate solutions in an isolated environment and select the execution result that meets the preset winning conditions.
7. The method according to claim 1, characterized in that, During the execution of the semantic transaction unit, operation-level isolation is achieved through at least one of the following methods: Access control, versioned workspace management, snapshot execution, optimistic validation, and effect annotation; The effect annotation includes: for each operation in the execution process of the semantic transaction unit, before each operation is executed, generating expected effect annotation information describing the expected impact range of the operation based on the operation definition and operation parameters; after each operation is executed, generating actual effect annotation information describing the actual impact of the operation based on the actual execution result; before each operation is executed, determining whether the operation matches the current isolation strategy based on the expected effect annotation information and the isolation conditions of the current execution environment, and restricting or adjusting the execution of the operation if they do not match; after each operation is executed, comparing the actual effect annotation information with the expected effect annotation information, and triggering isolation processing when the actual impact exceeds the expected impact range described by the expected effect annotation information.
8. The method according to claim 1, characterized in that, The method further includes: A graph structure is adopted, with semantic memory entries as nodes and semantic associations, temporal associations, entity associations, and causal associations as edges. The semantic memory entries are used to store the task status, execution results, key evidence, and / or decision-making basis during the agent execution process, and the graph structure is dynamically updated through the following operations: The insertion operation extracts new semantic memory entries from the execution trajectory and adds them to the graph structure; The merging operation aggregates multiple semantic memory entries that revolve around the same object and have semantic associations and information overlap into a single comprehensive entry; The splitting operation decomposes semantic memory entries containing multiple semantic contents that can be independently represented into multiple fine-grained entries; The deletion operation removes semantic memory entries that have become invalid or been replaced due to changes in task status.
9. The method according to claim 1, characterized in that, The method further includes: For the same task request, execute multiple independent agent runs, obtain the task score corresponding to each execution, and calculate the task score variance based on the task scores of multiple executions; The stability of the language model's output behavior is evaluated based on the variance of the task score, and the invocation strategy, prompting strategy, and / or skill selection strategy of the language model are adjusted based on the stability evaluation results.
10. A reliable execution system for intelligent agents based on semantic transactions, characterized in that, include: The transaction partitioning module is used to divide the execution operations generated by the intelligent agent for the target task into semantic transaction units; The semantic transaction execution module is used to sequentially perform an exploration phase, an execution phase, and a verification phase for each semantic transaction unit. In the exploration phase, a read-only exploration operation is generated, and the information gain of the current exploration operation is evaluated based on the difference in confidence levels output by the language model under a first context and a second context. The module then determines whether to terminate the exploration based on the information gain. The first context includes the current exploration result, and the second context includes the current exploration result and historical exploration results. After terminating the exploration, the current exploration result and the historical exploration result are used as exploration evidence. In the execution phase, an execution plan is generated and executed based on the exploration evidence to obtain candidate execution results. In the verification phase, the candidate execution results are verified for consistency from multiple dimensions based on the task objective, execution constraints, and the exploration evidence. The transaction commit module is used to commit the candidate execution result to the target state space when the verification results of the multiple dimensions all meet the corresponding preset consistency conditions, and to cancel the uncommitted intermediate state generated by the current semantic transaction unit and trigger the semantic transaction execution module to re-execute from the exploration phase when the verification result of any of the multiple dimensions does not meet the corresponding preset consistency conditions.
