Design Philosophy Divergences in Long-Lived AI Agents

    This article examines how running an AI agent as a persistent service changes its engineering constraints, and contrasts two design philosophies: capability stability first versus self-evolution first. It covers layered memory and versioned skills, permission tiers for tool and command execution, concurrency and long-task orchestration, evaluation metrics, and selection guidance for building agents that remain trustworthy over time.

    1. Background: Why “Long-Lived” Changes the Engineering Constraints

    Early agents were mostly one-shot scripts: receive input, call a model, return a result, and disappear when the process exits. Once an agent needs to run as a persistent service on a server, the engineering constraints change fundamentally. It is no longer just inference logic; it becomes a service system with a lifecycle, state, and real external side effects.

    The persistent form introduces four new classes of problems. First, state management: preferences, task progress, and intermediate artifacts must survive across sessions. Second, the boundary of tool and command execution: the ability to run commands means real side effects, so permissions and auditing cannot be avoided. Third, multiplexing of message entry points: CLI, instant messaging, and scheduled triggers may deliver tasks at the same time, requiring idempotency and concurrency control. Fourth, long-running tasks and result pushback: a task may take far longer than a single request, so background execution, progress queries, and completion notifications must be supported.

    Two design philosophies diverge precisely in how they answer these constraints: one puts “stability and predictability” first, while the other puts “growth and self-modification” first.

    2. The Core Divergence Between the Two Routes

    Route A: Capability Stability First

    This route holds that an agent’s value comes from reliable execution. Architecturally, it tends to solidify capabilities into versioned modules, keep memory to the minimum necessary, and require review and canary rollout for changes. The benefits are reproducible behavior, easier fault localization, and simpler compliance; the cost is that new scenarios require manual capability expansion, and iteration speed is limited by the release process.

    Route B: Self-Evolution First

    This route argues that an agent should accumulate experience through use, distilling “pitfalls encountered” and “practices that were corrected” into reusable capability units, so it fits a specific business better the more it is used. Its slogan-like expression is “growing together with the user.” The benefits are fast scenario adaptation and good coverage of long-tail problems; the risks are capability drift, quality fluctuation, and auditing difficulty.

    It is worth emphasizing that neither route is inherently superior; they differ in where governance cost sits. Route A places the cost in upfront design and release, while Route B places it in runtime evaluation and rollback.

    3. Making Self-Evolution Work: Layering Memory and Skills

    For self-evolution to be genuinely usable, “remembering” must be split into different layers rather than stuffing all information into one long text.

    1. Factual memory: user preferences, environment parameters, common paths. It is short, stable, and explicitly editable.
    2. Experiential memory: successful paths and failure lessons for a class of tasks, usually stored as structured entries with scenario tags and confidence scores.
    3. Skill assets: repeatedly occurring experience solidified into callable capability units, including trigger conditions, input/output contracts, and validation rules.

    A schematic skill entry structure is shown below (pseudocode that expresses structure only and does not point to any specific product interface):

    1. skill:
    2. name: report_assembly
    3. trigger: "when the user asks to summarize periodic data and generate conclusions"
    4. inputs: [time_range, data_source_alias, output_format]
    5. steps:
    6. - validate_range
    7. - fetch_via_readonly_connector
    8. - aggregate_and_cross_check
    9. - render_with_citations
    10. guards:
    11. - max_runtime_seconds: 900
    12. - require_human_approval: true # for outbound or write operations
    13. provenance:
    14. source: "user correction record #128"
    15. confidence: 0.82

    Three points are critical: skills must be versionable; they must carry provenance and confidence; and they must be disableable or rollback-able. Without these three, “self-improvement” degrades into uncontrollable behavioral drift.

    4. Security Boundaries for Tool Calls and Command Execution

    The largest risk surface of a persistent agent is not model output but the channels through which it reaches real systems. It is advisable to split permissions into three tiers: read, write, and outbound.

    • Read tier: queries, statistics, and log retrieval can run automatically, but require rate limiting and auditing.
    • Write tier: modifying configuration or updating data requires whitelisted paths, change windows, and secondary confirmation.
    • Outbound tier: sending messages or triggering third-party actions must have explicit approval and retain an operation snapshot.

    On the engineering side, command execution can be hosted in a containerized sandbox, combined with a least-privilege account, read-only mounts, and egress policies; all tool calls can go through a unified gateway, producing three-part “intent-parameter-result” logs. General-purpose capabilities in the Baidu AI Cloud ecosystem, such as container platforms, logging services, and monitoring and alerting, are often used to host this kind of sandbox and audit pipeline.

    5. Concurrency, Scheduling, and Long-Task Orchestration

    The persistent form is naturally multi-entry, so overlapping tasks must be assumed. Practical measures include: maintaining a task queue per session with a concurrency cap; deduplicating similar tasks with idempotency keys; using a decoupled structure for scheduled triggers where the scheduler only delivers events and the executor performs idempotent consumption; and splitting long tasks into resumable stages that persist checkpoints to disk, so a failure can resume from the interruption point instead of rerunning everything.

    Result pushback also needs governance: distinguish three message types, “completion notification,” “progress summary,” and “human intervention required,” to avoid high-frequency interruption; and filter sensitive information from pushback content to prevent internal paths or credential fragments from leaking into chat entry points.

    6. Evaluation: Making “Growth” Measurable

    Without evaluation, self-evolution cannot prove it is effective. It is recommended to establish three layers of metrics: task success rate and first-pass rate; human correction rate and number of rollbacks; and skill reuse rate and average steps saved. Every skill generation or memory update triggers a regression test set, and the change is automatically disabled if metrics degrade. This turns “growth” from a slogan into an auditable engineering process.

    7. Selection Guidance

    • Stable business rules and high compliance requirements: prefer the capability stability route, minimize memory, and route changes through the release process.
    • Many long-tail scenarios and high manual cost: prefer the self-evolution route, but build a skill version repository, regression evaluation, and approval gates at the same time.
    • Most real-world systems: adopt a hybrid strategy, solidify core paths, allow self-generated skills for edge scenarios, and converge both routes under one governance system with a unified gateway and auditing.

    8. Conclusion

    The competitive focus of persistent agents has shifted from “whether they can call tools” to “whether they can be trusted over the long term.” Self-evolution provides adaptability, and stable governance provides trustworthiness; lacking either will come at a cost in real business. Making layered memory, skill versioning, tiered permissions, and regression evaluation solid is the prerequisite for an agent to be truly “online for the long term and better with use.”