Community Blog Agent Data Flywheel Platform: Selection and Practice

Agent Data Flywheel Platform: Selection and Practice

This article details integrating AgentLoop to build an AI agent data flywheel for enhanced observability, evaluation, and regression testing.

By Kaisheng

Zeus is the organizational operating brain through which 1688 is exploring autonomous enterprise operations with AI. By connecting business knowledge and data with multi-role Agents, it enables AI to analyze, coordinate execution, and continuously follow up around operating goals, progressively evolving from assisting individual work to supporting organizational operations. Zeus has already been deployed in real-world 1688 businesses including instant retail and business development. This article shares our thinking and practice in selecting a data flywheel platform for Zeus.

This practice has been included in the optimization section of the open-source project Alibaba Cloud AI Agent Handbook.

01 Background and Pain Points: “Blind Men and the Elephant” Before Integration

When users submit tasks to an Agent, their primary expectation is a correct result. For R&D and testing teams, however, the correctness of a single output is insufficient to determine the Agent’s true quality. The team also needs to understand how the result was produced, where deviations arose, and whether the issue can be reproduced reliably after a fix.

An Agent’s execution process typically includes model reasoning, tool calls, and multiple retries. Even identical inputs may produce different execution paths. If acceptance focuses only on the final answer, risks hidden in the execution process are difficult to expose promptly. During early development and testing, the team’s problems centered on the following three areas.

Pain Point 1: Root Causes of Deviations Are Difficult to Map to Specific Changes

Agent behavior is affected by multiple factors, including the prompt, skill, tool parameters, and reading strategy. When output is abnormal, the available diagnostic information is insufficient to determine where to begin. Even after making adjustments, it is often impossible to confirm whether the right place was changed. Optimization therefore depends on experience-based trial and error, making it inefficient and difficult to institutionalize.

Pain Point 2: Optimization Lacks Quantitative Evidence, Making Version Quality Difficult to Assess

After supplementing a Prompt, adjusting a Skill, or modifying MCP configuration, passing a small number of cases only shows that a local issue has improved. It does not prove that similar issues have been resolved or that the change has introduced no new deviations. Without unified evaluation criteria and batch validation capabilities, the team still relies on manual spot checks and individual judgment to assess version quality, leaving release decisions without stable, objective evidence.

Pain Point 3: Without a Stable Regression Mechanism, Historical Issues Cannot Become Test Assets

Failed requests, edge cases, and decision criteria are scattered across logs and communication records and have not yet become repeatable regression cases. After models, Prompts, or tool configurations change, the team often has to repeat manual validation. Existing issues cannot be continuously incorporated into subsequent testing, so similar defects may recur across versions.

1
Figure 1-1: Workflow Before Integration

We therefore wanted to connect Agent execution observability, effectiveness evaluation, and version regression: use unified standards to judge the effect of changes, accumulate test samples that cover different paths, investigate failures along execution records, and incorporate representative issues into subsequent regression. These are also the problems Zeus sought to solve by integrating AgentLoop.

02 Why We Chose AgentLoop and What It Solves

2.1 Solution Selection

This survey compared AgentLoop, DeepEval, and EVA+, focusing primarily on compatibility with the existing Agent framework, execution observability, regression, and evaluation.

Solution Key Features Advantages
AgentLoop An Agent observability and evaluation platform on Alibaba Cloud that connects online Traces, quality evaluation, datasets, and experiments Integrated observability, evaluation, and regression; non-invasive Trace collection through the ARMS probe, with relatively low integration cost
DeepEval An open-source large-model evaluation framework that maintains cases, metrics, and regression workflows through test code Open source, code-driven, and flexible to integrate; suitable for automated regression in CI
EVA+ An internal Alibaba evaluation platform for unified management of data, tasks, and results All-in-one platform; some applications require no instrumentation or only minimal instrumentation; supports multiple dataset and metric types as well as experiment comparison

We selected AgentLoop because it can collect Agent execution chains non-invasively through the ARMS probe, while its observability, evaluation, and sample-regression capabilities meet Zeus’s current needs. The following sections focus on the integration process and actual validation results.

2.2 Observability: First Understand How a Request Executes

AgentLoop organizes call logs using Sessions, Traces, and Spans. A Session corresponds to a multi-turn conversation, a Trace to one request within it, and a Span records specific operations in that request, such as model and tool calls. Following the call chain allows you to inspect each step’s inputs, outputs, parameters, results, and duration, and identify omissions, misuse, duplicate calls, or performance bottlenecks.

The platform can also process a Trace into a structured Agent trajectory that displays model and tool calls by execution step for subsequent evaluation. Here, “white box” means inspectable execution records: the amount of visible detail depends on what the framework exposes and what is actually collected. Integration acceptance must confirm that all key steps are present; seeing a Trace in the console is not enough.

2
Figure 2-1: AgentLoop Execution-Chain Observability

2.3 Evaluation: After a Successful Call, Determine Whether the Task Was Completed

A successful tool call only shows that one execution step ended normally; it does not mean that the task was truly completed. Evaluation cannot look only at API and tool status. It must also determine whether the user’s requirements were met, whether key conclusions are supported by evidence, and whether the final result was delivered in full.

Evaluation builds on the observable data from the previous section. The platform processes user input, model reasoning, tool calls, and final output into a dataset, then assigns scores and reasons against criteria such as accuracy and task completion to quickly identify low-scoring samples.

The platform supports three types of evaluators: Code, LLM, and Agent. Explicit rules such as missing fields or out-of-range values can be judged by a Code evaluator; simple semantic judgments can use an LLM evaluator; and scenarios involving business knowledge and multi-step verification can use Agent-as-a-Judge, with a knowledge base, business Skill, or MCP attached so the judge can actively query evidence before scoring. Evaluation results can also support version experiments: use a regression set to establish a release baseline and compare different Agents or versions before and after optimization. After release, continue sampling and evaluating real Traces and issuing alerts, forming an “observe—evaluate—optimize—retest” loop.

3
Figure 2-2: AgentLoop Task Evaluation

2.4 Regression Validation: Turn Failed Samples into Inputs for the Next Test

We wanted to first complete the following workflow around one issue and then gradually expand coverage: locate the Trace and Agent trajectory from an online request, complete evaluation and manual review, add the failed sample to the test set, request the new Agent version after modifying the Prompt, Skill, or model configuration, and compare the results using the same criteria.

4
Figure 2-3: Failed-Sample Regression Validation Process

The dataset stores inputs to be validated, reference information, and fields required for judgment. After a fix, the new Agent version must be requested again to obtain new output and execution records, which are then evaluated against the same criteria. Regression must also preserve necessary business conditions to prevent changes in data or tool responses from affecting the comparison.

Acceptance of this process can be grounded in a specific Case: can the complete record be found from the request, can the cause of failure be explained, can the sample be added to the test set, and can it be confirmed that the same issue is resolved after the change? Once the workflow is operational, expand the samples and evaluation scope. For low-frequency or abnormal scenarios not covered by online traffic, manually design cases.

03 Integration Process

This chapter describes solution selection, deployment, context propagation, Trace acceptance, evaluation configuration, and regression in implementation order.

3.1 Selection: ARMS GenAI Java Agent Probe

AgentLoop provides three integration methods: eBPF, the LoongSuite plugin, and language-framework probes. Zeus is a containerized Java application (Pandora Boot + AgentScope2), so we selected the ARMS GenAI Java Agent probe (jar 5.2.0-genai-1.0), running with a standalone AgentScope collector.

Selection rationale:

  • Non-invasive: AgentScope bytecode instrumentation automatically generates semantic invoke_agent / chat / execute_tool Spans, requiring no reporting code in the business application.
  • One-time deployment-layer configuration: Mounting is completed by adding startup parameters, decoupled from business releases.
  • Controllable overhead: Instrumentation switches narrow the scope so that only data required by the AgentScope chain is retained.

The probe reports to a dedicated SLS workspace, separate from the internal logging/tracing system.

3.2 Step-by-Step Integration

Step 1: Enable a workspace and mount the probe through startup parameters

Enable a workspace in the AgentLoop console, record the workspace identifier, and write it to ARMS_WORKSPACE. Production and pre-release environments can use different application names for distinction.

Mount the ARMS GenAI Java Agent probe by adding startup parameters, without modifying business code. The key startup parameters are:

  • licenseKey: the ARMS license key, injected through an environment variable; if empty, a WARN is printed and the probe is not mounted;
  • appName: the application name, configured separately for production and pre-release;
  • workspace: the AgentLoop workspace identifier;

5_
Figure 3-1: ARMS GenAI Java Agent Startup Parameter Configuration

Step 2: Verify Trace completeness

Criteria for a qualified Trace:

  1. Complete steps: Every model call and tool call has a Span, with readable inputs and outputs;
  2. Correct nesting: Sub-agents and asynchronous tasks retain their parent Span, with no orphan Spans or broken chains;
  3. Correct context propagation: Business-related data is not lost during propagation and is attached to the corresponding Span;

Dual-trace context conflicts and resolution (as needed): This occurs only when the business has integrated another tracing component (such as a self-built SDK or internal Tracing system) that, like the ARMS probe, is based on OTel Context. Directly sharing the same context can attach a sub-agent Span to the wrong parent or break the chain for a single request. The solution is to configure independent context keys and parent-chain restoration logic for each tracing system, with no mutual reads or writes to the ARMS probe’s Context.

6_
Figure 3-2: AgentLoop Trace Completeness Verification

Step 3: Configure evaluation

AgentLoop evaluation is essentially a “data-processing pipeline”: it progressively cleans real online Agent trajectories into scoreable datasets, then passes them to evaluators that output multidimensional quality scores (0–1). The chain comprises five stages and should be completed in order:

Agent trajectory → Data processing → Dataset → Evaluation task → Evaluator → Evaluation result

Agent trajectory: A trajectory consists of oTel-format logs collected non-invasively by the probe. The platform links logs from the same Trace to reconstruct a complete call: user input → Agent reasoning → tool call → final output. Every real online request is automatically retained as a trajectory, providing the data source for all subsequent evaluations without requiring additional synthetic data.

Data processing: Data processing converts Trace logs/Agent trajectories into structured datasets and performs two core tasks:

  • Log filtering: Select the requests to evaluate by time, Agent, call status, and other conditions.
  • Field projection / variable mapping: Extract fields from the trajectory and map them to variables used for evaluation, such as input, output, and intermediate-process information.

7_
Figure 3-3: Agent Trajectory Data Processing and Field Mapping

Dataset: A dataset is a collection of “input + output + process information” samples from two sources:

  • Automatic conversion (recommended): Generated from real trajectories through data processing, providing strong representativeness.
  • Manual creation: Used for cold starts, low-frequency scenarios, or critical business scenarios; samples are manually designed, selected, and annotated to ensure representativeness.

By purpose, samples can be retained as test sets, regression sets, benchmark sets, and so on, serving different evaluation goals.

8_
Figure 3-4: Evaluation Dataset Configuration

Create an evaluation task: Two core elements must be defined—the evaluation dataset and evaluation dimensions.

  • Select a dataset: The dataset determines the sample source for this evaluation. In practice, select the appropriate test, regression, or benchmark set according to the specific evaluation objective, such as release qualification, horizontal comparison, or routine investigation.
  • Select evaluation dimensions: Each dimension corresponds to an independent scoring standard, supported by an evaluator, such as answer accuracy, task completion, or tool-call accuracy. Single-dimension and parallel multidimensional evaluation are supported. In multidimensional mode, each sample receives an independent score for each dimension, forming a multi-perspective quality evaluation system. The better the dimensions align with business requirements, the more valuable the results are for subsequent optimization.

Select evaluators: Evaluators score by dimension and can be selected individually or run in parallel:

  • Agent Judge: Expert-level automated evaluation. It can learn proprietary enterprise knowledge, mount a Skill / MCP to invoke tools independently, and verify facts before scoring. It is suitable for dimensions requiring business knowledge or multi-step verification, such as “Does the answer comply with the latest policy?” and “Is the conclusion supported by data?”—in other words, a judge that understands the business.
  • LLM Judge: Directly invokes a large model with an evaluation Prompt to score results. It is suitable for dimensions that can be judged through semantic understanding without external verification, such as relevance, tone, or whether an answer misses the question. Configuration is lightweight and results are quick.
  • Code Judge: Executes Python or JavaScript evaluation code in a sandbox. It is suitable for dimensions with explicit, programmable rules, such as output-format validation, keyword matching, tool-call success, or whether a value falls within a threshold. Results are deterministic and incur no model cost.

After selecting evaluators, complete variable mapping by mapping dataset fields to evaluator inputs.

9_
Figure 3-5: Evaluator Selection and Variable Mapping

Run and Accept the Evaluation

The evaluation outputs multidimensional quality scores from 0 to 1. Low-scoring samples can be traced back to the original Trace for diagnosis and fed back into the test set to support the next iteration.

10_
Figure 3-6: Evaluation Task Results

3.3 Pitfall Checklist

1. Environments not isolated: Symptom: Traces from different environments are mixed into an evaluation task, making results incomparable. Cause: Production and pre-release share an application identifier or workspace. Solution: Configure an independent application identifier for each environment and filter evaluation tasks by environment.

2. Instrumentation scope too broad: Symptom: Low-value infrastructure Spans overwhelm the business chain and interfere with evaluation data extraction. Cause: The default instrumentation scope was not restricted. Solution: Under Application Configuration > Custom Configuration > Probe Switch Settings, enable only the instrumentation required by the Agent and explicitly disable unnecessary components such as database access.

11_
Figure 3-7: AgentScope Probe Switch Configuration

3. User identifier not reported along the chain (as needed): Symptom: user.id appears only in the entry Span, or is missing from subsequent model and tool calls. Cause: A Span Attribute applies only to the current Span; new Spans created during asynchronous execution do not inherit it automatically. Solution: Only when Traces need to be retrieved, analyzed, or associated by employee, write the user ID to OpenTelemetry Baggage at the request entry and capture the context before asynchronous context switching so subsequent Spans also carry the identifier.

12_
Figure 3-8: Propagating User Identifiers Along the Chain

4. Multiple tracing contexts overwrite one another: Symptom: A subtask is attached to the wrong parent Span, or the chain breaks within one request. Cause: Multiple tracing components share one context and attempt to restore the parent chain. Solution: Configure independent context keys and parent-chain restoration logic for different tracing systems, and validate parent-child relationships with requests containing asynchronous subtasks.

5. Inconsistent TraceIds: Symptom: The same request uses EagleEyeTraceId in EagleEye and AgentLoopTraceId in AgentLoop, preventing cross-system retrieval with a single TraceId and making it difficult to correlate business logs with the Agent execution chain during troubleshooting. Cause: The two tracing systems independently generate and maintain their own TraceIds. Solution: Print both EagleEyeTraceId and AgentLoopTraceId in logs at the request entry and key call nodes to establish a mapping. During troubleshooting, use either TraceId to locate the corresponding log, then use the other one in that log to jump to the other tracing system and connect the complete call process.

04 Actual Results: Data and Case Reviews

4.1 Practical Use: Online Inspection, Experiment Validation, and Release Regression

Zeus currently applies the platform’s capabilities in three practical scenarios. The first is online inspection, which discovers low-scoring and abnormal samples from continuously generated real requests. The second is experiment validation, which proposes optimization hypotheses for Bad Cases and uses controlled experiments to determine whether changes are truly effective. The third is release regression, which uses a fixed dataset before release to confirm that core metrics have not degraded. Together, they form a closed loop of “online discovery—experiment validation—release qualification—continued observation.”

Online inspection: A Pipeline processes online Traces and Agent trajectories into evaluable data and runs evaluation tasks on a fixed schedule. In this task, the page displayed 2,080 evaluation records covering execution-step efficiency, evidential support for answers, task completion, tool-call success rate, and tool-selection rationality across five dimensions. Filtering the task-completion dimension for raw scores no higher than 0.6 yielded 72 candidate samples. These records were not immediately classified as online incidents; they entered manual review to distinguish genuine capability gaps, data issues, and evaluation errors.

13_
Figure 4-1: Online Inspection Evaluation Results

Experiment validation: After confirming a Bad Case, the team not only reviews its Trace for the root cause but also saves representative samples to an experiment dataset and formulates testable optimization hypotheses. For the same issue, for example, the team can separately supplement data routing, adjust the Prompt, modify the Skill, replace the model, or change tool configuration. The experiment plan fixes the dataset, evaluator, and variable mapping; uses the current version as the baseline group; and uses one or more optimization approaches as experimental groups. Outputs and score differences are compared question by question while observing task completion, evidential support, tool selection, latency, Tokens, and cost. If a change improves only one Case while degrading others, the team continues adjusting rather than releasing it directly.

14_
Figure 4-2: Bad Case Experiment Validation

Release qualification: An Agent pending release enters pre-release qualification. The regression set confirms that historical issues do not recur, while the benchmark set detects degradation in overall capability. Each run uses the same data and evaluation criteria to compare the current version with the admission baseline. Only after core metrics such as task completion and tool-call accuracy reach their thresholds and all critical Cases pass does the version proceed to canary deployment or release.

15
Figure 4-3: Release Regression Comparison

4.2 Two Representative Cases: Stale Document Reads and Subtask Results Not Returned

The two Cases have different surface symptoms but reflect the same quality risk: determining whether an Agent completed a task requires more than the final answer or task status. It also requires verifying that the necessary actions were performed in the current turn, remote tool results were read correctly, and key conclusions were delivered in full.

Case A | Agent Reads a DingTalk Document but Does Not Retrieve the Latest Content

Scenario: The user asks the Agent to reread a DingTalk document and answer a question based on its latest content. The Agent describes changes using only the conversation context and does not actually initiate a document read in the current turn.

Symptom: The execution record contains only the user request and final answer, with no new “read document content” record. Although the answer appears credible, it may still be based on stale context or model inference.

Potential risk: If the document has been updated, the Agent may present old information as the latest conclusion. Business users cannot easily tell from the answer alone whether the information was reverified.

Improvement: Requirements such as “reread,” “refresh,” or “latest” must trigger a document read in the current turn, and the answer must be associated with that read result or document version. If reading fails, the Agent should explicitly state that it could not retrieve the latest content.

16
Figure 4-4: Case A: Document Read Not Refreshed

Case B | Sub-Agent Completes Execution but Fails to Return Results Correctly to the Main Agent

Scenario: The user asks the main Agent to delegate only one specified sub-Agent to query six Aone work items one by one in read-only mode and compile each item’s title, status, owner, and a failure list. The main Agent completes dispatch and status waiting, and the sub-Agent indeed performs all six queries.

Symptom: The sub-Agent’s final summary is contradictory—it says both that queries have begun and that no work-item IDs were received. The main Agent accepts this directly and concludes that “no real data was retrieved for any of the six items.” Yet the execution trajectory shows that all six queries successfully returned details. The results simply were not extracted and summarized, leaving all titles, statuses, and owners missing and producing a task-completion score of only 0.25.

Potential risk: The underlying queries succeed, but the user receives the incorrect conclusion “no data,” causing delivery failure and possibly unnecessary redispatch. Monitoring only whether the task is “complete” and the tool call “successful” cannot detect cases where “results were returned but never actually used by the main flow.”

Improvement: After a subtask ends, the main Agent should use structured tool-return results as the source of truth, verify the query count and required fields item by item, and compile a comparison table. It should also compare the sub-Agent summary with the actual execution trajectory. Conflicts should be explicitly flagged, with verifiable real returns taking precedence; the failure list should include only items that genuinely failed to query.

17
Figure 4-5: Case B: Sub-Agent Results Not Returned

4.3 Retaining Cases: Test, Regression, and Benchmark Sets

A dataset is not a temporary batch of saved samples, but a data asset continuously accumulated according to its intended use. It can primarily be retained as the following types of datasets.

The test set is used mainly for issue reproduction and optimization validation. It can come from low-scoring online samples and Bad Cases, and can also include low-frequency scenarios, exception branches, and manually designed questions with limited online coverage, to verify whether the Agent “can do it correctly.”

The regression set is used mainly to prevent historical issues from recurring. Confirmed and fixed Bad Cases, as well as critical samples that may be affected by Prompt, Skill, Tool, or knowledge-base changes, enter the regression set and are executed repeatedly before release as release blockers and quality gates.

The benchmark set consists of long-term stable, manually reviewed, representative golden samples. It is used for full regression, version comparison, and quality-baseline assessment during model switches, major version changes, and core capability upgrades.

The post-training set supports further training of model capabilities. It mainly consists of high-quality execution trajectories, expert-annotated samples, golden answers, and representative manually created questions with insufficient online coverage, and can be used for SFT, RL, behavioral alignment, and experience transfer. Post-training samples do not necessarily have a unique standard answer; they may also contain reference answers, preference relationships, process annotations, or reward signals.

An online Bad Case usually first enters the test set for issue reproduction and solution validation. After the fix is confirmed, it enters the regression set to prevent recurrence. Representative samples validated over time can be further retained in the benchmark set, while high-quality samples suitable for improving the model’s general capabilities can be processed into post-training data. A temporarily frozen sample collection used during an experiment is merely a data slice for that experiment; it can be selected from the datasets above and need not become a separate long-term dataset type.

18
Figure 4-6: Roles of Test, Regression, and Benchmark Sets

4.4 Overall Quality Results

In terms of efficiency, average diagnosis time per issue fell from about 55 minutes before integration to 15 minutes after integration, because the team could directly locate model, tool, or subtask nodes along the Trace—an improvement of about 73%. A complete regression cycle fell from roughly 1.5 person-days to three hours, a reduction of about 75%. Evaluation scope also expanded from manual spot checks of about 200 records per round to automated daily coverage of more than 2,000 records across five quality dimensions, increasing coverage by roughly tenfold.

In terms of quality and effectiveness, 72 candidate samples were selected from records with task-completion scores no higher than 0.6. Manual review confirmed 31 valid issues, 26 of which were fixed and passed regression, for a fix pass rate of about 84%. On the fixed regression set, the average task-completion score rose from 0.62 to 0.82 and evidential support from 0.66 to 0.85; the recurrence rate of historical issues fell from 16% to 5%.

In terms of workflow, the team shifted from a reactive “firefighting” model of ad hoc investigation after user feedback to a preventive “fireproofing” model of “online inspection—manual review—regression-set accumulation—optimization validation—release qualification.” The proportion of issues discovered before release rose from about 30% to 75%, while monthly emergency investigations fell from eight to three. Bad Cases no longer stop at one-off fixes; they become repeatable quality assets that continuously reduce release risk.

05 Integration Recommendations and Future Evolution

5.1 Integration Recommendation: Start with the Minimum Closed Loop

  1. First select a high-frequency business scenario with verifiable results and complete the minimum closed loop of “Trace collection—trajectory inspection—automated evaluation—manual review—sample feedback—version regression,” then gradually expand coverage.
  2. Integration acceptance cannot merely check whether a Trace is generated. It must confirm that model calls, tool calls, asynchronous subtasks, and final output are fully observable; that parent-child Spans and hierarchy are correct; and that environment and business identifiers can be retrieved reliably.

5.2 Future Plans: Business Evaluators, Experience Store, and Memory Store

  1. Next, we will extend evaluators for specific business scenarios on top of general metrics such as task completion, evidential support, and tool-call accuracy. Evaluators can mount business knowledge bases, business Skills, and MCP, actively query the latest rules and business data, and then determine whether answers are correct, evidence is sufficient, and handling complies with business requirements.
  2. AgentLoop also provides experience-store and memory-store capabilities, which Zeus has not yet integrated. The experience store can extract reusable methods from successful trajectories, failure reviews, and manual assessments and recall them through a Skill during execution. The memory store can retain cross-session information such as facts, episodes, and summaries. After the evaluation and regression loop is stable, low-risk, verifiable scenarios can be piloted on a small scale, with benefits validated through a fixed test set before usage is gradually expanded.
0 0 0
Share on

Alibaba Cloud Native Community

848 posts | 61 followers

Comments