Community Blog The Data Foundation for Agent Self-Improvement: Alibaba Cloud SLS Session Store

The Data Foundation for Agent Self-Improvement: Alibaba Cloud SLS Session Store

This article introduces Alibaba Cloud SLS Session Store, which organizes agent runtime data into standardized trajectories to support evaluation and recursive self-improvement.

Agent Self-Improvement Requires Continually Accumulated Runtime Data

When fixing a pagination filtering issue, a coding agent searches the code, modifies the implementation, runs tests, and then takes further action based on the feedback. These execution records can serve as a starting point for improving how it handles subsequent tasks.

In research on RSI (Recursive Self-Improvement), researchers are exploring how systems can use feedback from their own execution and evaluation to make lasting improvements in capability, with the improved system continuing to participate in the next round of self-improvement. A further goal is to bring the process of "how improvements are produced" itself into the iteration.

For agent applications, this means that prompts, tools, task strategies, and even the improvement process itself may all become targets for continuous optimization. What was done in each round of execution, what feedback was received, and how performance changed after modifications all need to be recorded as evidence that the next round can use.

A single user request can involve dozens of rounds of interaction with models and tools. To bring information scattered across Trace / Log into a self-improvement workflow, teams need to accumulate this data continuously, locate it by task, understand it, and make it available to downstream systems.

Alibaba Cloud SLS Session Store organizes agents' runtime records into standardized trajectories that can be queried and reused, providing a shared data foundation for observability, datasets, LLM evaluation, and RSI self-improvement.

Alibaba Cloud SLS Session Store: From Trace / Log to Standardized Trajectories

Alibaba Cloud Simple Log Service (SLS) is a one-stop cloud-native data platform that provides collection, processing, storage, query and analytics, and data consumption capabilities for runtime data such as logs, metrics, and traces. Teams can continuously accumulate application runtime records in SLS for observability and troubleshooting, performance analysis, and business monitoring.

As AI applications move from single-turn questions and answers to agent-driven, multistep tasks, the requirements for using runtime data are also changing. A single user request may involve multiple model calls, tool executions, and rounds of feedback on results. Teams need not only to analyze latency and token consumption, but also to understand how an agent advances a task, how tool feedback affects subsequent actions, and whether the final result meets the requirements. Scattered call records need to be further organized into a readable, analyzable execution process.

To address this need, Alibaba Cloud SLS has introduced Session Store. It parses and correlates ingested OpenTelemetry Trace / Log data into a standardized Trajectory—an execution trajectory—bringing together task inputs, interactions with models and tools, execution results, and runtime metrics for both developers to read and programs and LLMs to analyze.

With SLS's storage, query and analytics, and data consumption capabilities, teams can continuously accumulate these trajectories, find them by task and review their details, or select representative cases and key excerpts to assemble into datasets and evaluation samples for downstream systems such as AgentLoop. Data from day-to-day execution can thus continue to contribute to observability, evaluation, and improvement, accumulating evidence for agent self-improvement.

1

Organize scattered records into an execution process.

During a long-running task, model actions and tool feedback alternate repeatedly. A standardized trajectory links these recorded actions and feedback, allowing developers to understand what happened at each stage and what information informed subsequent actions.

Once different applications provide runtime records according to the ingestion conventions, a common trajectory representation provides a unified starting point for analysis. Downstream evaluation and self-improvement systems can read data in terms of tasks, actions, and feedback, reducing the work of interpreting record formats anew and piecing together execution processes.

Accumulate data in SLS, then query and read it as needed.

As runtime data continues to accumulate, teams can use SLS's query and analytics capabilities to locate tasks using recorded information such as inputs and outputs, models, tools, elapsed time, or token usage, then read the specific actions and feedback and, when necessary, refer back to the raw records to verify the facts; they can also read trajectories through SLS's data consumption interfaces for continuous processing by downstream applications.

For different needs, this data can be used from several interconnected perspectives:

Data Perspective What It Helps Teams Understand
Raw Records (Raw) Which runtime facts were collected and where the specific records came from
Execution Trajectory (Trajectory) What the agent did, what feedback it received, what outputs it produced, and what resources it consumed
Task Session (Session) How multiple rounds of interaction carry forward the same task context when session and turn associations are explicit
Feature Data (Feature) Which behaviors and statistics can be used for selection, analysis, and subsequent improvement

The multiple searches, modifications, and tests that follow a single user input belong to the execution process within that turn; a follow-up question or additional requirements from the user form a new interaction. When the relationship between sessions and turns is explicit, related trajectories can be considered together to understand the task's context and progress.

Enable shared use by developers and self-improvement systems.

Developers can read the execution process in light of the issue at hand, while downstream applications can read the summaries, details, and runtime metrics needed for a task according to the data conventions. Tasks found through queries can then be organized into samples; when evaluation requirements change, the trajectories already accumulated can also be analyzed again.

This reuse is particularly important for RSI: historical trajectories can help generate improvement proposals, while trajectories from a new round can be used to check their effectiveness. Both use a common data representation, making it easier for downstream systems to continuously compare, select, and iterate.

Organizing execution processes, accumulating and querying data, and supporting reuse by people and tools together constitute Session Store's value as a data foundation.

Identify Opportunities for Improvement from a Single Trajectory

Returning to the pagination filtering fix: the agent inspects the page state and request logic and discovers that requests to change pages do not retain the filter conditions. After the modification, the relevant component tests pass. When it proceeds to browser-based verification, however, it encounters missing runtime dependencies.

With no change in the environment, the agent runs the same test command again and still gets a startup error, yet ultimately summarizes the outcome as "tests and verification passed."

In Session Store's trajectory data, developers can follow the test calls to inspect their returned content, then cross-check it against subsequent actions and the final output: the component tests produced results, but browser-based verification remained incomplete; repeated attempts yielded no new verification information, and the completion response did not explain this distinction.

This provides concrete directions for improvement: add environment checks, adjust the retry approach, and accurately report the scope of verification. The modifications and tests that already made progress also have records that can be retained and referenced.

Resource analysis likewise requires information about the process. By combining call content, returned results, and recorded elapsed time and usage, teams can determine which resource expenditures advanced the task and which attempts remained blocked by the same conditions. Task quality and resource consumption can thus both be included in subsequent improvement objectives.

Build Feedback for Self-Improvement with Datasets and LLM Evaluation

Turn Day-to-Day Execution into Reusable Samples

Session Store provides a queryable, traceable data source for building samples. Teams can select representative issues, high-frequency tasks, and reliably completed cases, then verify and categorize them against business objectives and add evaluation requirements.

For this fix trajectory, the task requirements, necessary code and environment context, test feedback, and subsequent actions can be retained and organized into an evaluation sample for handling environment-related failures. Trajectories in which similar fixes were reliably completed can also be included to cover both normal and difficult scenarios.

Complete tasks are suitable for checking overall completion, while key excerpts are suitable for studying the next action. Preserving the link between each sample and its original trajectory makes it easier to review the context and allows newly emerging issues to be added to the dataset continuously.

Use LLMs to Evaluate Results and Execution Processes

Standardized trajectories can be used for LLM-as-a-Judge, with a large language model acting as the evaluator. Teams provide the evaluation model with task requirements, execution data, and business-specific scoring criteria, adding reference answers or expected results as needed, so that it can analyze the quality of the results and the action sequence and provide scores and the reasoning behind its judgments.

In a fix task, evaluation can focus on whether the agent understood tool errors, took appropriate action in response, and accurately described the scope of verification in its final reply. For open-ended tasks, evaluation can focus on tool selection, supporting source material, and task progress, leaving room for different valid paths to completion.

Using the accumulated trajectories, downstream tools can analyze the quality of day-to-day execution in batches and identify tasks that need attention. When a model, prompt, or tool changes, different versions can also be run on the same task set to compare results, trajectories, and resource consumption. Running key tasks multiple times can also reveal whether performance is stable.

2

Whether a code fix works can be checked through actual tests; whether business rules are satisfied can be checked through rule validation; manual spot checks can verify whether LLM judgments align with the team's standards.

This feedback can help self-improvement systems identify issues to prioritize and choose among candidate improvements. Session Store provides execution data, and evaluation tools produce judgments; together, they provide evidence for subsequent iterations.

For RSI, Let Each Round of Improvement Support the Next Round of Self-Improvement

For RSI, execution data can feed into a continuously operating workflow: execute tasks, analyze feedback, generate candidate improvements, validate and select them, update the agent, and then have the updated system participate in subsequent execution and improvement.

In this workflow, distilling lessons from experience is the starting point for proposing candidate solutions. Downstream self-improvement systems also need to turn those proposals into changes that can be retained and validate their performance on new tasks, so that the next round starts from capabilities that have already been verified.

Session Store continuously supplies runtime data for this process: trajectories can be used to analyze which tasks revealed issues, which actions a candidate proposal changed, and what feedback the new round of execution produced.

3

Generate Concrete Improvements from Runtime Feedback

Continuing with the example of missing environment dependencies, a downstream self-improvement system can examine multiple similar trajectories to identify the conditions that frequently block verification and generate different candidate proposals: add environment checks to the task strategy, add dependency diagnostics to tools, or adjust prompts so that the final response explicitly distinguishes between the parts that have been verified and those that remain blocked.

The targets for improvement thus become the agent's actual ways of working. Prompts, tool code, and execution strategies can all be candidates for modification. Teams can begin iterating on a single high-frequency issue and gradually expand to more complex tasks.

Trajectories in Session Store provide context for these proposals. Both effective handling and blocked execution processes can serve as material for analysis, helping the system understand the conditions under which an approach is applicable and reducing repeated proposals of solutions that have already been tried.

Validate on New Tasks, Then Choose Which Changes to Retain

Once candidate proposals have been generated, a self-improvement system can arrange for different versions to execute the same set of tasks, compare their performance using actual tests, LLM evaluation, and runtime resource consumption, and select improvements that meet its objectives.

For an environment-checking proposal, validation should cover tasks with all dependencies present as well as tasks with missing dependencies: can normal tasks still be completed, can blocked tasks receive useful diagnostics, are retries appropriate, and is the final report accurate? Checking effectiveness on tasks that were not used to generate the proposal also helps determine whether the improvement can apply to a broader range of scenarios.

Once teams link runtime trajectories to agent versions, candidate modifications, and evaluation results, they can trace the evidence behind a selection decision. Attempts that deliver no benefit, affect other tasks, or significantly increase costs are also worth recording for reference in subsequent improvements.

Have the Improved System Continue to Participate in Improvement

Validated modifications can become a new version used for subsequent execution. The Trace / Log produced by that new version then enters Session Store, forming new standardized trajectories that evaluation and self-improvement systems can continue to read.

Subsequent iterations can therefore focus on new issues: now that environment checks have been added, is any tool feedback still being ignored? After repeated attempts have been reduced, has verification begun to stop prematurely? The system can combine new and historical trajectories to propose the next batch of candidate solutions and check their effectiveness again.

Provided that task objectives and evaluation conditions are comparable, continuously accumulated data lets teams observe how changes unfold across multiple rounds, understand where the gains come from and how broadly they apply, and obtain evidence for retaining effective versions and reconsidering proposals that were not selected.

Help Agents Become Better at Improving Themselves

A further direction in RSI research is to let a system modify its own methods for generating improvements. For example, it might adjust the strategy for selecting samples of problematic cases, improve the prompts used to analyze causes of failure, or optimize candidate proposal generation and experiment scheduling. The improved mechanisms continue to produce new improvements, forming a deeper level of recursion.

In exploring this approach, teams can also collect the runtime records produced by the improvement process itself. Once records that conform to the ingestion conventions enter Session Store, downstream systems have the data to analyze which experiments provided useful information and which search paths merit further investment.

This requires both task execution and the improvement process to leave traceable evidence, while independent checks of effectiveness are maintained as changes occur. Session Store's data organization and reuse capabilities provide a foundation for gradually building such a workflow.

Continuously Accumulate Data for Agent RSI Self-Improvement

From the Trace / Log of a single execution to queryable standardized trajectories, and then to samples, evaluation feedback, and multiple rounds of improvement, runtime data can continually contribute to the evolution of agent capabilities.

Alibaba Cloud SLS Session Store draws on SLS's storage and analytics capabilities to organize and supply execution data; downstream systems such as AgentLoop can use this data to conduct evaluations, generate candidate improvements, and validate their effectiveness. Teams can start with specific tasks and gradually bring more feedback, selection, and update steps into the self-improvement workflow.

When an improved agent continues to execute tasks, produce feedback, and participate in the next round of improvement, continuously accumulated data becomes the foundation connecting successive iterations.

Alibaba Cloud SLS Session Store accumulates evidence from every round of improvement to support agent RSI self-improvement.

Learn more: Alibaba Cloud Simple Log Service (SLS) · SLS Official Documentation

0 0 0
Share on

Alibaba Cloud Native Community

839 posts | 61 followers

Comments