Agent Skills Self-Evolution Framework: Technical Breakdown

    This article analyzes why agent skill libraries often degrade instead of improving over time, and breaks down the four capabilities a self-evolving skill framework needs: experience extraction, in-library governance, a quality feedback loop, and cross-environment sharing. It presents a three-tier architecture (client proxy, optional evolve server, shared storage), explains the core mechanisms for duplicate skill detection and merging as well as low-quality skill repair, and covers multi-tenant isolation, governance risks, and deployment suggestions on Baidu AI Cloud.

    1. The Problem: Skill Library Bloat and “Negative Evolution”

    Most mainstream agent frameworks now include a skill accumulation mechanism. A successful debugging session, an efficient command-line troubleshooting flow, or a clever tool-call orchestration can be solidified into a reusable asset and invoked directly in later tasks. The intent is straightforward: the longer the system is used, the more reusable experience it accumulates, and the smarter the agent should become.

    In engineering practice, however, this positive feedback loop often turns into negative feedback, for three main reasons.

    First, duplicate generation. Similar tasks recur across different sessions, and the agent “re-summarizes” a highly similar skill each time. The library grows in size while the information gain approaches zero.

    Second, conflicts and overwrites. New and existing skills prescribe different approaches for the same scenario, and callers have no basis for arbitration. Which skill gets matched is partly random, and output stability drops accordingly.

    Third, half-finished accumulation. Failed or partially completed trajectories may also be written into the library. Low-quality entries dilute the retrieval hit rate of high-quality ones, and genuinely valuable experience gets buried in noise.

    More critical is the fragmentation problem: skills are tightly bound to the host framework and host device, so they cannot be reused after switching to a different runtime. Every agent reinvents the wheel, and users have to “teach it all over again.”

    What the industry actually lacks is therefore not the ability to generate skills, but a mechanism that lets skills evolve, deduplicate, and improve in quality automatically, while being continuously shared across multiple agents, users, and devices.

    2. Target Capabilities: Four Layers a Self-Evolution Framework Must Cover

    Abstracting these pain points into engineering goals, a usable skill self-evolution framework must cover at least four layers of capability.

    1. Experience extraction: identify reusable fragments from real session trajectories (not hand-written ones) and generate skill descriptions in a unified structure.
    2. In-library governance: similarity discovery, merging, version evolution, and repair or retirement of low-quality entries.
    3. Quality loop: use invocation results as feedback signals to drive skill iteration, rather than freezing a skill once it is written.
    4. Cross-environment sharing: store skills in a unified format in shared storage, and let any compatible runtime pull them on demand.

    None of these four layers can be missing. Extraction without governance accelerates library bloat; governance without feedback signals leaves quality improvement without an objective basis.

    3. Architecture: Client Proxy + Optional Evolve Server + Shared Storage

    One proven layering approach is a three-tier structure.

    • Client Proxy: inserted as a transparent proxy into the call chain between the agent and the model interface. It collects session trajectories, triggers skill extraction in the background, and injects local skills. It sits in the data plane and is essentially non-intrusive to upper-layer business logic.
    • Evolve Server (optional): sits in the control plane and handles heavier offline tasks such as batch similarity clustering, skill merging, quality evaluation, and retraining-style rewriting. Small-scale deployments can omit it and let the client proxy work independently.
    • Shared storage layer: serves as the single source of truth and supports three backend types: object storage, an S3-compatible interface, or a local file system. Skills are uniformly described as SKILL.md, which makes version management and cross-device synchronization easier.

    A sample directory and skill structure looks like this:

    1. skills/
    2. git-bisect-regression/
    3. SKILL.md
    4. metadata.json # version, source trajectory ID, success rate, invocation count
    5. log-pattern-triage/
    6. SKILL.md
    1. # SKILL.md example (illustrative)
    2. name: log-pattern-triage
    3. description: Cluster massive logs by error fingerprint to quickly locate the change that introduced the issue
    4. when_to_use: online error rate spikes and stack traces are missing
    5. steps:
    6. 1. Split logs by time window
    7. 2. Extract error fingerprints and cluster them
    8. 3. Align with recent change records
    9. 4. Output candidate root causes and verification methods
    10. constraints:
    11. - do not run destructive commands
    12. - production changes require human confirmation

    A unified format is the prerequisite for cross-framework sharing: only when the description, trigger conditions, steps, and constraints are all machine-parseable can different runtimes consume the same skill equivalently.

    4. Key Mechanism 1: Similar Skill Discovery and Merging

    Deduplication cannot rely on string comparison of file names or titles. The common industry practice is to map skill descriptions and steps into vector representations, run nearest-neighbor queries in a vector retrieval system, and push anything above a similarity threshold into a candidate merge queue.

    Merge strategies generally fall into three categories:

    • Keep the best, retire the rest: when multiple skills are semantically equivalent, keep the one with the best historical success rate and invocation volume.
    • Generalized merging: when multiple skills cover different branches of the same problem, extract the common steps as a skeleton and push the differences down into optional branches or parameters.
    • Hierarchical consolidation: aggregate fine-grained skills into higher-level composite skills to reduce the number of candidates at retrieval time.

    In engineering terms, it is advisable to keep a “soft delete, not hard delete” policy and record the source trajectory identifier, so that effects can be traced quickly when a rollback is needed.

    5. Key Mechanism 2: Identifying and Repairing Low-Quality Skills

    Quality evaluation needs objective signals. Available dimensions include invocation success rate, task completion level, average number of interaction turns, number of human corrections, and how often a skill is superseded by later ones. Low-scoring skills do not have to be retired outright; a more economical approach is to repair them:

    1. # Pseudocode: repair and re-evaluation flow for low-quality skills
    2. def evolve(skill, traces, threshold=0.6):
    3. metrics = evaluate(skill, traces) # success rate / completion / turns
    4. if metrics.success_rate >= threshold:
    5. return skill, "keep"
    6. patched = merge_and_rewrite(skill, traces) # fill in failure branches, remove redundant steps
    7. new_metrics = evaluate(patched, traces)
    8. if new_metrics.success_rate > metrics.success_rate:
    9. save(patched, version=skill.version + 1)
    10. return patched, "upgraded"
    11. mark_soft_deleted(skill, reason="low_quality")
    12. return None, "retired"

    The core idea of repair is to treat failed trajectories as negative samples and locate missing preconditions or constraint entries in the skill, rather than simply stacking on more steps. Step bloat is a common cause of skill degradation.

    6. Sharing Skills Across Frameworks and Devices

    The key to sharing capability is decoupling on three fronts: skills from the runtime (unified SKILL.md description), skills from the device (stored in object storage or a local sync directory), and skills from the user (isolated via namespaces and access control).

    For integration, the transparent proxy mode has the least impact on existing habits: after initial configuration, users talk to the agent as usual while skills keep iterating in the background. For the many AI coding tools and agent frameworks that use OpenAI-compatible interfaces, you only need to point requests at the local proxy address; no business code changes are required.

    Recommended isolation strategy for multi-tenant scenarios:

    Layer Scope Typical content
    Global shared All users General tool usage, standards-type skills
    Team space Within an organization Internal processes, code conventions
    Personal space A single user Personal preferences and private scripts

    7. Deployment Suggestions from Baidu AI Cloud’s Perspective

    To build similar capabilities in your own environment, you can compose general cloud product categories: use object storage to hold the skill repository and version files, use a container platform to deploy the client proxy and evolve server, use a message queue to smooth out spikes in offline evaluation tasks, and use logging and monitoring/alerting services to observe skill invocation success rates and library health metrics. Baidu AI Cloud can provide support across these general categories; specific selection should be evaluated against your own scale and compliance requirements.

    8. Risk and Governance Checklist

    • Privacy boundary: session trajectories contain sensitive information, so desensitization and minimal retention must be applied on the collection side.
    • Permission checks: skills can carry commands and tool calls, so shared skills must have constraint fields and a human confirmation step.
    • Regression protection: after a skill update, run regression on a fixed evaluation set to avoid “optimize once, degrade everywhere.”
    • Observability: record the version number and source trajectory for every skill hit, so problems can be located and rolled back.

    9. Conclusion

    The core tension in agent skill libraries has shifted from “can we generate skills” to “can we govern skills.” Only by closing the loop across experience extraction, deduplication and merging, quality repair, and cross-environment sharing can a skill library genuinely get stronger with use instead of getting messier.