Agent trajectory-oriented key root cause positioning method and device

CN122965681APending Publication Date: 2026-10-23TSINGHUA UNIVERSITY +1
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

[0005]本申请提供一种面向智能体轨迹的关键根因定位方法和装置,用以解决现有技术中的上述缺陷,从长时程智能体轨迹中准确确定真正导致任务最终失败的关键根因轨迹步骤

Benefits of technology

[0020]本申请还提供一种非暂态计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述任一种所述面向智能体轨迹的关键根因定位方法。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122965681A_ABST
    Figure CN122965681A_ABST
Patent Text Reader

Abstract

The application relates to the field of artificial intelligence, and provides an intelligent agent trajectory-oriented key root cause positioning method and device. The intelligent agent trajectory-oriented key root cause positioning method comprises the following steps: obtaining an execution instruction of a target task and a failure trajectory of an intelligent agent executing the target task; for each trajectory step in the failure trajectory, performing compression processing on the trajectory step and each historical trajectory step before the trajectory step in different granularities according to time distances of the trajectory step, to generate a multi-granularity trajectory representation of the trajectory step; and determining a key root cause trajectory step causing the final failure of the target task in the failure trajectory based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory. The application can accurately determine the key root cause trajectory step that truly causes the final failure of the task from a long-term intelligent agent trajectory.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence technology, and in particular to a method and apparatus for locating the key root causes of intelligent agent trajectories. Background Technology

[0002] With the widespread application of large language model-driven agents in complex task scenarios, agent trajectories, as the core carrier recording the entire process of planning, reasoning, tool invocation, and environmental observation, have become a crucial basis for task failure analysis. In the process of agents executing long-cycle, multi-stage complex tasks, once a task failure occurs, accurately locating the critical root cause—that is, identifying the key root cause trajectory steps directly leading to the final task failure—is a core prerequisite for achieving agent capability iteration and fault repair. More specifically, the critical root cause trajectory step can be understood as the earliest erroneous step that can be transformed into a success if, while keeping the previous trajectory unchanged, the erroneous behavior in that step is replaced with the correct behavior and subsequent trajectories are allowed to unfold correctly.

[0003] Currently, there are three main root cause localization techniques in the industry: the first is the direct suggestion method, which relies on the native understanding capabilities of large models to directly identify errors in trajectory steps; the second is the error classification or task constraint-based method, which first identifies candidate error steps through preset rules and then completes the screening based on task boundary constraints; the third is the causal structure or counterfactual attribution method, which traces the root cause of errors by modeling the dependencies between steps and conducting counterfactual inference. However, due to the difficulty in detecting errors in long-term trajectories, when the trajectory contains dozens or even hundreds of time-series steps, there is a high probability of missed and false positives in error identification. In addition, actual failed trajectories often contain multiple local errors, and existing technologies cannot accurately screen out the key steps that are truly directly responsible for the final task failure from among numerous local errors.

[0004] Therefore, how to accurately determine the key root cause trajectory steps that truly lead to the ultimate failure of a task from the trajectory of a long-term intelligent agent is a technical problem that urgently needs to be solved. Summary of the Invention

[0005] This application provides a method and apparatus for locating the critical root cause of an agent's trajectory, in order to overcome the above-mentioned deficiencies in the prior art and accurately determine the critical root cause trajectory steps that truly lead to the ultimate failure of a task from a long-term agent trajectory.

[0006] This application provides a key root cause localization method for intelligent agent trajectories, comprising the following steps.

[0007] The process involves obtaining the execution instructions for the target task and the failure trajectory of the agent executing the target task. The failure trajectory is the task execution trajectory where the final state fails to achieve the target specified by the execution instructions. The failure trajectory includes multiple trajectory steps generated by the agent during the execution of the target task, arranged in chronological order. For each trajectory step in the failure trajectory, the trajectory step and all previous historical trajectory steps are compressed at different granularities according to their time distance from the trajectory step, generating a multi-granularity trajectory representation of the trajectory step. Based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, the critical root cause trajectory step in the failure trajectory is determined. The critical root cause trajectory step is the earliest erroneous trajectory step that caused the target task to ultimately fail, and whose erroneous behavior, if replaced with correct behavior, could turn the target task from failure to success.

[0008] According to the critical root cause localization method for agent trajectories provided in this application, for each trajectory step in the failed trajectory, the trajectory step and each historical trajectory step preceding the trajectory step are compressed at different granularities according to their time distance from the trajectory step to generate a multi-granularity trajectory representation of the trajectory step. This includes: for each trajectory step in the failed trajectory, performing the following operations to obtain the multi-granularity trajectory representation of the trajectory step: performing high-detail compression on the trajectory step and historical trajectory steps within a first preset number of steps from the trajectory step to obtain a first sub-trajectory; performing medium-detail compression on historical trajectory steps within a second preset number of steps from the trajectory step to obtain a second sub-trajectory; performing low-detail compression on historical trajectory steps beyond a second preset number of steps from the trajectory step to obtain a third sub-trajectory; and obtaining the multi-granularity trajectory representation of the trajectory step based on the first sub-trajectory, the second sub-trajectory, and the third sub-trajectory.

[0009] According to the critical root cause localization method for agent trajectories provided in this application, the high-detail trajectory representation includes the execution instructions, execution actions, reasoning content, and environmental observation results corresponding to the trajectory steps; the medium-detail trajectory representation includes a summary of the main intentions, execution actions, and state changes corresponding to the trajectory steps; the low-detail trajectory representation includes the coarse-grained execution progress of the target task, important entities, and unresolved task commitments or erroneous commitments; wherein, the important entities are core objects, states, or constraints that have a key impact on subsequent reasoning and decision-making during task execution; wherein, the task commitment is a goal, constraint, or expected state that the agent confirms needs to follow or achieve based on current reasoning in the trajectory steps; wherein, the erroneous commitment is a goal, constraint, or expected state that the agent confirms based on erroneous reasoning or erroneous observation in the trajectory steps and that conflicts with the facts or execution instructions.

[0010] According to the critical root cause localization method for intelligent agent trajectories provided in this application, the step of determining the critical root cause trajectory steps in the failed trajectory based on the multi-granularity trajectory representation of each trajectory step in the failed trajectory includes: determining whether each trajectory step in the failed trajectory has an erroneous commitment that conflicts with a reference object based on the multi-granularity trajectory representation of each trajectory step in the failed trajectory; obtaining error triggering events based on the trajectory steps with erroneous commitments that conflict with the reference object; wherein, the error triggering event includes its corresponding trajectory step, as well as the erroneous commitment and violated reference content in the trajectory step; the violated reference content is a specific textual description, data, or factual statement that can serve as clear evidence of conflict with the erroneous commitment in the trajectory step; aggregating error triggering events corresponding to the same reference object into at least one error instance; wherein, the error instance represents an error process that persists around the same reference object; and determining the critical root cause trajectory steps in the failed trajectory that lead to the final failure of the task based on the at least one error instance.

[0011] According to the key root cause localization method for intelligent agent trajectory provided in this application, the reference objects include specific constraints in the executed instructions, observation results or established facts in the historical trajectory steps, internal statements in the trajectory steps, and external environment return results or environmental states.

[0012] According to the critical root cause localization method for agent trajectories provided in this application, the step of determining the critical root cause trajectory in the failure trajectory that leads to the final failure of the task based on the at least one error instance includes: determining the resolution status of the erroneous commitment in each error instance; determining the final footprint of each error instance; wherein the final footprint is a result feature caused by the erroneous commitment in the error instance and can still be observed at the end of the target task; determining the error state of each error instance based on the resolution status and the final footprint of each error instance; determining whether each error instance has global relevance based on the error state of each error instance; selecting error instances with global relevance as candidate error instances; and performing causal attribution based on the candidate error instances to determine the critical root cause trajectory in the failure trajectory that leads to the final failure of the task.

[0013] According to the critical root cause localization method for agent trajectories provided in this application, determining the resolution status of erroneous commitments in each error instance includes: obtaining the reference object corresponding to the error instance; checking whether there are trajectory steps that revisit the reference object in all trajectory steps after the erroneous commitment of the error instance appears in the failed trajectory; if there are trajectory steps that revisit the reference object and the erroneous commitment is corrected, determining that the error instance is in a resolved state; if there are no trajectory steps that revisit the reference object, or if there are trajectory steps that revisit the reference object but the erroneous commitment is not corrected, determining that the error instance is in an unresolved state.

[0014] According to the critical root cause localization method for agent trajectories provided in this application, determining the final footprint of each error instance includes: if the erroneous commitment in the error instance causes an irreversible state change in the execution result of the target task, determining that the error instance has a first final footprint; if the erroneous commitment of the error instance continues to exist in the subsequent trajectory steps of the failed trajectory or the final execution result of the target task, determining that the error instance has a second final footprint; if the error instance has budget debt, determining that the error instance has a third final footprint; wherein, the budget debt indicates that when the erroneous commitment in the error instance is resolved, in the trajectory steps corresponding to the error instance, the number of trajectory steps from the moment the erroneous commitment appears to the moment the erroneous commitment is resolved exceeds a preset proportion of the total length of the failed trajectory.

[0015] According to the critical root cause localization method for agent trajectory provided in this application, the error state of each error instance is determined based on the resolution state and final footprint of each error instance, including: if the error instance is in a resolved state and the error instance has a third final footprint, the error instance is determined to be in a high-cost resolution state; if the error instance is in an unresolved state and the error instance has a first final footprint or a second final footprint, the error instance is determined to be in an active state.

[0016] According to the critical root cause localization method for agent trajectory provided in this application, the step of determining whether each error instance has global relevance based on the error state of each error instance includes: for each error instance, if the error state of the error instance is a high-cost resolution state or an explicit activity state, determining that the error instance has global relevance.

[0017] According to the critical root cause localization method for agent trajectories provided in this application, the step of determining the critical root cause trajectory leading to the final failure of the task based on the candidate error instances includes: constructing a causal attribution input for each candidate error instance; wherein the causal attribution input includes: the starting trajectory step where the error commitment of the candidate error instance first appears in the failure trajectory, the error state of the candidate error instance being a high-cost resolution state or an explicit activity state, and the error commitment and violated reference content corresponding to the candidate error instance; providing the causal attribution input to a causal attribution model, so that the causal attribution model performs causal attribution analysis for the failure trajectory, and determines the target error instance leading to the final failure of the target task from the candidate error instances; and determining the starting trajectory step corresponding to the target error instance as the critical root cause trajectory step leading to the final failure of the target task.

[0018] This application also provides a key root cause localization device for intelligent agent trajectories, comprising: An acquisition module is used to acquire the execution instructions of the target task and the failure trajectory of the agent executing the target task; wherein, the failure trajectory is the task execution trajectory in which the final state fails to achieve the target specified by the execution instructions, and the failure trajectory includes multiple trajectory steps arranged in chronological order generated by the agent during the execution of the target task; a generation module is used to, for each trajectory step in the failure trajectory, compress the trajectory step and each historical trajectory step preceding the trajectory step according to different granularities based on the time distance from the trajectory step, to generate a multi-granularity trajectory representation of the trajectory step; a determination module is used to, based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, determine the critical root cause trajectory step in the failure trajectory; wherein, the critical root cause trajectory step is the earliest erroneous trajectory step that caused the target task to fail in the end, and whose erroneous behavior can be replaced with correct behavior to turn the target task from failure to success.

[0019] This application 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 key root cause localization method for intelligent agent trajectory as described above.

[0020] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the key root cause localization method for agent trajectory as described above.

[0021] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the key root cause localization method for agent trajectory as described above.

[0022] The critical root cause localization method and apparatus for agent trajectories provided in this application, after acquiring the execution instructions of the target task and the failed trajectory of the agent executing the target task, compresses each trajectory step in the failed trajectory and all previous historical trajectory steps at different granularities according to their time distance from the trajectory step, generating a multi-granularity trajectory representation of the trajectory step. By adopting a multi-granularity trajectory representation, the problem of scattered evidence for judging errors in long-term agent trajectories can be effectively solved. This allows for the acquisition of sufficient local evidence and the association with long-distance contextual information when detecting the current trajectory step, thereby transforming the complex overall trajectory error judgment into a local conflict check based on clear evidence, significantly improving the accuracy and efficiency of detecting local errors in long-term agent trajectories. Attached Figure Description

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

[0024] Figure 1 This is a flowchart illustrating the key root cause localization method for intelligent agent trajectories provided in this application.

[0025] Figure 2 This is a flowchart illustrating the method provided in this application for determining the key root cause trajectory steps in the failure trajectory that lead to the final failure of the target task based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory.

[0026] Figure 3 This is a flowchart illustrating the method provided in this application for determining the key root cause trajectory that leads to the eventual failure of a task based on at least one error instance in the failure trajectory.

[0027] Figure 4 This is a schematic diagram of the process of the key root cause localization method for intelligent agent trajectory provided in this application.

[0028] Figure 5 This is a schematic diagram of the error lifecycle analysis of the software engineering failure trajectory provided in this application.

[0029] Figure 6 This is a schematic diagram of the structure of the key root cause localization device for intelligent agent trajectory provided in this application.

[0030] Figure 7 This is a schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation

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

[0032] The following is combined Figures 1 to 4 This application describes the key root cause localization method for agent trajectories.

[0033] Figure 1 This is a flowchart illustrating the key root cause localization method for intelligent agent trajectories provided in this application. Figure 1 As shown, the method includes the following: Step 101: Obtain the execution instructions of the target task and the failure trajectory of the agent in executing the target task.

[0034] In the specific implementation process, the execution instructions used by the intelligent agent to perform the target task are obtained, as well as the failure trajectory formed by the intelligent agent in the process of performing the target task.

[0035] A failure trajectory is a task execution trajectory in which the final state fails to achieve the goal specified by the execution instruction. For example, when a task instruction requires an agent to purchase a specified item on a simulated shopping website, but the agent ultimately fails to place an order or purchases the wrong item, this complete execution process constitutes a failure trajectory.

[0036] As an example only, the failure trajectory can be represented as: ; in, Let N represent the t-th trajectory step in the agent's trajectory. The trajectory step includes the agent's reasoning, action, or environmental response; N represents the total number of trajectory steps included in the agent's trajectory.

[0037] A failure trajectory comprises multiple time-sequential steps generated by the agent during the execution of a target task. Each trajectory step may include the agent's reasoning, planning, actions, tool calls, tool returns, or environmental responses.

[0038] This application locates the key root cause based on the execution instructions and failure trajectory, without needing to obtain the success trajectory or the standard execution trajectory of the target task.

[0039] Step 102: For each trajectory step in the failed trajectory, compress the trajectory step and all historical trajectory steps preceding it according to the time distance from the trajectory step, and generate a multi-granularity trajectory representation of the trajectory step.

[0040] In the specific implementation process, for each trajectory step in the failed trajectory, the following operation is performed to obtain a multi-granularity trajectory representation of the trajectory step: The trajectory steps and historical trajectory steps with distance trajectory steps within a first preset number of steps are processed with high detail preservation to obtain the first sub-trajectory; the historical trajectory steps with distance trajectory steps greater than the first preset number of steps but within the second preset number of steps are processed with medium detail compression to obtain the second sub-trajectory; the historical trajectory steps with distance trajectory steps exceeding the second preset number of steps are processed with low detail compression to obtain the third sub-trajectory; based on the first sub-trajectory, the second sub-trajectory, and the third sub-trajectory, a multi-granularity trajectory representation of the trajectory steps is obtained.

[0041] In practice, the specific values ​​for the first and second preset steps can be set based on experience or experimental results. For example, the first preset step count can be set to 2 steps, and the second preset step count can be set to 5 steps.

[0042] High-detail trajectory representations include the execution instructions, actions, inference content, and environmental observations corresponding to each trajectory step. For example, for the trajectory step currently being analyzed, the high-detail trajectory representation will fully preserve the agent's original inference text, the specific APIs called and their parameters, and the original response data returned by the environment in that step.

[0043] Medium-detail trajectory representations include a summary of the main intent, actions performed, and state changes corresponding to each trajectory step. For example, for a historical step that is far from the current step, its content can be summarized as "The agent attempted to solve the network connectivity problem by modifying configuration file A, but the operation failed."

[0044] Low-detail trajectory representation includes coarse-grained execution progress of the target task, important entities, and unresolved or erroneous task commitments.

[0045] Important entities are core objects, states, or constraints that have a critical impact on subsequent reasoning and decision-making during task execution. For example, in a file editing task, a specific filename or code function name is an important entity. Task commitments are goals, constraints, or expected states that an agent confirms based on current reasoning during a trajectory step, and that these must be followed or achieved. For example, the agent might decide in a step, "The next step is to check the log file to locate the error."

[0046] An erroneous commitment is a goal, constraint, or expected state that an agent recognizes during a trajectory step based on erroneous reasoning or observation, which conflicts with the facts or execution instructions. For example, an agent might mistakenly believe that "file B is read-only" and abandon its plan to modify the file based on this erroneous cognition.

[0047] In the specific implementation process, the length settings of each sub-trajectory are shown in Table 1 below.

[0048] Table 1. Parameters for representing multi-granularity trajectories Trajectory representation Maximum length Retained content High-detail trajectory representation Three thousand characters Original instructions, actions, observations, and related local reasoning. Medium detail trajectory representation 1200 characters Main intention, actions performed, and state changes Low-detail trajectory representation 600 characters Coarse-grained progress, key entities and unresolved commitments In this embodiment of the application, through the above-mentioned multi-granularity compression processing, while retaining complete evidence near the current trajectory step, the compressed trajectory representation can retain long-distance task constraints, environmental observations, task progress and unresolved issues, thereby reducing the impact of long trajectories on error detection.

[0049] Step 103: Based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, determine the key root cause trajectory steps in the failure trajectory.

[0050] The critical root cause trajectory step is the earliest erroneous trajectory step that leads to the ultimate failure of the target task, and can be transformed from failure to success by replacing its erroneous behavior with the correct behavior.

[0051] In practice, the key root cause trajectory steps that lead to the final failure of the target task can be determined in various ways based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, without being limited by the description in this specification.

[0052] For an example of identifying the key root cause trajectory steps in the failure trajectory that ultimately lead to the failure of the target task based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, see [link to example]. Figure 2 The relevant content will not be repeated here.

[0053] In practice, the above steps can be performed in various ways, such as using the large language model Qwen3-235B-A22B-Thinking and setting the model temperature to zero.

[0054] In this embodiment of the application, after obtaining the execution instructions of the target task and the failed trajectory of the agent executing the target task, for each trajectory step in the failed trajectory, the trajectory step and each historical trajectory step before the trajectory step are compressed at different granularities according to the time distance from the trajectory step to generate a multi-granularity trajectory representation of the trajectory step.

[0055] By employing multi-granularity trajectory representation, the problem of scattered evidence for judging errors in long-term agent trajectories can be effectively addressed: high-detail processing of historical trajectory steps closer to the current trajectory step preserves detailed information for local evidence verification; simultaneously, medium- or low-detail compression of distant historical trajectory steps preserves long-distance task constraints, environmental observations, task progress, and unresolved issues. This approach allows for the acquisition of sufficient local evidence while also connecting to distant contextual information when detecting the current trajectory step. This transforms complex overall trajectory error judgment into local conflict verification based on explicit evidence, significantly improving the accuracy and efficiency of detecting local errors in long-term agent trajectories.

[0056] Figure 2 This is a flowchart illustrating the method provided in this application for determining the key root cause trajectory steps in the failure trajectory that lead to the final failure of the target task, based on multi-granularity trajectory representation of each trajectory step in the failure trajectory. Figure 2 As shown, the method includes the following: Step 201: Based on the multi-granularity trajectory representation of each trajectory step in the failed trajectory, determine whether there are any erroneous commitments in each trajectory step of the failed trajectory that conflict with the reference object.

[0057] In the specific implementation process, based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, error trigger detection is performed on each trajectory step in sequence according to the order of steps in the failure trajectory. For the trajectory step currently being checked, based on its multi-granularity trajectory representation, it is determined whether there are any erroneous commitments in the trajectory step that conflict with task instructions, historical trajectories, environmental feedback, or the internal content of the current trajectory step.

[0058] Step 202: Based on the trajectory steps of the erroneous commitment that conflicts with the reference object, obtain the error triggering event.

[0059] Error-triggered events include their corresponding trajectory steps, as well as the erroneous commitments and violated references within those trajectory steps. Violated references are specific textual statements, data, or factual statements that can serve as clear evidence of a conflict with the erroneous commitments in the trajectory steps. For example, regarding the erroneous commitment to modify a prohibited file, the violated reference is the explicit textual constraint in the task instruction: "This file must not be modified."

[0060] The violated reference content can come from: task instructions; historical trajectories preceding the current trajectory step; feedback returned by the agent when calling tools or the environment; and the current trajectory step itself.

[0061] Based on the source of the violated reference content, error-triggered events can be categorized into reference categories as shown in Table 2 below.

[0062] Table 2 Reference Categories of Error Triggering Events Reference Category The source of the violated reference content illustrate Mission Conflict Task Instructions The current step violates task requirements or task constraints. Historical Conflicts Previous trajectory or environmental feedback The current step conflicts with the tool output, environmental feedback, or established facts. Internal conflict of steps Current step The different statements in the current step are contradictory. Environmental anomalies External environment The agent's actions are reasonable, but the environment returns abnormal results. Reference objects include specific constraints in the execution instructions, observations or established facts in the historical trajectory steps, internal statements in the trajectory steps, and results or environmental states returned by the external environment. For example, when an agent repeats a modification that has been proven invalid in a subsequent step, its reference object is the observation in the historical trajectory that records the invalidity of the modification.

[0063] In the specific implementation process, when it is determined that there is an erroneous commitment in any trajectory step, the erroneous commitment, the violated reference content and its corresponding trajectory step are recorded as an error triggering event.

[0064] Each error-triggered event must meet the condition of verbal evidence, meaning that both the erroneous commitment and the violated reference content can be explicitly cited from the corresponding task instructions, trajectory steps, or environmental feedback. If either the erroneous commitment or the violated reference content cannot be explicitly cited, the corresponding error-triggered event will not be retained.

[0065] For example only, error-triggered events e It can be represented as: ; in, t This indicates the trajectory step where the error-triggered event occurred; c This indicates the reference category whose reference content was violated; p indicates the execution stage corresponding to the error-triggered event. This indicates an incorrect commitment in the current trajectory step; This refers to the violated reference content that conflicts with a false promise.

[0066] Each error-triggered event must satisfy the verbal evidence condition, i.e., erroneous commitment. and the violated reference content All of these can be explicitly referenced from the corresponding task instructions, trajectory steps, or environmental feedback.

[0067] When a wrong promise is made or any item in the referenced content is violated and cannot be explicitly cited, the corresponding error triggering event is not retained.

[0068] The same trajectory step may violate different references simultaneously, or express multiple different erroneous commitments at the same time. Therefore, the same trajectory step can generate multiple error-triggered events.

[0069] Furthermore, based on the location where the erroneous commitment occurs during the agent's execution process, the execution phase corresponding to the erroneous commitment can be divided into the planning phase, reasoning phase, action phase, observation phase, and verification phase.

[0070] The reference category and the violated reference content are used together to determine the reference object on which subsequent error instance aggregation is based, and the execution phase is used to indicate the location where the error occurs during the agent's execution process.

[0071] By simultaneously identifying erroneous commitments and violated references in the current trajectory step, the overall erroneous judgment of a complete failed trajectory can be transformed into a local conflict check based on clear evidence.

[0072] Step 203: Aggregate error triggering events corresponding to the same reference object into at least one error instance; wherein, an error instance represents an error process that persists around the same reference object.

[0073] After detecting multiple error-triggered events, these events are aggregated based on a common reference object violated by all of them. An error instance represents a persistent error process revolving around the same reference object. For example, an agent might formulate an erroneous plan that violates task constraints during the inference phase, execute this erroneous plan during the action phase, and continue to maintain this erroneous plan during the verification phase. Although these errors occur in multiple trajectory steps, they are aggregated into a single error instance because they collectively violate the same task constraint. The starting step of an error instance is the earliest trajectory step among the multiple error-triggered events included in that error instance. Error instance aggregation avoids separately counting repeated occurrences of the same error in different trajectory steps and preserves the initial location of the error.

[0074] As an example only, an error instance can be represented as: ; in, This represents a set of error-triggered events that belong to the same error instance; O This refers to the reference object that is jointly violated by the error-triggered events. The reference object can be a task constraint in the task instruction, an observation in the historical trajectory, or a statement in the current trajectory step.

[0075] When multiple error-triggered events violate the same reference object, and it indicates that the agent continues to uphold the same error commitment, the multiple error-triggered events are aggregated into the same error instance.

[0076] During the error instance aggregation phase, trajectory steps containing error-triggered events are represented using high-detail trajectory representations, while other trajectory steps are represented using low-detail trajectory representations as background context.

[0077] For example, an agent might formulate an erroneous plan that violates task constraints during the inference phase, execute the erroneous plan during the action phase, and continue to maintain the erroneous plan during the verification phase. Although the aforementioned errors occur in multiple trajectory steps, they are aggregated into a single error instance because they collectively violate the same task constraint.

[0078] The starting step of an error instance is the earliest occurrence of the trajectory step among the multiple error-triggered events included in that error instance. By aggregating error instances, we can avoid separately counting the repeated occurrences of the same error in different trajectory steps and retain the position where the error first occurred.

[0079] Step 204: Based on at least one error instance, determine the key root cause trajectory in the failure trajectory that led to the eventual failure of the task.

[0080] In practice, the key root cause trajectory steps that lead to the final failure of the task can be determined in various ways based on at least one error instance, without being limited by the description in this specification.

[0081] For an embodiment of the steps for determining the critical root cause trajectory that led to the eventual failure of the task in the failure trajectory based on at least one error instance, see [link to example]. Figure 3 The relevant content will not be repeated here.

[0082] In practice, the above steps can be performed in various ways, such as using the large language model Qwen3-235B-A22B-Thinking and setting the model temperature to zero.

[0083] In the embodiments provided in this application, based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, it is determined whether there is an erroneous commitment in each trajectory step in the failure trajectory that conflicts with the reference object; based on the trajectory steps that have erroneous commitments that conflict with the reference object, an error triggering event is obtained.

[0084] By employing the above method, this application effectively solves the problem of scattered evidence for erroneous judgments in long-term agent trajectories: by comparing the erroneous commitments in the current trajectory step with the explicit violated reference content, the overall erroneous judgment of a complete failed trajectory can be transformed into a local conflict check based on explicit evidence. Thus, while retaining detailed evidence of the current step, multi-granularity trajectory representation is used to associate contextual information over long distances, significantly improving the accuracy and efficiency of detecting local errors in long-term agent trajectories.

[0085] Error triggering events corresponding to the same reference object are aggregated into at least one error instance. Based on at least one error instance, the key root cause trajectory steps leading to the final failure of the task are determined in the failure trajectory. Through error instance aggregation, this application can uniformly analyze the multiple manifestations of the same error in different trajectory steps and determine the trajectory step in which the error first appears. On this basis, by tracking the resolution status and final footprint of each error instance in subsequent trajectories, it is possible to distinguish between errors that have been fixed, errors that do not affect the final result, and errors related to the final failure. This allows for accurate screening of the key root cause trajectory steps that truly lead to the final failure of the task from multiple local errors, effectively improving the debugging and error correction capabilities of intelligent agent systems in complex long-term tasks.

[0086] Figure 3 This is a flowchart illustrating the method provided in this application for determining the key root cause trajectory that led to the eventual failure of a task based on at least one error instance. Figure 3 As shown, the method includes the following: Step 301: Determine the resolution status of the error commitment in each error instance.

[0087] In the specific implementation process, the resolution status of the error commitment in each error instance is determined by the following methods: In the specific implementation process, for each error instance, the corresponding reference object is obtained. For example, in software engineering, the reference object could be an explicit constraint in the task instruction such as "core files must not be modified." Then, it is checked whether there are any trajectory steps that revisit the reference object in all trajectory steps after the error commitment of the error instance first appears in the failure trajectory. If there is a trajectory step that revisits the reference object, and this trajectory step provides new evidence that can be explicitly cited to replace or correct the original error commitment, then the error instance is determined to be in a resolved state. If there is no trajectory step that revisits the reference object, or although there is a trajectory step that revisits the reference object but the original error commitment has not been corrected, then the error instance is determined to be in an unresolved state.

[0088] Step 302: Determine the final footprint of each error instance.

[0089] The final footprint is a result feature that is still observable at the end of the target task, resulting from a erroneous commitment in an erroneous instance.

[0090] In the specific implementation process, the final footprint of each error instance can be determined in the following ways: If an erroneous commitment in an erroneous instance causes an irreversible change in the execution result of the target task, the erroneous instance is determined to have a first final footprint. If the erroneous commitment of the erroneous instance continues to exist in subsequent trajectory steps of the failed trajectory or in the final execution result of the target task, the erroneous instance is determined to have a second final footprint. If the erroneous instance has budgetary debt, the erroneous instance is determined to have a third final footprint. Here, budgetary debt means that when the erroneous commitment in the erroneous instance is resolved, the number of trajectory steps in the trajectory steps corresponding to the erroneous instance, from the moment the erroneous commitment appears to the moment the erroneous commitment is resolved, exceeds a preset proportion of the total length of the failed trajectory.

[0091] In practical implementation, the final footprint is a result feature caused by a erroneous commitment in an error instance that can still be observed at the end of the target task. If the erroneous commitment in an error instance causes an irreversible state change in the execution result of the target task, then the error instance is determined to have a first final footprint. For example, the agent performs an irreversible operation of submitting an incorrect order. If the erroneous commitment of the error instance continues to exist in subsequent trajectory steps of the failed trajectory or in the final execution result of the target task, then the error instance is determined to have a second final footprint. For example, constraints in the task instructions are still violated in the final state, forming a semantic footprint. If the error instance has budgetary debt, then the error instance is determined to have a third final footprint. Here, budgetary debt means that when the erroneous commitment in the error instance is resolved, the number of trajectory steps from the moment the erroneous commitment appears to the moment the erroneous commitment is corrected exceeds a preset proportion of the total length of the failed trajectory. For example, the steps consumed to correct an early error exceed half of the total trajectory length.

[0092] Step 303: Determine the error status of each error instance based on the resolution status and final footprint of each error instance.

[0093] In the specific implementation process, if the error instance is in a resolved state and has a third endgame footprint, the error instance is determined to be in a high-cost resolution state; if the error instance is in an unresolved state and has a first or second endgame footprint, the error instance is determined to be in an explicit activity state.

[0094] Furthermore, if an error instance is in a resolved state and has no final footprint, it is determined to be in a clean resolved state; if an error instance is in an unresolved state and has no final footprint, it is determined to be in a potentially active state.

[0095] As an example only, the error status of the error instance is shown in Table 3 below.

[0096] Table 3 Error Status of Error Instances Error status Has it been resolved? Does it have a final footprint? Status Description Clean Resolution Status yes no The error was resolved without affecting the final result. Costly Resolution yes yes The error was corrected, but budgetary debt was incurred. Manifest Active state no yes The error remains unresolved, and there are irreversible or semantic footprints. Latent Active state no no The error remains unresolved, but it has no observable impact on the final result. During error state classification, the starting trajectory step corresponding to the error instance, the last trajectory step with an error commitment, and a predetermined number of trajectory steps following the last trajectory step with an error commitment can be represented using high-detail trajectory representations. For the remaining trajectory context in the failed trajectory, based on the input length requirements, a fallback is performed between high-detail trajectory representations, medium-detail trajectory representations, low-detail trajectory representations, and the original trajectory content, and the associated error instance is labeled in the corresponding trajectory step. The sequence of trajectory steps obtained in the above manner is input into the large language model, instructing the large language model to perform error state classification.

[0097] By judging the error resolution status and final footprint, it is possible to effectively distinguish between local errors that have been fixed, local errors that have not been fixed but have not affected the final result, and errors that are still related to the final failure of the task.

[0098] Step 304: Determine whether each error instance has global relevance based on its error status.

[0099] In practice, for each error instance, its global relevance is determined based on its error state. If an error instance is in a high-cost resolution state or an active state, it is considered globally relevant. This is because while high-cost resolution instances are fixed, they consume significant execution budget, indirectly impacting the final task outcome; whereas active state instances directly lead to task failure. Conversely, clean resolution and potentially active state instances do not have an observable impact on the final result and are therefore not globally relevant.

[0100] Step 305: Select error instances with global relevance as candidate error instances.

[0101] As an example only, the set of candidate error instances is represented as follows: ; in, This represents the set of candidate error instances corresponding to the failed trajectory; This represents the error state corresponding to error instance E. Error instances that are in a high-cost resolution state or an active state are added to the candidate error instance set.

[0102] Error instances in the clean resolution state have been resolved and have no impact on the final result, therefore they are not added to the candidate error instance set. Error instances in the potential activity state, although unresolved, have no observable impact on subsequent trajectories or the final result, therefore they are not added to the candidate error instance set.

[0103] Each candidate error instance includes the initial trajectory steps, error state, final footprint, and corresponding supporting evidence.

[0104] Step 306: Perform causal attribution based on candidate error instances to determine the key root cause trajectory in the failure trajectory that led to the final failure of the task.

[0105] In the specific implementation process, all error instances with global relevance are considered as candidate error instances. For each candidate error instance, a causal attribution input is constructed.

[0106] The causal attribution inputs include: the initial trajectory step where the candidate error instance's error commitment first appears in the failure trajectory; the error state of the candidate error instance (high-cost resolution state or explicit activity state); and the corresponding error commitment and violated reference content. These causal attribution inputs are provided to the causal attribution model, enabling it to perform causal attribution analysis on the failure trajectory, compare the roles of different candidate error instances in the task failure process, and identify the target error instance that ultimately led to the failure of the target task. Finally, the initial trajectory step corresponding to the target error instance is determined as the critical root cause trajectory step leading to the final failure of the target task.

[0107] When performing causal attribution, key root cause steps are determined not only based on the chronological order of the occurrence of candidate error instances.

[0108] For example, an earlier, high-cost instance of resolving a state error does not necessarily take precedence over a later, explicit instance of an active state error that has a semantic footprint. Only when the execution budget consumed by the preceding error instance truly makes it impossible for the agent to avoid the subsequent error or complete the task is the preceding error instance identified as the critical root cause.

[0109] During the causal attribution phase, the complete failure trajectory is backtracked between high-detail trajectory representation, medium-detail trajectory representation, low-detail trajectory representation and original trajectory content according to the input length requirements, and an additional 800-character truncation limit is set.

[0110] In practice, the above steps can be performed in various ways, such as using the large language model Qwen3-235B-A22B-Thinking and setting the model temperature to zero.

[0111] In the embodiments provided in this application, by determining the resolution status of the error commitment in each error instance and the final footprint of each error instance, the error status of each error instance can be determined based on the resolution status and the final footprint. This effectively solves the problem of difficulty in distinguishing the impact of multiple local errors in the failure trajectory on the final task result: by determining whether an error instance has been resolved and whether it has a final footprint, error instances can be classified into clean resolution status, high-cost resolution status, explicit activity status, and potential activity status, thereby distinguishing errors that have been fixed and have not affected the final result, errors that have not been fixed but have not had a practical impact, and errors that are still related to the final task failure.

[0112] Based on the error status of each error instance, it is determined whether each error instance has global relevance, and error instances with global relevance are selected as candidate error instances. This method excludes errors that have been fixed or are irrelevant to the final failure, retaining only candidate error instances with end-game relevance. Causal attribution based on these candidate error instances can identify the critical root cause trajectory steps in the failure path that ultimately lead to task failure. Ultimately, it can accurately filter out the critical root cause steps that truly lead to task failure from multiple local errors, rather than simply locating a local error or the earliest occurrence in the failure trajectory. This provides precise guidance for the debugging and optimization of the intelligent agent system, effectively improving the reliability and success rate of the intelligent agent system in handling complex tasks.

[0113] Figure 4 This is a schematic diagram of the process of the key root cause localization method for intelligent agent trajectory provided in this application.

[0114] like Figure 4 As shown, this method acquires a complete record of the agent's task execution, including task instructions, inference process, action execution, and environmental feedback. When the final state fails to meet the task objective, this trajectory is considered a failure trajectory.

[0115] In the multi-granularity trajectory compression process, multi-granularity trajectory compression operations are performed on each trajectory step in the failed trajectory: high detail, retaining the original instructions, actions and local evidence for current step verification; medium / low detail, summarizing the main intent, state changes or coarse-grained progress, to provide background context.

[0116] In the error trigger detection process, the multi-granularity trajectory representation of the trajectory steps is scanned sequentially to look for erroneous commitments and violated reference content. When both the erroneous commitment and the violated content can be found in the task instructions, trajectory steps, tool call results, or environmental feedback, it is considered a valid error trigger event.

[0117] During the error instance aggregation process, multiple error triggering events belonging to the same persistent error are merged. If multiple trajectory steps violate the same reference object, they will be aggregated into a single error instance to preserve the position where the error commitment first occurred and avoid duplicate counting.

[0118] In the error state classification process, the error state of an error instance is determined based on whether the error commitment has been resolved and whether there is an end-game footprint: clean resolution state, high-cost resolution state, explicit activity state, and potential activity state.

[0119] In the root cause localization process, candidate error instances are screened from the set of error instances: error instances in clean resolution states and potentially active states are filtered out, and only errors in high-cost resolution states and explicit active states are retained as candidate error instances; in-depth analysis of the candidate error instances is conducted to obtain the starting steps for the final identified error instances that bear the main responsibility for the task failure.

[0120] Figure 5 This is a schematic diagram of the error lifecycle analysis of the software engineering failure trajectory provided in this application.

[0121] like Figure 5 As shown, the task requires fixing the Boolean value format during the export process of comma-separated value files, changing the capitalized "True" and "False" to lowercase "true" and "false", while the task explicitly requires that the core / serialization.py file must not be modified.

[0122] The failure trajectory comprises multiple steps of reasoning, action, observation, and verification, ultimately resulting in the task failing to meet the task constraints. Multi-granular analysis and processing were performed on this trajectory, identifying three different types of error instances and determining the root cause based on their states.

[0123] Error Instance Analysis and Status Determination Category 1: Instances of internal conflict errors within steps.

[0124] In the first trajectory step, the agent indicates that there are two relevant files, but then lists three files.

[0125] The statement that "two related files exist" in the current trajectory step conflicts with the fact that "three files are listed," therefore, it is determined that there is an internal conflict error triggering event in this trajectory step.

[0126] The reference object for this error-triggered event is the number of related files.

[0127] Subsequent trajectory steps did not rely on the file quantity error, and this error did not leave an observable endgame footprint in subsequent trajectories or the final state.

[0128] Therefore, this error instance is identified as a potential active state and is not added to the candidate error instance set.

[0129] Category 2: Historical conflict errors.

[0130] In the fourth trajectory step, the agent attempts to solve the Boolean output problem by modifying the comma-separated value reference logic.

[0131] In the tenth trajectory step, the agent has obtained historical information that the previous modifications had no effect, but still decides to try the same comma-separated value reference logic modification again.

[0132] In the eleventh trajectory step, the agent performs the corresponding modifications.

[0133] Since the erroneous commitment in the tenth trajectory step conflicts with the invalid modification results already determined in the previous trajectory, the corresponding erroneous triggering event is identified as a historical conflict.

[0134] The tenth and eleventh trajectory steps maintain the same error commitment around the same modification scheme, thus aggregating them into the same error instance.

[0135] This error instance was resolved in the subsequent fifteenth trajectory step and did not leave a final footprint in the final state.

[0136] Therefore, this error instance is determined to be in a clean resolution state and is not added to the candidate error instance set.

[0137] Category 3: Instances of task conflict errors.

[0138] In the twentieth trajectory step, the agent decides to modify the core / serialization.py file to complete the task.

[0139] This modification decision conflicts with the task constraint in the task instruction that "the core / serialization.py file must not be modified".

[0140] Therefore, the modification decision in the twentieth trajectory step is identified as an erroneous commitment, the prohibition on modification in the task instruction is identified as violated reference content, the reference category of the corresponding error-triggered event is identified as a task conflict, and the execution phase is identified as the reasoning phase.

[0141] In the twenty-first trajectory step, the agent actually modified the core / serialization.py file.

[0142] Both the 20th and 21st trajectory steps violate the same reference object as the "core / serialization.py file must not be modified" rule, and respectively represent the formation and execution of an error commitment. Therefore, the error triggering events corresponding to the 20th and 21st trajectory steps are aggregated into a single error instance.

[0143] Even after the failure trajectory ends, the modifications to the core / serialization.py file remain, and the task constraints are still in a state of being violated.

[0144] Therefore, it is determined that the error instance has not been resolved and leaves a semantic footprint of continuous violation of task constraints in the final state. The error instance is identified as an explicit active state and added to the candidate error instance set.

[0145] Based on the above analysis, the error instances were filtered and their causes were attributed: After error state classification, internal conflict error instances are identified as potential active states, and historical conflict error instances are identified as clean resolution states. Neither of them are included in the candidate error instance set.

[0146] Task conflict error instances are identified as having an explicit active state and are added to the candidate error instance set.

[0147] The causal attribution results indicate that the twentieth trajectory step is the step in which the agent first makes an erroneous commitment that violates the task constraints, and the twenty-first trajectory step is the subsequent execution of that erroneous commitment.

[0148] Subsequent modifications to other export functions and compensation measures failed to eliminate the modification of prohibited files, and the task ultimately still violated the task constraints.

[0149] Therefore, the twentieth trajectory step was identified as the key root cause step in the failed trajectory.

[0150] In summary, the embodiments of this application identify multiple local errors in the failure trajectory through error trigger detection, perform unified analysis on the performance of the same error in multiple trajectory steps through error instance aggregation, exclude error instances in potential active states and clean-up resolution states through error state classification, and determine the key root cause steps that lead to the final failure of the task from error instances with end-game relevance.

[0151] The technical effects of the embodiments of this application are explained below with reference to experimental data.

[0152] The embodiments provided in this application evaluate agent trajectories on multiple different domains. The datasets used include WhoAndWhen, AgentDebugBench, and TRAJERRBENCH. The relevant sub-datasets cover task domains such as embodied environment decision-making, open domain information retrieval, web shopping, multi-agent task attribution, customer service tool invocation, and long-term software engineering.

[0153] AgentDebugBench includes three subsets: ALFWorld, GAIA, and WebShop. ALFWorld falls under the embodied intelligence decision-making domain, primarily evaluating an agent's ability to plan, execute actions, and complete environmental tasks in an interactive environment based on task instructions. This subset includes 100 failed trajectories with an average trajectory length of 60.00 steps.

[0154] GAIA (General Information Retrieval and Intelligent Assistant) falls under the open-domain information retrieval and general intelligent assistant task domains, primarily involving agents reasoning about complex problems, retrieving external information, and calling tools to complete tasks. The GAIA subset in AgentDebugBench includes 50 failed trajectories with an average trajectory length of 28.68 steps. WebShop falls under the web interaction and online shopping task domains, mainly evaluating an agent's ability to retrieve, filter, and select products on a simulated shopping website based on user needs.

[0155] This subset includes 50 failed trajectories with an average trajectory length of 51.84 steps. The WhoAndWhen dataset is used to evaluate the agent's ability to attribute task failures, and includes both manually constructed and algorithmically generated subsets. The manually constructed subset includes 58 manually designed failed trajectories, primarily used to simulate the execution process of agent tasks with explicit error propagation relationships, with an average trajectory length of 51.60 steps. The algorithmically generated subset includes 126 failed trajectories generated by algorithms, with related tasks sourced from GAIA and AssistantBench, mainly covering open-domain problem solving and general intelligent assistant tasks, with an average trajectory length of 8.72 steps.

[0156] TRAJERRBENCH includes τ 2 The dataset consists of two subsets: -Bench and SWE-Bench Pro, containing a total of 486 manually labeled failure trajectories. Among them, τ 2 -Bench belongs to the user-facing customer service and tool invocation domain, mainly including multi-turn user interaction scenarios such as aviation services and retail services. In these tasks, the agent needs to collect task information through interaction with users and invoke corresponding tools to complete orders, reservations, or service processing. This subset includes 400 failed trajectories with an average trajectory length of 29.27 steps. SWE-Bench Pro belongs to the long-term software engineering domain, mainly involving agents exploring code repositories, analyzing software problems, modifying code, and performing tests. In these tasks, the agent needs to go through a lengthy process of code retrieval, inference, editing, and verification to complete the software repair task. This subset includes 86 failed trajectories with an average trajectory length of 119.70 steps.

[0157] This experiment uses the accuracy of critical step matching as the evaluation metric. A prediction is considered correct only when the predicted critical error steps perfectly match the manually labeled critical error steps. All methods are evaluated under realistic conditions, meaning only failure trajectories and task failure signals are received; success trajectories, standard task results, or other auxiliary debugging information are not used.

[0158] The experiment compares the embodiments provided in this application with the following two types of methods. The first type is the direct prompting method. Under a unified prompting instruction, the direct prompting method provides the complete failure trajectory to the large language model and requires the large language model to directly determine the key error steps. The experiment uses the following seven large language models to implement the direct prompting method: GLM-5.1; Gemini-3.1-Pro; DeepSeek-V4-Pro; Claude Sonnet 4.6; GPT-5.4; Claude Opus 4.6; and Qwen3-235B-A22B-Thinking. The second type is the multi-agent diagnostic method, including AgentDebugger, CHIEF, and AgentRX. AgentDebugger prompts the judgment model based on an error classification system at the execution stage level and outputs structured diagnostic results. CHIEF parses the agent trajectory into a hierarchical causal graph and selects key error steps by performing counterfactual backtracking relative to the virtual correct result. AgentRX first identifies steps that violate explicit task constraints or data pattern constraints, and then the large language model selects key errors from the corresponding steps.

[0159] To ensure fairness in the comparison, the embodiments provided in this application and all multi-agent comparison methods use Qwen3-235B-A22B-Thinking as the base model. Direct prompting methods use the corresponding large language models listed in Table 4 below. All methods have their model generation temperature set to 0 to improve the reproducibility of the experimental results. For multi-agent comparison methods with publicly available prompts and processing flows, the experiments use their official prompts and processing flows.

[0160] The accuracy of the key steps of the embodiments and comparison methods provided in this application on multiple intelligent agent trajectory benchmarks is shown in Table 4 below.

[0161] Table 4. Detection results of critical error steps on multiple agent trajectory benchmarks. unit:% method ALFWorld GAIA WebShop Artificially constructed trajectory Algorithm generates trajectory 2 -Bench ​ SWE-Bench Pro average value Average trajectory length 60.00 28.68 51.84 51.60 8.72 29.27 119.70 49.97 Direct prompt method GLM-5.1 15.00 26.00 26.00 15.52 42.86 46.75 6.98 25.59 Gemini-3.1-Pro 19.00 30.61 32.00 20.69 46.82 52.50 17.44 31.29 DeepSeek-V4-Pro 15.00 34.69 24.00 18.97 42.06 48.25 12.79 27.97 Claude Sonnet 4.6 13.00 30.61 18.00 12.07 29.37 42.75 15.12 22.99 GPT-5.4 11.00 20.41 14.00 13.79 28.57 41.50 10.46 19.96 Claude Opus 4.6 10.00 34.69 24.00 27.59 46.83 45.25 17.44 29.40 Qwen3-235B-A22B-Thinking 9.00 33.33 18.00 17.24 42.06 42.75 17.44 25.69 Multi-agent diagnostic methods AgentDebugger 21.00 36.00 20.00 12.07 40.48 26.00 10.47 23.72 CHIEF 6.00 26.00 10.00 18.97 41.27 26.82 2.32 18.77 AgentRX 8.00 26.53 18.00 25.86 41.27 36.25 5.81 23.10 This application provides an example (TRAJDEBUG). 26.00 38.78 26.00 22.41 48.41 52.75 24.41 34.11 Note: All methods use only failure traces and failure signals, and do not use actual task results, success traces, or other auxiliary debugging signals.

[0162] The following results can be obtained from Table 4.

[0163] Result 1: The embodiments provided in this application achieve the highest macro-average accuracy across all evaluation datasets. The average critical error step detection accuracy of the embodiments provided in this application is 34.11%, higher than that of the direct hint method and existing multi-agent diagnostic methods. Although the absolute accuracy of all methods remains relatively low, indicating that accurately identifying critical error steps solely based on failure trajectories is challenging, the embodiments provided in this application demonstrate higher overall accuracy under the same experimental conditions. Using the same base model Qwen3-235B-A22B-Thinking, the average accuracy of the direct hint method is 25.69%, while the average accuracy of the embodiments provided in this application is 34.11%, an improvement of 8.42 percentage points. These results demonstrate that dividing the critical root cause localization process into evidence-based error trigger detection, error state classification, and candidate set-guided causal attribution can improve the accuracy of critical error step localization.

[0164] Result 2: The embodiments provided in this application are applicable to different types of intelligent agent tasks. The embodiments provided in this application achieved the highest accuracy on 5 out of 7 data subsets, covering task domains including embodied decision-making, open-domain information retrieval, user-oriented tool invocation, and long-term software engineering. In contrast, some multi-agent comparison methods exhibit significant performance differences across different task domains. For example, CHIEF's accuracy on SWE-Bench Pro dropped to 2.32%, while AgentRX achieved 8.00% accuracy on ALFWorld. These results demonstrate that the evidence-based error trigger detection and error state classification methods adopted in this application have good applicability in various intelligent agent task scenarios.

[0165] Result 3: The embodiments provided in this application maintain good localization performance even on datasets with long trajectory lengths. On the ALFWorld dataset with an average trajectory length of 60 steps, the embodiments provided in this application achieve an accuracy of 26.00%, which is 13.00 percentage points higher than the direct hint method using the same base model. On the SWE-Bench Pro dataset with an average trajectory length of 119.70 steps, the embodiments provided in this application achieve an accuracy of 24.41%, which is 6.97 percentage points higher than the direct hint method using the same base model. In the above datasets, the evidence required to determine errors is scattered across multiple trajectory steps, and multiple local errors typically exist simultaneously in a single failed trajectory. Experimental results show that evidence-based error trigger detection and candidate selection based on error states help narrow down the range of key error steps in long trajectories.

[0166] Based on the above experimental results, the key root cause localization method for intelligent agent trajectories provided in this application has the following technical advantages.

[0167] The embodiments provided in this application can improve the overall localization accuracy of critical root cause steps. Using the same base model, the embodiments provided in this application achieve an improvement of 8.42 percentage points compared to the direct suggestion method, and obtain the highest macro-average accuracy.

[0168] The embodiments provided in this application are applicable to different types of intelligent agent tasks. In various task domains such as embodied decision-making, information retrieval, tool invocation, and software engineering, the embodiments provided in this application demonstrate good localization performance.

[0169] The embodiments provided in this application can improve the ability to locate key root causes in long-term agent trajectories. As the trajectory length increases, the performance degradation of the embodiments provided in this application is less than that of the comparative methods, and the accuracy is maintained at over 20% in the longest trajectory group.

[0170] The following describes the critical root cause localization device for agent trajectory provided in this application. The critical root cause localization device for agent trajectory described below can be referred to in correspondence with the critical root cause localization method for agent trajectory described above.

[0171] Figure 6 This is a schematic diagram of the key root cause localization device for intelligent agent trajectory provided in this application. Figure 6 As shown, the key root cause localization device 600 for intelligent agent trajectory includes the following modules.

[0172] The acquisition module 610 is used to acquire the execution instructions of the target task and the failure trajectory of the agent in executing the target task; wherein, the failure trajectory is the task execution trajectory in which the final state fails to achieve the target specified by the execution instructions, and the failure trajectory includes multiple trajectory steps arranged in chronological order generated by the agent in the process of executing the target task.

[0173] The generation module 620 is used to compress the trajectory step and the historical trajectory steps preceding the trajectory step according to the time distance from the trajectory step for each trajectory step in the failed trajectory, and generate a multi-granularity trajectory representation of the trajectory step.

[0174] The determination module 630 is used to determine the critical root cause trajectory steps in the failure trajectory based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory; wherein, the critical root cause trajectory steps are the earliest erroneous trajectory steps that cause the target task to fail in the end, and whose erroneous behavior can be replaced with correct behavior to turn the target task from failure to success.

[0175] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include: a processor 710, a communications interface 720, a memory 730, and a communications bus 740, wherein the processor 710, the communications interface 720, and the memory 730 communicate with each other through the communications bus 740. The processor 710 can call logical instructions in the memory 730 to execute a critical root cause localization method for agent trajectories. This method includes: acquiring the execution instructions of a target task and the failure trajectory of the agent executing the target task; wherein the failure trajectory is the task execution trajectory in which the final state fails to achieve the target specified by the execution instructions, and the failure trajectory includes multiple trajectory steps generated by the agent in the process of executing the target task, arranged in chronological order; for each trajectory step in the failure trajectory, compressing the trajectory step and all historical trajectory steps preceding it according to different granularities based on their time distance from the trajectory step to generate a multi-granularity trajectory representation of the trajectory step; based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, determining the critical root cause trajectory step in the failure trajectory; wherein the critical root cause trajectory step is the earliest erroneous trajectory step that caused the target task to ultimately fail, and whose erroneous behavior, if replaced with correct behavior, could turn the target task from failure to success.

[0176] Furthermore, the logical instructions in the aforementioned memory 730 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 this application, in essence, or the part that contributes to the prior art, or a portion 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 this application. 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.

[0177] On the other hand, this application 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 critical root cause localization method for agent trajectory provided by the above methods. The method includes: obtaining the execution instructions of a target task and the failure trajectory of the agent executing the target task; wherein the failure trajectory is the task execution trajectory in which the final state fails to achieve the target specified by the execution instructions, and the failure trajectory includes multiple trajectory steps arranged in chronological order generated by the agent during the execution of the target task; for each trajectory step in the failure trajectory, compressing the trajectory step and each historical trajectory step before the trajectory step according to the time distance from the trajectory step to generate a multi-granularity trajectory representation of the trajectory step; based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, determining the critical root cause trajectory step in the failure trajectory; wherein the critical root cause trajectory step is the earliest erroneous trajectory step that caused the target task to fail and can turn the target task from failure to success by replacing its erroneous behavior with correct behavior.

[0178] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a method for locating the critical root cause of an agent's trajectory provided by the methods described above. This method includes: acquiring an execution instruction for a target task and a failure trajectory of the agent executing the target task; wherein the failure trajectory is a task execution trajectory in which the final state fails to achieve the target specified by the execution instruction, and the failure trajectory includes multiple trajectory steps generated by the agent during the execution of the target task, arranged in chronological order; for each trajectory step in the failure trajectory, compressing the trajectory step and all historical trajectory steps preceding the trajectory step according to their time distance from the trajectory step, generating a multi-granularity trajectory representation of the trajectory step; based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, determining the critical root cause trajectory step in the failure trajectory; wherein the critical root cause trajectory step is the earliest erroneous trajectory step that caused the target task to ultimately fail, and whose erroneous behavior, if replaced with correct behavior, could turn the target task from failure to success.

[0179] 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.

[0180] 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.

[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for locating key root causes of agent trajectories, characterized in that, include: Obtain the execution instructions for the target task and the failure trajectory of the agent in executing the target task; wherein, the failure trajectory is the task execution trajectory in which the final state fails to achieve the target specified by the execution instructions, and the failure trajectory includes multiple trajectory steps arranged in chronological order generated by the agent in the process of executing the target task; For each trajectory step in the failed trajectory, the trajectory step and all historical trajectory steps preceding the trajectory step are compressed at different granularities according to their time distance from the trajectory step, generating a multi-granularity trajectory representation of the trajectory step. Based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory, the critical root cause trajectory step in the failure trajectory is determined; wherein, the critical root cause trajectory step is the earliest erroneous trajectory step that leads to the final failure of the target task and can turn the target task from failure to success by replacing its erroneous behavior with correct behavior.

2. The critical root cause localization method for agent trajectory according to claim 1, characterized in that, For each trajectory step in the failed trajectory, the trajectory step and all previous historical trajectory steps are compressed at different granularities according to their time distance from the trajectory step, generating a multi-granularity trajectory representation of the trajectory step, including: For each trajectory step in the failed trajectory, perform the following operation to obtain a multi-granularity trajectory representation of the trajectory step: The trajectory steps and historical trajectory steps within a first preset number of steps are processed with high detail preservation to obtain the first sub-trajectory; The historical trajectory steps that are more than the first preset number of steps away from the trajectory steps but less than the second preset number of steps are subjected to medium detail compression processing to obtain the second sub-trajectory; The historical trajectory steps that are more than a second preset number of steps away from the trajectory steps are subjected to low-detail compression to obtain the third sub-trajectory; Based on the first sub-trajectory, the second sub-trajectory, and the third sub-trajectory, a multi-granularity trajectory representation of the trajectory step is obtained; The high-detail trajectory representation includes the execution instructions, execution actions, inference content, and environmental observation results corresponding to the trajectory steps; the medium-detail trajectory representation includes a summary of the main intentions, execution actions, and state changes corresponding to the trajectory steps; and the low-detail trajectory representation includes the coarse-grained execution progress of the target task, important entities, and unresolved task commitments or erroneous commitments. Among them, the important entities are core objects, states or constraints that have a key impact on subsequent reasoning and decision-making during the task execution process; The task commitment is the goal, constraint or expected state that the agent needs to follow or achieve based on the current reasoning during the trajectory steps; The erroneous commitment is a goal, constraint, or expected state that the agent confirms during a trajectory step based on erroneous reasoning or erroneous observation, which conflicts with the facts or execution instructions.

3. The key root cause localization method for agent trajectory according to claim 2, characterized in that, The determination of the key root cause trajectory steps in the failure trajectory based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory includes: Based on the multi-granularity trajectory representation of each trajectory step in the failed trajectory, determine whether there are any erroneous commitments in each trajectory step of the failed trajectory that conflict with the reference object; An error-triggered event is obtained based on the trajectory steps containing erroneous commitments that conflict with a reference object; wherein, the error-triggered event includes its corresponding trajectory step, as well as the erroneous commitment and the violated reference content in the trajectory step; the violated reference content is a specific textual expression, data, or factual statement that can serve as clear evidence of conflict with the erroneous commitment in the trajectory step; Error triggering events corresponding to the same reference object are aggregated into at least one error instance; wherein, the error instance represents an error process that persists around the same reference object; Based on the at least one error instance, determine the key root cause trajectory steps in the failure trajectory that led to the eventual failure of the task.

4. The critical root cause localization method for agent trajectory according to claim 3, characterized in that, The step of determining the key root cause trajectory in the failure trajectory that ultimately led to the task's failure based on the at least one error instance includes: Determine the resolution status of the error commitment in each error instance; Determine the final footprint of each error instance; wherein the final footprint is caused by the erroneous commitment in the error instance and is a result feature that can still be observed at the end of the target task; Based on the resolution status and final footprint of each error instance, determine the error status of each error instance; Based on the error status of each error instance, determine whether each error instance has global relevance; Select error instances with global relevance as candidate error instances; Based on the candidate error instances, causal attribution is performed to determine the key root cause trajectory that ultimately leads to the task's failure in the failure trajectory.

5. The critical root cause localization method for agent trajectory according to claim 4, characterized in that, Determining the resolution status of error commitments in each error instance includes: Obtain the reference object corresponding to the error instance; Check if there are any trajectory steps that revisit the reference object in all trajectory steps following the occurrence of the erroneous commitment of the erroneous instance in the failed trajectory; If there is a trajectory step that revisits the reference object, and the error commitment is corrected, the error instance is determined to be in a resolved state. If there is no trajectory step to revisit the reference object, or if there is a trajectory step to revisit the reference object but the error commitment has not been fixed, the error instance is determined to be in an unresolved state.

6. The key root cause localization method for agent trajectory according to claim 5, characterized in that, Determining the final footprint of each error instance includes: If the erroneous commitment in the erroneous instance causes an irreversible state change in the execution result of the target task, the erroneous instance is determined to have a first finality footprint; If the erroneous commitment of the error instance continues to exist in the subsequent trajectory steps of the failed trajectory or in the final execution result of the target task, the error instance is determined to have a second final footprint. If the error instance has budget debt, it is determined that the error instance has a third final footprint; wherein, the budget debt means that when the error commitment in the error instance is resolved, in the trajectory steps corresponding to the error instance, the number of trajectory steps from the time the error commitment appears to the time the error commitment is fixed exceeds a preset proportion of the total length of the failed trajectory.

7. The critical root cause localization method for agent trajectory according to claim 6, characterized in that, Based on the resolution status and final footprint of each error instance, determine the error status of each error instance, including: If the error instance is in a resolved state and the error instance has a third finality footprint, the error instance is determined to be in a high-cost resolution state. If the error instance is in an unresolved state and has a first endgame footprint or a second endgame footprint, the error instance is determined to be in an explicit active state.

8. The critical root cause localization method for agent trajectory according to claim 7, characterized in that, The step of determining whether each error instance has global relevance based on its error status includes: For each error instance, if the error state of the error instance is a high-cost resolution state or an explicit active state, the error instance is determined to have global relevance.

9. The critical root cause localization method for agent trajectory according to claim 4, characterized in that, The step of performing causal attribution based on the candidate error instances to determine the key root cause trajectory in the failure trajectory that ultimately led to the task's failure includes: For each candidate error instance, a causal attribution input is constructed; wherein, the causal attribution input includes: the starting trajectory step in which the error commitment of the candidate error instance first appears in the failure trajectory, the error state of the candidate error instance being a high-cost resolution state or an explicit activity state, and the error commitment and violated reference content corresponding to the candidate error instance; The causal attribution input is provided to the causal attribution model so that the causal attribution model performs causal attribution analysis on the failure trajectory and identifies the target error instance that caused the final failure of the target task from the candidate error instances. The starting trajectory step corresponding to the target error instance is determined as the key root cause trajectory step that led to the final failure of the target task.

10. A key root cause localization device for intelligent agent trajectory, characterized in that, include: An acquisition module is used to acquire the execution instructions of the target task and the failure trajectory of the agent in executing the target task; wherein, the failure trajectory is the task execution trajectory in which the final state fails to achieve the target specified by the execution instructions, and the failure trajectory includes multiple trajectory steps arranged in chronological order generated by the agent in the process of executing the target task; The generation module is used to compress the trajectory step and all historical trajectory steps preceding the trajectory step according to the time distance from the trajectory step for each trajectory step in the failed trajectory, and generate a multi-granularity trajectory representation of the trajectory step. The determination module is used to determine the critical root cause trajectory steps in the failure trajectory based on the multi-granularity trajectory representation of each trajectory step in the failure trajectory; wherein, the critical root cause trajectory steps are the earliest erroneous trajectory steps that lead to the final failure of the target task and can turn the target task from failure to success by replacing its erroneous behavior with correct behavior.