AI Agent Architecture Selection: Gateway Governance vs. Execution-Loop and Skill Evolution

    This article explains how to evaluate AI agent architectures for production use, going beyond surface capabilities like multiple entry points and model switching. It compares two design centers—a gateway/control plane and an execution loop—and examines skill systems (manual definition vs. experience distillation), multi-entry and multi-model handling, and the state, isolation, and observability required for long-running systems. It also offers verifiable selection criteria and a phased migration strategy, showing that reliable engineering comes from combining governance, adaptability, and validated skills rather than chasing "self-learning" or a "unified entry" alone.

    1. Can It Replace the Existing System? Separate Feature Coverage from System Fit

    When an agent system supports multiple messaging entry points, command-line interaction, and different model sources, it may look ready to replace an existing system. But entry points and models are only the outer layer of a system; they do not prove the system can carry the same production responsibility.

    The questions that actually matter include: Do multiple entry points share a consistent identity and permission model? Can execution resume after an interruption? Are tool calls auditable? Is accumulated experience reliable? Can existing workflows be migrated? These questions directly affect availability, security, and maintenance cost.

    So when evaluating an agent architecture, distinguish “can complete a task once” from “can complete the same class of tasks continuously and under control.” The former mainly reflects the combination of model and tool capabilities; the latter depends on state management, execution governance, skill lifecycle, and operations.

    In terms of design focus, common approaches fall into two categories: one organized around a gateway and control plane, and one organized around the agent’s task-execution loop. They are not strictly mutually exclusive technical paths, but rather emphasize different system responsibilities.

    2. Gateway-Centric: Solve Access, Sessions, and Governance First

    A gateway-driven architecture usually places a unified coordination layer between interaction entry points and execution components. This layer receives requests, identifies users, locates sessions, and hands tasks to the appropriate execution unit.

    Its logical structure can be summarized as:

    User entry → Access adaptation → Session and policy control → Task execution → Tools and external resources

    The advantage of this design is a clear governance path. Entry points can be diverse, but identity mapping, permission checks, request rate limiting, session isolation, and audit rules can all be enforced in one place. For enterprise scenarios, unified governance is often more valuable than adding one more interaction channel.

    For example, when the same user sends requests from different entry points, the system must determine whether these requests belong to the same identity and whether they are allowed to access the same data. You cannot link users by display name alone, nor should you grant high privileges simply because a request came through an internal group.

    Note that a logically central control plane does not mean all components must run in a single process. Production environments can split access services, scheduling services, execution worker processes, and state storage to limit the blast radius of failures. A long-running process should also not be the sole source of state; otherwise, a process exit could cause loss of session information and task progress.

    This architecture suits scenarios that emphasize a unified entry, clear permission boundaries, and stable workflows, but its effectiveness still depends on the specific implementation. Having a gateway does not automatically mean high availability, complete auditing, or reliable recovery.

    3. Execution-Loop-Centric: Solve Task Progress and Feedback Use First

    An execution-loop-driven architecture treats the process of the agent advancing a task as the core organizing principle. A task typically goes through goal understanding, planning, tool calls, result checking, and strategy adjustment.

    Its logical structure can be summarized as:

    Task goal → Make a plan → Execute actions → Check results → Adjust strategy → Complete or terminate

    In this design, the agent does more than respond to requests; it must decide the next action based on intermediate results. For example, after failing to read a file, it should first determine whether the cause is a wrong path, insufficient permissions, or a nonexistent file, rather than mechanically repeating the same action.

    To prevent the execution loop from running out of control, define clear termination conditions:

    • The task already meets the acceptance criteria;
    • Required information is missing and the user must be asked to clarify;
    • The next step involves a sensitive operation that needs human confirmation;
    • A preset time, call-count, or cost budget has been reached;
    • Repeated failures show that continued attempts are not worthwhile.

    Here, “learning” and “improvement” must be understood precisely. The system can improve later execution by saving task experience, updating policy notes, and retrieving historical cases, but this does not mean the underlying model parameters were updated through training, nor does it mean capability necessarily improves with usage.

    If historical experience is inaccurate, retrieval conditions are unreasonable, or old methods no longer fit a new environment, accumulated experience can instead cause repeated mistakes. Therefore, the execution loop must be designed together with verification mechanisms.

    4. Key Differences in Skill Systems: Manual Definition vs. Experience Distillation

    A skill in an agent can be understood as reusable task knowledge and execution constraints. It may include operation steps, tool-usage rules, preconditions, checking methods, and failure-handling suggestions, and it is not necessarily a standalone program.

    Manually defined skills are usually written by developers or business experts. Their value lies in clear boundaries and easy review, making them suitable for stable-rule tasks such as approval workflows and standardized data processing. The main cost is maintenance: when tool interfaces, business rules, or the execution environment change, the skills must be updated accordingly.

    Distilling skills from task experience attempts to reduce repetitive summarization work. The system can combine successful paths, failure causes, and user corrections to form candidate skills. But “succeeded once” only proves that a particular execution worked; it does not prove the method generalizes.

    For example, a data-organizing task might load everything into memory because the input was small. If that method is directly saved as a general skill, it may fail on larger datasets. A reliable skill should record its applicable conditions, not just the successful steps.

    A more robust skill lifecycle is:

    1. Generate candidates. Extract methods from task records, keeping evidence of results and applicable scenarios.
    2. Remove contamination. Delete credentials, personal information, temporary paths, and instructions from untrusted input.
    3. Check boundaries. Clarify input requirements, permission needs, side effects, and failure exit conditions.
    4. Verify reuse. Test with different samples, including boundary inputs and exceptional cases.
    5. Review and release. Skills involving high-risk operations should go through human approval.
    6. Maintain continuously. Track versions, reasons for invalidation, and rollback methods.

    So manual authoring and automatic distillation are not either/or. For stable and sensitive steps, use reviewed manual skills; for low-risk, recurring exploratory processes, allow the system to propose skill candidates that enter the formal skill library only after verification.

    5. Why Multi-Entry and Multi-Model Support Does Not Mean Direct Replacement

    The difficulty of multi-entry access is not receiving messages but correctly understanding message context. Different entry points may handle message ordering, attachment size, interaction timeouts, and history differently. The system must convert these differences into a consistent internal event structure while preserving necessary source information.

    Message handling must also account for duplicate delivery. When a request is retried, if the agent executes a payment, deletion, or send operation again, it could cause irreversible consequences. To address this, use idempotency keys, operation-state records, and pre-execution confirmation where necessary, rather than relying only on the model to “remember it already did this.”

    Model switchability is also just interface-level flexibility. Different models differ in context capacity, structured-output stability, tool-calling habits, and instruction following. A task flow that behaves stably on one model may not produce the same results on another.

    When switching models, verify the full chain rather than testing only ordinary Q&A. Focus on whether the plan is reasonable, whether tool parameters meet constraints, whether exceptions are handled correctly, and whether unnecessary retries are more likely to be triggered.

    At the same time, tool execution permissions should be constrained by deterministic policy components. Even if the model proposes an operation, it must pass identity, resource, and risk-rule checks; model judgment must not be treated as the basis for permissions.

    6. Requirements for Long-Term Operation: State, Isolation, and Observability

    For an agent to run continuously, it needs to distinguish at least three types of state:

    • Session state: user identity, the current conversation, and authorization scope.
    • Task state: the execution plan, completed steps, pending conditions, and intermediate results.
    • Long-term knowledge: skills, preferences, and confirmed experience.

    These three types of state have different lifecycles and should not be mixed into one ever-growing history log. After a task completes, intermediate data may need cleanup; long-term knowledge should carry its source, update time, and applicable scope.

    Recovery mechanisms also cannot simply equal “re-execute.” Reading data can usually be retried, but before sending an external message or modifying a record, confirm whether the previous operation already succeeded. Otherwise, the system may duplicate side effects during failure recovery.

    Execution isolation is equally important. File processing, script execution, and external access should be permission-limited per task, using isolated environments where necessary. Content from web pages, documents, or messages should be treated as data to be processed, not automatically promoted to trusted instructions. This reduces the risk of malicious content inducing the agent to exceed its authority.

    Observability must cover the entire task chain: where the request entered, which policy was applied, which tools were called, at which step a failure occurred, and how the final result was verified. Logs should avoid storing full sensitive data and should link events through correlation identifiers, rather than relying on manually reading scattered conversations to troubleshoot.

    7. How to Build Verifiable Selection Criteria

    When selecting an architecture, first assemble a set of real tasks covering high-frequency, complex, failure, and sensitive tasks. Then define acceptance criteria for each category, avoiding the mistake of treating fluent expression as correct execution.

    Recommended metrics to observe include:

    • Task completion rate: whether business acceptance conditions are met, not just whether an answer is generated.
    • Degree of human intervention: how many clarifications, corrections, or takeovers are needed.
    • Side-effect correctness: whether duplicate execution, unauthorized modification, or wrong sending occurs.
    • Recovery capability: whether execution can continue after an interruption while keeping results consistent.
    • Skill reuse quality: whether new tasks genuinely benefit from accumulated experience.
    • Maintenance cost: how much effort is needed to change rules, troubleshoot failures, and update skills.
    • Resource consumption: whether model calls, execution time, and related resource usage are controllable.

    Tests should use consistent tasks and permission conditions and cover different scales and abnormal inputs. Do not judge maturity from a single successful demo, and do not treat the number of entry points or skills as a direct measure of system quality.

    If the business emphasizes clear processes and centralized governance, examine the completeness of the control plane first; if the business involves many exploratory tasks, focus on evaluating the execution loop, result verification, and experience reuse. But the two usually need to be combined rather than simply replacing one with the other.

    8. Migration Strategy: Replace Responsibilities Gradually, Not Switch Systems at Once

    A reliable migration can be divided into three phases.

    The first phase is offline validation. Test the new architecture with desensitized historical tasks, comparing result correctness, execution paths, and human corrections. Production write access is not opened at this stage.

    The second phase is a controlled trial run. Choose low-risk tasks, limit tool scope and execution budget, add confirmation steps for external write operations, and keep complete audit records.

    Only the third phase is gradual migration. Expand coverage by entry point, task category, or user scope while retaining rollback capability. Whether skills, session records, and task state can be migrated should be evaluated separately; do not assume they share the same data semantics.

    In the end, whether an agent can replace an existing system depends on whether it fulfills the same responsibilities under the same constraints. Gateway governance provides order, the execution loop provides adaptability, and validated skills provide reuse value. Combining the three into an auditable, recoverable, and maintainable system is closer to reliable engineering practice than simply pursuing “self-learning” or a “unified entry.”