Self-Improving Agents: From Execution Loops to Skill Accumulation
This article examines self-improving agents from an architecture perspective, explaining why stronger foundation models alone do not guarantee reliable production performance. It breaks down the core loop of acting, observing, learning, and iterating; white-box execution with error suppression; the shift from external skill libraries to internally generated skills; cross-session memory and preference modeling; and the infrastructure and governance required for enterprise deployment. Engineers will find practical guidance on skill structure, guardrails, quality regression, and building a defensible data and domain moat.
Over the past year, a clear divide has emerged in the AI coding tools and general-purpose agent space: early products relied on plug-and-play external public skill libraries, while newer frameworks emphasize self-refinement through real tasks. The industry refers to the latter as self-improving agents. Their value lies not in a stronger model itself, but in whether model capabilities can be rooted in a specific business environment. This article breaks down the key design of such systems from an architecture perspective and offers practical engineering recommendations.
1. Background: A Strong Model Does Not Equal Strong Delivery
The base capabilities of large models have converged rapidly over the past two years. The consensus among major vendors is that simply increasing parameters and reasoning ability is yielding diminishing marginal returns, and the real bottleneck has shifted to engineering: how to make models reliably produce results in long-running, multi-step production tasks with side effects.
A common failure mode is “spinning in place”: the model appears to be thinking, but it neither advances the task nor exposes why it failed. Facing an interface with no feedback for a long time, the user cannot tell whether the system is running normally, waiting on an external dependency, or already deadlocked. In engineering terms, this experience problem traces back to three gaps:
- Observability gap: no structured output of intermediate state;
- Error-correction gap: no suppression or rollback strategy after an error occurs;
- Experience-reuse gap: every task starts from scratch, and historical experience cannot be accumulated.
The design goal of self-improving agents is to close all three gaps at once.
2. The Core Loop: Act, Observe, Learn, Iterate
The backbone of these frameworks is a four-stage loop, not a linear input-output pipeline.
- Act: decompose a high-level goal into verifiable subtasks and call tools step by step to produce real side effects.
- Observe: collect each step’s return value, latency, error codes, and environment state to form a structured trace.
- Learn: generalize reusable action sequences from the trace, determining which steps are on the necessary path and which are redundant attempts.
- Iterate: write the generalized results back into the skill library and policy configuration, influencing the default behavior of the next task.
The key is that the fourth step must genuinely close the loop. Many systems stop at “logging.” Logs are only data; they do not constitute capability. Learning has occurred only when the generalized output can be loaded directly by subsequent tasks and change their behavior.
A schematic skill entry structure looks like this (fields are generic illustrations, not a specific product interface):
skill:name: batch-config-validateversion: 3trigger: "Use when batch config validation and a diff report are needed"steps:- action: collect_inputs- action: schema_checkon_error: retry_then_isolate- action: render_diff_reportguardrails:max_retries: 2require_confirmation_before: [write, delete]metrics:success_rate: 0.93avg_steps: 4
There are already several consensus-oriented attempts in the industry at skill description formats, aiming to make skills portable, versionable, and loadable by different runtimes. From an engineering standpoint, the three fields most worth attention are trigger, guardrails, and metrics: the first determines whether a skill can be correctly recalled, the second defines the risk boundary, and the third provides a quantitative basis for judging whether a skill has degraded.
3. White-Box Execution and Error Suppression
Self-improving frameworks generally place error suppression at high priority, reflected in three layers of mechanisms.
The first layer is process transparency. Execution is streamed externally as an event feed, for example:
[plan] subtask 3/7 generated[act] calling validation tool, param digest a1b2...[obs] returned 2 inconsistencies, 1.2s[decide] entering retry branch (1/2)[report] progress 45%, ~2 steps remaining
This proactive reporting may look like a UX improvement, but it is essentially observability design for a control system: if a step produces no events for a long time, the monitoring side can flag it as blocked and trigger an alert, rather than waiting for user complaints.
The second layer is bounded retry and isolation. Set a maximum retry count for failed steps; once exceeded, isolate the problematic data in the output so a single point of failure does not contaminate the entire task chain.
The third layer is upfront confirmation for high-risk actions. Irreversible actions such as writes, deletions, and permission changes require explicit confirmation or two-person review, consistent with common change-management practices in enterprises.
4. Skill Accumulation: From External Libraries to Endogenous Capability
Early agents were more like a manual transmission: skills came from external public collections, and users had to select, combine, and tune them themselves, with high migration costs. Self-improving frameworks are closer to an automatic transmission: it automatically selects the strategy “gear” based on the current user’s historical traces.
The differences show up in three areas:
- Recall: shifting from keyword matching to weighted recall based on task semantics and historical success rate;
- Generation: automatically extracting reusable fragments after a task completes, deduplicating them, and writing them into a local skill library;
- Refinement: aggregating multiple execution results of the same skill, with low-success-rate versions automatically down-weighted or retired.
It is worth emphasizing that skill accumulation must be paired with governance; otherwise the skill library will quickly balloon into a “collection of technical debt.” Practical measures include setting skill admission thresholds (for example, minimum execution counts and success-rate thresholds), periodically merging redundant skills, and retaining version rollback capability.
5. Cross-Session Memory and Preference Modeling
Long-horizon collaboration requires the system to remember “what this user wants.” This is typically implemented in layers:
- Short-term memory: the context and intermediate artifacts of the current task;
- Task-level memory: the goal, constraints, and result summary of completed tasks;
- User-level preferences: stable tendencies such as output format, language style, approval habits, and commonly used tech stack.
Preference modeling must avoid two traps. One is mistaking a one-off instruction for a long-term preference, which requires introducing confidence and decay mechanisms. The other is memory contamination: sensitive information should be redacted before writing, and users should be able to view and delete it. An observable memory-update log is a prerequisite for passing compliance review in enterprise environments.
6. Enterprise Deployment: Supporting Infrastructure and Risk Control
Running self-improving capabilities in production requires general cloud infrastructure. Common combinations include: a container platform to handle runtime elastic scaling; a message queue to decouple long-running tasks from result delivery; object storage to hold traces and skill versions; and logging services plus monitoring and alerting for blockage detection and quality dashboards. Baidu AI Cloud offers corresponding capabilities in these general categories, which can be combined as needed.
On the governance side, four boundaries are recommended:
- Least privilege: skills have no high-risk permissions by default and must request them as needed;
- Full-chain auditing: every tool call is logged and traceable to a specific skill version;
- Quality regression: run the skill library periodically against a fixed evaluation set to prevent capability drift caused by self-improvement;
- Human fallback: keep a human takeover entry point for critical workflows.
7. Trend Outlook
One foreseeable evolution path is that excellent single-point features will gradually be internalized by platform providers as standard capabilities, while the advantage of independent small teams will lie more in deep refinement and responsiveness in vertical scenarios. Therefore, when building self-improving capabilities, the focus should be on private data loops, domain skill accumulation, and governance norms: these are the parts that general capabilities cannot directly replace.
By analogy from technology history, foundation models solve the “power” problem, while agent frameworks solve the “transmission” problem: how to deliver power to specific tasks in a stable, controllable, and reusable way. Whoever builds the loop solidly first will gain compounding returns first.
