AI Agent Architecture Evolution: From Message Scheduling to Experience Loops
This article explores the architectural evolution of AI agents, comparing message scheduling with experience loops. It covers essential design dimensions, core modules such as context construction, tool management, and execution control, as well as best practices for memory layering, skill accumulation, secure migration, and governance. The goal is to help engineering teams evaluate agent upgrades based on real task execution, cost control, and the reduction of repetitive labor.
1. Discussing Agent Upgrades: Focus on Missing Capabilities, Not Replacement
The continuous emergence of next-generation AI agents can create an impression that as long as long-term memory, skill management, and automated execution capabilities are added, the new system can fully replace existing assistants.
However, from an engineering perspective, an agent’s value does not depend on its release date or the brevity of its installation command. What truly impacts the user experience is whether the system can continuously and reliably complete tasks within clear permission boundaries, while allowing users to understand the execution process, control costs, and correct errors.
Therefore, before evaluating an architectural upgrade, three questions should be answered:
First, what is the main bottleneck of the current system? If the problem is unstable message access, adding a memory module may not help. If the issue is repeatedly explaining the environment and constraints, improving state management and memory retrieval might be more valuable.
Second, are the tasks repetitive? Fixed-format reports, troubleshooting similar faults, and periodic data organization are usually suitable for accumulating experience. Highly open, one-off exploratory tasks rely more on model reasoning, tool capabilities, and human judgment.
Third, to what extent is the system allowed to act autonomously? Generating suggestions versus directly modifying files, sending messages, or executing external operations belong to different risk levels and cannot use the same permission policy.
This means that agent selection is primarily a requirements analysis, followed by architectural comparison.
2. Message Scheduling vs. Experience Loops: Two Different Design Dimensions
1. Message Scheduling Solves “How Requests Enter and Get Responded To”
A common message-driven architecture can be abstracted as:
User Input -> Access Layer -> Identity and Session Recognition -> Request Orchestration -> Model and Tool Execution -> Result Return
The access layer is responsible for receiving requests from different channels, unifying message formats, and handling identity mapping, attachments, and connection states. The orchestration layer selects context based on the task, invokes the model, and decides whether to use tools.
The advantage of this architecture is clear responsibility. Developers can separately optimize access stability, model invocation, tool permissions, and response routing, making it relatively easy to locate issues.
However, a common misunderstanding needs to be corrected: being message-routing-centric does not mean the system is necessarily “independent in every conversation,” nor does it mean it cannot retain experience. Message routing and memory management are not mutually exclusive; the former describes how requests flow, while the latter describes how information is persisted and reused. A message-driven system can equally possess session storage, long-term memory, and a skill library.
Its potential shortcomings usually stem from specific implementations: if the execution process only retains the final reply without recording task states, tool results, and failure reasons, it becomes difficult to resume interrupted tasks or reuse existing experience later.
2. Experience Loops Solve “What Remains After Task Completion”
Agents oriented towards continuous tasks can be abstracted as:
Task Input -> Context Construction -> Planning and Execution -> Result Validation -> Experience Extraction -> Review and Save -> Subsequent Retrieval and Reuse
The key here is not “storing more historical messages,” but transforming the task process into verifiable, retrievable experiences with clear application boundaries.
For example, after the system processes a file organization task, it might find that a certain type of input must be validated for encoding before extracting fields. But this approach only qualifies as a reusable experience when it has been verified and its applicable file types and failure conditions are explicitly recorded.
A so-called loop does not automatically equate to model training. Most engineering practices maintain states, memories, rules, and operation templates externally to the model, reusing this information in subsequent tasks through context injection or process orchestration. The model parameters can remain entirely unchanged.
Therefore, to judge whether a system has truly formed an experience loop, one should examine how experience is generated, how it is verified, when it takes effect, and how erroneous experiences are revoked, rather than just checking if a “memory” entry point exists.
3. Breaking Down Core Modules: From Conversation to Continuous Execution
1. Context Construction: Determining What the Model Sees
The context construction module usually needs to integrate the current user request, session summary, task state, relevant memories, tool descriptions, and permission constraints.
It is not simply concatenating all content. The longer the context, the higher the cost and latency usually are, and irrelevant information is more likely to interfere with judgment. A reasonable approach is to filter content based on task relevance, timeliness, and credibility, setting clear priorities for different information.
It is especially important to distinguish between control instructions and external data. Text in documents, web content, and tool return values should be treated as data to be analyzed; they should not gain permission to modify system rules simply because they contain imperative statements.
2. Tool Management: Quantity Does Not Equal Capability
The tool registration module is responsible for describing executable operations, input requirements, permission boundaries, and execution results. Having many tools does not necessarily make the agent stronger; overlapping functions, vague descriptions, or unstable return formats may instead increase mis-invocations.
A governable tool should have clear input validation, timeout handling, error classification, and audit logging. Operations involving writes or external side effects should also consider idempotency to avoid duplicate execution upon retries.
For example, “read document” and “delete document” might operate on the same resource, but their permission levels are entirely different. The latter should be subject to stricter confirmation and scope limitations, and should not rely solely on the model’s own judgment.
3. Session Storage: Supporting Recovery and Tracking
Session storage should record not just the conversation between the user and the assistant, but also task identifiers, execution steps, tool inputs and outputs, state changes, and error information.
These records can help the system determine after an interruption: which steps have been completed, which results are still valid, and which operations cannot be repeated.
Full-text search is suitable for finding exact terms, error messages, and historical fragments; semantic search is suitable for finding content with different expressions but similar meanings. Both can be used in combination, but search results still need to be filtered based on permissions, source, and timeliness, and cannot be directly treated as facts.
4. Execution Control: Preventing Infinite Task Loops
Continuous execution requires clear stopping conditions. The system should at least set a maximum number of steps, a time budget, a cost budget, and a consecutive failure threshold.
If multiple steps repeatedly produce the same error, continuing to invoke the model will not necessarily improve the result. A more reliable approach is to pause execution, output the current state, failure reasons, and optional handling paths, and let the user decide whether to continue.
4. Layering Memory to Prevent Chaos
In engineering, agent memory can be divided into three categories.
Session Memory is used to maintain the continuity of the current exchange, such as the goal of the current discussion and clarified questions.
Task State is used to record ongoing work, including the current phase, completed steps, pending items, and intermediate artifacts. It primarily serves task recovery and progress control.
Long-term Experience is used to save cross-task reusable information, such as stable preferences, verified processes, and confirmed environmental constraints.
These three should not be confused. A temporary request does not necessarily represent a long-term preference; a failed attempt should not directly settle into a general operating rule.
Below is a schematic experience record structure, not a specific product interface:
Experience Record:Content: Check input integrity before processing certain types of documentsScope: Specified document types and task workflowsSource: Execution records of verified tasksValidation Status: Manually confirmedLast Validated: Actual date recordedInvalidation Conditions: Changes in input structure or execution environmentVisibility: Currently authorized users or workspace
Long-term memory should also support viewing, modifying, deleting, and expiration handling. When dealing with sensitive information, priority should be given to saving necessary summaries rather than complete raw materials.
5. Skill Accumulation: Saving Reusable Processes, Not Just Commands
Reusable skills can be understood as task templates with boundary conditions. They should explain what the input is, what preconditions are required, which tools can be invoked, how success is determined, and how to exit upon failure.
For example, a data organization skill should not only describe “read content and generate a summary,” but also explain how to handle missing fields, duplicate data, contradictory conclusions, and unconfirmable sources.
Skills and experiences also differ: experience answers “what happened in the past and what practices might be effective,” while skills answer “under what current conditions can what process be executed.”
When automatically generating skills, it is recommended to place them in a candidate area first, and only enable them after repeated validation or manual review. Unreviewed skills directly granted high permissions may solidify an accidental success into a long-term error.
6. Agent Migration: Beyond a One-Time Import
Agent migration involves data semantics, not just file copying. Configurations, session history, long-term memory, skill definitions, tool permissions, and credentials may all adopt different organizational structures.
Special attention needs to be paid to three types of risks:
First, changes in context meaning. Summaries from the old system might be misinterpreted as long-term facts in the new system.
Second, privilege escalation. Read-only processes in the past might gain write capabilities after migration, causing unnecessary risks.
Third, skill incompatibility. Even if the text import is successful, the original process might not run due to different tool names, execution environments, or input constraints.
A secure migration should be phased: first back up and complete data classification, then verify configurations and tools in an isolated environment, followed by migrating low-risk memory, and finally reviewing skills and credentials item by item.
Post-migration acceptance should not only check “if it can open,” but also confirm whether retrieval is accurate, permissions are maintained, sensitive information is leaked, and failed tasks can be safely recovered. For credentials, they should be reconfigured in a controlled manner; if the export process poses an exposure risk, rotation should be considered.
7. Security Governance Throughout the Execution Chain
An agent capable of invoking tools is essentially an automated execution system with a natural language entry point. Its security boundary cannot rely solely on prompts.
It is recommended to establish the following control mechanisms:
- Least Privilege: Only open resources necessary for the task, restricting accessible directories, network destinations, and credential scopes.
- High-Risk Confirmation: Operations such as deleting data, publishing content, and modifying permissions should provide the target, impact scope, and confirmation entry point before execution.
- Isolated Execution: Use restricted environments for untrusted scripts and external inputs to avoid direct access to sensitive resources in the host environment.
- Audit Trail: Record key operations, authorization basis, and execution results, while desensitizing sensitive fields in logs.
- Memory Isolation: Distinguish data by user, project, or workspace to prevent cross-boundary retrieval and reuse.
- Recovery Mechanisms: Retain undo paths for reversible operations, and add pre-validations for irreversible operations.
It needs special emphasis that an experience loop may not only accumulate correct practices but also information planted by attackers. Therefore, memory writes also require source verification and permission control.
8. Evaluating with Real Tasks, Not Demos
To decide whether to upgrade, a test set containing daily tasks, abnormal inputs, and permission boundaries should be established, and results compared under similar environments and budgets.
Metrics worth observing include:
- Task Success Rate: Whether the result meets predefined acceptance criteria.
- Manual Intervention Count: How many times the user needs to supplement, correct, or confirm.
- Execution Cost and Latency: How many resources are consumed to successfully complete a task.
- Recovery Capability: Whether it can continue after a tool failure or session interruption.
- Memory Quality: Whether the retrieved content is accurate, expired, or causes interference.
- Security Boundaries: Whether privilege escalation, information leakage, or unconfirmed high-risk operations occur.
To verify the value of memory, memory can be enabled and disabled on the same task to observe whether repetitive tasks benefit and whether unrelated tasks are interfered with. Do not assume that adding memory always improves quality: incorrect, expired, or irrelevant memory may degrade performance.
9. Conclusion: Architectural Evolution Aims to Reduce Repetitive Labor Controllably
Message scheduling emphasizes connection and response, while the experience loop emphasizes continuous execution and knowledge reuse. The two can synergize and do not inherently replace each other.
For scenarios dominated by instant Q&A, message access, and lightweight operations, a clear and stable scheduling architecture may be sufficient. For scenarios requiring cross-session progression, frequent repetitive operations, and the accumulation of business experience, investing in task state, memory governance, and skill management is more worthwhile.
A truly mature agent does not have the most tools, save the most history, or behave most like “autonomous learning.” It should know what information is worth retaining, what operations require authorization, what results must be verified, and when to stop and hand over to humans.
Therefore, the core criterion for an upgrade decision should be: whether it continuously reduces repetitive labor in real work at an acceptable cost and risk.
