The Evolution of General AI Agents and the Practice of Self-Evolution

    This article traces the shift in general AI agents from conversational assistants to systems that complete real work and improve from outcomes. It breaks down the four core modules of a usable agent—planning and task decomposition, tool calling with an execution sandbox, a layered memory system, and evaluation with observability—and then explains how self-evolution works in practice as a closed loop of execution, evaluation, attribution, update, canary release, and rollback. It also clarifies a common misconception that self-evolution means changing model weights at inference time, outlines frequent pitfalls, and offers engineering recommendations for keeping agents stable in real business environments.

    From Chatting to Getting Work Done: A Paradigm Shift in One Year

    In March 2025, a product labeled the “world’s first general AI agent” brought agents into the mainstream. A year later, the open-source community had produced a wave of general-purpose agent frameworks named after crustaceans, and with the ecosystem still unsettled, a new generation of systems emphasizing “self-evolution” began to enter the discussion. Names and hype are not what matters. What developers should focus on is the underlying paradigm shift: the competition has moved from “can the model answer correctly” to “can the system finish a real task without human intervention and keep improving from the result.”

    This progression can be summarized in three stages:

    • Stage 1: Conversation augmentation. The model is paired with retrieval and prompt templates, producing more controllable output, but it is still one question, one answer.
    • Stage 2: Tool orchestration. The model gains interfaces to call external capabilities, and task decomposition, looped execution, and result backfilling appear. The agent begins to have “the power to act.”
    • Stage 3: Self-evolution. The system turns execution traces, failure samples, and human feedback into reusable assets that optimize prompts, tool descriptions, retrieval strategies, and even workflow structure.

    One common misconception needs clearing up: self-evolution does not mean the model automatically rewrites its weights during inference. The more common and more controllable engineering approach is to build a writable asset layer around the system, letting the agent update its own strategy and knowledge after each task while the model itself stays on a stable version. This “outer-loop learning” is the mainstream path in production today.

    The Four Core Modules of a General Agent

    Regardless of the implementation, a usable general agent is basically made up of four parts.

    1. Planning and Task Decomposition

    The planning module breaks a vague goal into verifiable subgoals. In practice, a two-layer structure of “explicit plan plus dynamic replanning” is recommended: first produce a readable task list, then make local revisions during execution based on tool results, rather than thinking from scratch at every step. This preserves controllability while avoiding a rigid plan.

    A sample plan data structure:

    1. {
    2. "goal": "Review the past week of production alerts and provide remediation suggestions",
    3. "steps": [
    4. {"id": 1, "action": "query_metrics", "status": "done"},
    5. {"id": 2, "action": "fetch_logs", "status": "running"},
    6. {"id": 3, "action": "summarize", "status": "pending"}
    7. ],
    8. "constraints": ["read-only access", "30s timeout per step"]
    9. }

    2. Tool Calling and Execution Sandbox

    Tools are the agent’s hands and feet. There are three engineering priorities. First, tool descriptions must be readable by the model, with clear parameter semantics and explicit enum values. Second, all external actions must go through permission checks and auditing. Third, high-risk actions such as code execution and file writes belong in an isolated sandbox that restricts network, filesystem, and runtime duration. As the number of tools grows, introduce semantic retrieval-based tool selection instead of stuffing hundreds of tool definitions into the context at once.

    3. Memory System

    Memory is usually divided into three layers: short-term context (the current task trace), episodic memory (historical tasks and results), and semantic memory (accumulated rules and domain knowledge). The key design is the write policy and the forgetting policy. Not every trace is worth keeping; entries should be scored by “was the task successful, was it corrected by a human, is it reusable” before being stored, with expiration and deduplication mechanisms in place. Otherwise memory quickly degrades into noise.

    4. Evaluation and Observability

    Self-evolution without evaluation is flying blind. At a minimum, cover three categories of metrics: task success rate, step efficiency (number of steps and time spent), and safety compliance rate (how often privilege escalation and dangerous operations are blocked). Also persist the full trace of each execution, tool inputs and returns, and token consumption in a structured form for replay and root-cause analysis.

    How Self-Evolution Actually Lands

    The essence of self-evolution is a closed loop: execute, evaluate, attribute, update, re-execute. A practical implementation order:

    1. Collect: record the task goal, plan, tool call sequence, final result, and human intervention points.
    2. Attribute: determine whether the failure came from a planning error, a tool selection error, a parameter extraction error, or missing knowledge.
    3. Update: different attributions map to different write targets—prompt templates, tool descriptions, retrieval indexes, or workflow templates.
    4. Canary: validate the new strategy on shadow traffic or a small fraction of tasks first, and roll out fully only if metrics do not regress.
    5. Rollback: version all assets and keep one-click rollback available.

    A minimal policy update loop can be written as:

    1. def evolve(trace, evaluator):
    2. score = evaluator(trace) # whether the task was achieved, whether privileges were exceeded
    3. if score.success and not trace.human_fixed:
    4. return # no learning needed
    5. if trace.fail_stage == "tool_select":
    6. tool_index.upsert(trace) # fix the tool retrieval sample
    7. elif trace.fail_stage == "param_extract":
    8. prompt_repo.update_schema_hint(trace)
    9. else:
    10. plan_templates.add(trace.plan, weight=score.gain)
    11. return versioned_snapshot()

    The boundary needs emphasis: actions involving permissions, data deletion, funds, and external publishing should not be included in the scope of automatic optimization. They must be backed by deterministic rules and human approval.

    Common Pitfalls and Engineering Recommendations

    • Pitfall 1: assuming that filling up the context makes the agent smarter. Context is a limited and expensive resource, and noise directly lowers the success rate, so compression and summarization are needed.
    • Pitfall 2: pursuing fully automatic evolution. Automatic updates without evaluation and canary release often bring unexplainable metric fluctuations.
    • Pitfall 3: ignoring determinism. Use a rules engine or state machine on critical paths to guarantee stable results, and place the model where judgment is required.
    • Pitfall 4: deferring security. Least privilege, operation auditing, and masking of sensitive information should be in place from the first version.

    At the infrastructure level, the common approach is to put state and traces in object storage, decouple tasks and events through a message queue, run the execution sandbox on a container platform, and build an observability loop with logging services and monitoring alerts. Baidu AI Cloud provides standardized, categorized support for these general capabilities, and enterprises can combine them freely according to their own compliance requirements.

    Conclusion

    From general agents to self-evolving systems, the technical substance lies not in the terminology but in the engineering details: a clear planning structure, an auditable tool layer, memory with tradeoffs, replayable evaluation, and an evolution loop with versioning and canary release. Get these five things solid, and an agent can run stably in real business over the long term rather than staying at the demo stage.