Self-Evolving Agents for Beginners: What to Focus On

    This article explains what actually changes when an AI agent "evolves": not the base model weights, but a set of readable external state files. It covers the core mental model, three categories of external state and directory governance, how to write memory and user profiles, organizing skills as documents, the closed-loop learning workflow, entry points and model interchangeability, a two-week learning path, and a checklist of common pitfalls.

    1. First, Fix the Mental Model: Agents Improve at the System Layer, Not the Weight Layer

    When people first encounter the idea of a self-evolving agent, they often assume it is quietly doing incremental training. Usually the opposite is true: the base model’s weights do not change at all while you use it. What changes is a handful of readable files around the model — personal preferences, task context, reusable methods, and domain knowledge. It is the same model, but the way it is invoked has changed.

    So the first thing to do after getting started is to build the right mental model: treat an agent as an inference core plus external state. The inference core handles understanding, planning, and generation; the external state handles accumulation. Your learning focus should therefore shift from tuning parameters to organizing external state.

    2. Focus One: Three Types of External State and Directory-Based Governance

    The first building block of self-evolution is splitting state into three types and materializing all of them as files:

    • Memory: your profile and task context — who you are, what you are doing, what you prefer.
    • Skills: reusable methods and steps — how this class of problem was solved before.
    • Knowledge: stable domain facts, terminology, and constraints — the premises you must know in this domain.

    All three share one property: they can be inspected, edited, and version-controlled by a human. They differ in change frequency and lifecycle. Memory changes fastest, skills accumulate per task, and knowledge is the most stable. At the beginner stage, fix a minimal directory skeleton first, then expand it gradually:

    1. agent-home/
    2. ├── memory/
    3. │ ├── USER.md # Long-term preferences, identity, collaboration conventions
    4. │ └── TASK.md # Current task goals, constraints, progress
    5. ├── skills/
    6. │ └── <skill-name>/
    7. │ └── SKILL.md # Trigger conditions, pre-checks, steps, acceptance criteria
    8. └── knowledge/
    9. └── domain.md # Domain terminology, facts, boundaries, counterexamples

    Three governance practices matter. First, define write permissions explicitly: which files the agent may modify automatically and which require human confirmation. Second, attach a timestamp and source to every write so changes can be traced. Third, put the directory under version control, which turns “why did its behavior suddenly change” into a readable commit record.

    3. Focus Two: How to Write Memory and User Profiles

    Memory is not a full dump of chat history; it is a compressed set of conclusions. Low-quality memory keeps polluting later decisions, so filter by reusability:

    1. Write down only stable preferences and long-term constraints, such as output format, code style, and communication rhythm.
    2. Keep task context separate from the long-term profile, and archive it when the task ends so expired goals do not interfere with new ones.
    3. Handle conflicts explicitly: when a new preference contradicts an old one, record the effective time and priority instead of simply overwriting.

    A usable minimal template:

    1. # User Profile
    2. - Role: backend developer, focused on maintainability and observability
    3. - Output preference: conclusion first, then details; code must include error handling
    4. - Constraints: no heavy dependencies that have not been evaluated
    5. # Current Task
    6. - Goal: add idempotency and retries to the batch pipeline
    7. - Constraint: do not change existing external interfaces
    8. - Progress: design review done, implementation pending

    4. Focus Three: Skills Are Documents, Organized in the agentskills Style

    A skill is essentially an operating manual written in natural language, stored in the skills directory and loaded on demand rather than injected in full. This keeps context cost under control and makes methods reviewable by humans. A proper skill contains at least five sections:

    • Trigger conditions: when it should be used, to avoid false triggers.
    • Pre-checks: whether the environment, permissions, and dependencies are satisfied.
    • Execution steps: actions that can be followed in order, with sample commands where useful.
    • Failure fallback: the troubleshooting order and safety boundaries when something goes wrong.
    • Acceptance criteria: how to tell the task is genuinely complete.

    Example:

    1. ---
    2. name: batch-idempotency
    3. description: Use when adding idempotency and retries to batch jobs
    4. ---
    5. ## Trigger conditions
    6. The user asks for "safe reruns" or "no duplicate writes".
    7. ## Pre-checks
    8. Confirm the target store supports conditional writes or unique keys.
    9. ## Steps
    10. 1. Generate a stable business key for each record
    11. 2. Check for existence before writing
    12. 3. Retry failures with exponential backoff; escalate to a human past the threshold
    13. ## Acceptance
    14. Run twice; the result set is identical with no duplicate records.

    Beginners often write skills as a running log. The test is simple: hand the document to a different person and see whether they can reproduce the result from it alone.

    5. Focus Four: The Closed-Loop Learning Workflow

    The loop has four steps: execute the task → verify the result → extract the lesson → write it back to a file. The critical part is that extraction in step three needs a gate, so an accidental success is not mistaken for a general method. Three gates are recommended:

    • Reproducibility: the same class of problem should appear at least twice before it becomes a skill.
    • Verifiability: a skill must include acceptance criteria, or it does not enter the library.
    • Rollback: write back by adding rather than overwriting, keeping historical versions.

    Meanwhile, past sessions should support full-text search, because retrieval is the entry point to reuse. Accumulation without retrieval is not accumulation at all; the files just become an archive nobody opens.

    6. Focus Five: Entry Points, Platforms, and Freedom to Swap Models

    Engineering usability is also a beginner-level focus. A mature self-evolving agent typically offers a full-featured terminal interface (multi-line editing, completion, streaming output, interruption at any time), cross-platform installation (mainstream desktop operating systems and containerized deployment), and replaceability at the model layer — either through an aggregation gateway or an inference service that conforms to a standard interface.

    Model replaceability leads to one important architectural recommendation: treat prompts, skills, and memory as assets decoupled from the model. If you need stronger reasoning or lower cost, you can switch models without rewriting those assets. On Baidu AI Cloud, for example, you can run the runtime on a container platform, keep state files in object storage, and track call quality with logging and monitoring services to form an operable loop.

    7. A Suggested Two-Week Learning Path

    • Days 1–2: get installation and the terminal interface working; confirm the boundaries for file read/write and command execution.
    • Days 3–4: create the three state directories and put them under version control.
    • Days 5–7: hand-write three skills covering “high-frequency, error-prone, verifiable” tasks.
    • Days 8–10: connect retrieval and write-back into a loop, and add human confirmation gates.
    • Days 11–14: swap in different models for comparison, and record the success rate of the same skill across models.

    8. Common Pitfalls and an Acceptance Checklist

    Pitfalls include treating chat history as memory, writing skills with no acceptance criteria, leaving state files unversioned, and injecting all skills at once, which bloats the context.

    Acceptance checklist: is all state external and readable; can every behavior change be mapped to a commit; can someone else reproduce a skill independently; do assets stay unchanged after a model switch; is there a fallback path when things fail. Passing all five means you have grasped the core of self-evolving agents, rather than stopping at “it can chat”.