AI Agent Architecture Evolution: From Foundational Patterns to Engineering Practice

    This article examines the evolution of AI agent architectures across four stages: planning-tool-memory loops, workflow and state-machine control, environment-driven autonomous execution, and governed task systems. It distinguishes model capability, agent architecture, and product form; explains the technical logic and limitations of each stage; and offers a selection framework based on task determinism, risk, and external dependencies. It also covers engineering requirements such as verifiable completion criteria, untrusted external input, execution budgets, auditing, human approval, and outcome-based evaluation, followed by a phased implementation path.

    As large language models improve at reasoning, code generation, and tool use, AI agents are moving from conversational demos to real business execution. They are no longer limited to explaining what should be done; within authorized boundaries, they must retrieve, analyze, modify, validate, and deliver.

    A common source of confusion in discussions of AI agents is treating model capability improvements, software architecture changes, and product experience upgrades as the same thing.

    In practice, they address different questions:

    • Model capability determines whether the system can understand a task, choose actions, and interpret feedback.
    • Agent architecture determines how tasks are decomposed, how state is stored, how tools are executed, and how failures are recovered.
    • Product form determines how users submit requests, view progress, approve operations, and receive results.

    A stronger model does not mean permission control, state management, and business validation can be omitted. A more usable interface does not mean the underlying system can execute autonomously and reliably.

    This article summarizes recent agent evolution into four stages. This is an analytical framework for understanding technical change, not an industry standard with unified time boundaries. Solutions from different stages coexist over long periods, and enterprises may combine them within the same system.

    1. Distinguishing Capability, Architecture, and Product Form

    The typical approach of early agents was to supplement a large language model with planning, tools, and memory so that the model could move from being a “text generator” to a “task executor.”

    The basic loop can be summarized as:

    Receive goal → form plan → select tool → obtain feedback → adjust action → output result.

    1.1 Planning addresses task decomposition

    Complex tasks usually cannot be completed in a single generation. For example, analyzing an abnormal business metric requires clarifying the metric definition, retrieving data, checking changes, finding causes, and forming a conclusion.

    A planning module attempts to express these steps explicitly. But a plan is only a hypothesis about future execution; it cannot replace actual verification. Data may be missing, tools may fail, and an analytical direction may be disproven by evidence.

    Reliable planning must therefore allow revision based on observations rather than mechanically executing the initially generated steps.

    1.2 Tools address access to external capabilities

    The model itself cannot directly access business databases, modify files, or submit business operations. It needs to interact with the external environment through controlled tools.

    Tool interfaces should clearly define inputs, outputs, permissions, and side effects. In particular, they should distinguish:

    • Read-only operations, such as retrieving documents or querying records;
    • Reversible operations, such as updating drafts or modifying temporary files;
    • High-risk operations, such as deleting data, changing permissions, or submitting payment-related requests.

    These actions should not share the same authorization policy. The fact that a model can generate parameters does not mean it has the right to execute the corresponding operation.

    1.3 Memory addresses information continuity

    Early designs often treated memory as “saving conversation history,” but from an engineering perspective it is necessary to distinguish at least:

    • Task state: current progress, completed steps, and unresolved issues;
    • Evidence records: retrieval results, tool return values, and their sources;
    • User preferences: expression habits or configurations confirmed for long-term use;
    • Experience summaries: handling methods validated in past tasks.

    These types of information differ in credibility, lifecycle, and access permissions. They cannot simply be mixed into the same history log.

    1.4 Main limitations of the basic loop

    The foundational pattern is clear and intuitive, but long-chain tasks tend to expose problems: plans drift from goals, tools are called repeatedly, errors accumulate gradually, and outputs may look complete while failing to meet acceptance criteria.

    The key reason is not “a missing module,” but a lack of explicit constraints on the execution process. The model makes decisions, but that does not mean the model should also be responsible for permission judgment, state maintenance, and result acceptance.

    2. Phase 2: Workflows and State Machines Improve Execution Determinism

    When agents enter enterprise business processes, stability often matters more than flexibility in a demo. Many systems therefore convert a fully open execution loop into a program-controlled workflow or state machine.

    2.1 Workflows are not the opposite of agents

    A fixed workflow defines steps, branches, and exception handling; the model handles parts that are difficult to express with rules, such as document understanding, information extraction, semantic judgment, or candidate generation.

    For example, contract material processing can be designed as:

    Receive materials → check completeness → extract key fields → validate business rules → flag risks → human review.

    Field extraction may depend on the model, but whether materials are complete, whether amounts satisfy rules, and whether human approval is required should be handled through deterministic logic wherever possible.

    This combination is not “falling back to traditional systems.” It limits uncertainty to a manageable range.

    2.2 State machines make task progress traceable

    A state machine expresses a task as explicit states and legal transitions, such as “pending execution,” “executing,” “waiting for approval,” “failed and awaiting recovery,” and “completed.”

    Compared with relying only on conversation history, it can answer more specific questions:

    • Where exactly is the task in execution?
    • Which actions have already produced external effects?
    • From which step should recovery begin after a failure?
    • Which states allow execution again?

    For tasks that write to external systems, these questions directly affect business correctness.

    2.3 Boundaries of deterministic approaches

    Workflows are suitable for scenarios with stable processes and clear acceptance criteria. But if a task requires exploring unknown paths, pre-designing all branches quickly increases maintenance costs.

    The choice is therefore not whether workflows are “advanced,” but whether task variability justifies autonomous decision-making. The clearer the process, the more deterministic control should be preferred; the more open the environment, the more room should be preserved for dynamic exploration.

    3. Phase 3: From Predefined Steps to Environment-Driven Autonomous Execution

    As models become better at handling complex instructions, understanding tool feedback, and continuously correcting behavior, agents begin to take on more dynamic decision-making.

    The architectural focus gradually shifts from “writing every step in advance” to “providing goals, environments, constraints, and acceptance methods.”

    3.1 Redividing responsibilities between model planning and program control

    This does not mean the planning module disappears entirely. Its implementation may change: some planning is generated dynamically by the model during execution, while the program limits the action scope, records state, and validates results.

    For a file-processing task, for example, developers do not need to predefine every modification path, but they do need to provide:

    • The range of accessible files;
    • Clear modification goals;
    • Executable checking methods;
    • Restrictions on external write behavior;
    • Rollback or manual handling mechanisms after failure.

    The model explores “how to complete,” while the runtime constrains “what may be done.”

    3.2 Context organization becomes a key engineering problem

    The amount of information in long tasks keeps growing. Submitting all history to the model as-is not only increases cost but may also drown key constraints in irrelevant content.

    A more reasonable approach is to organize information in layers:

    • Always retain the task goal, permission boundaries, and acceptance criteria;
    • Retain the complete operations and feedback from the most recent steps;
    • Compress completed stages into structured summaries;
    • Store large evidence bodies in external storage and retrieve them on demand.

    Summaries must preserve the sources of important conclusions. Model speculation must not be compressed into “confirmed facts.” Task state should also not exist only in summaries; it should have an independent, queryable record.

    3.3 Tool design matters more than tool count

    Adding more tools does not necessarily improve capability. Overlapping interfaces, vague descriptions, and verbose return results can all increase selection errors.

    High-quality tools should have a clear scope of application, strict parameter validation, identifiable error types, and return information sufficient for judging results.

    For write operations, it should also be clear whether they support idempotency, whether they are reversible, and how to confirm the actual execution status after a timeout. Otherwise, when the model retries under uncertainty, it may cause duplicate submissions.

    4. Phase 4: From a Single Agent to a Governed Task System

    When tasks need to run continuously, handle multiple business stages, or involve multiple people, the system focus shifts further toward scheduling, collaboration, auditing, and governance.

    The core of this stage is not “using more agents,” but forming an operable task execution system.

    4.1 Multi-agent collaboration requires clear division of labor

    Assigning analysis, execution, and checking to different roles may improve how complex tasks are organized, but more roles also bring communication costs, duplicated context, and ambiguous responsibility.

    Splitting is more valuable only when subtasks have clear boundaries, can be processed in parallel, or genuinely require isolated tool permissions.

    For example, material organization and data analysis can be carried out independently and then consolidated by a unified process. But simple field transformation does not need to be split among multiple roles for repeated discussion.

    A checking role cannot guarantee correctness by itself. If multiple roles rely on the same model and the same evidence, they may produce consistent errors. Important conclusions should still be verified through external data, programmatic validation, or human review.

    4.2 Long-running tasks must support recovery and auditing

    For tasks that run for a long time, critical state should be persisted rather than relying on process memory.

    At a minimum, the system should save the task identifier, current stage, tool call records, external changes already produced, approval results, and acceptance evidence.

    Only with these records can the system support checkpoint recovery, issue diagnosis, and responsibility tracing. When external side effects are involved, idempotency mechanisms, compensating operations, or manual handling are also needed. The system should not make broad promises of “automatic recovery after failure.”

    4.3 Human intervention is a normal control mechanism

    High-risk tasks should have explicit approval checkpoints. The approval content should not be a vague “continue or not,” but should show:

    • The specific operation about to be executed;
    • The operation target and scope of impact;
    • Relevant evidence and uncertainty;
    • Reversibility and exception handling methods.

    Approval results should be bound to specific operations. If parameters or the scope of impact change, the original approval should not be reused indefinitely.

    5. Choosing Among the Four Architectures: Task Characteristics, Not Conceptual Novelty

    Architecture can be judged from the following dimensions:

    Task characteristic More suitable design direction
    Fixed steps and clear rules Deterministic workflow; the model handles local semantic tasks
    Unfixed paths requiring exploration Bounded autonomous execution loop
    Independent parallel subtasks Collaboration architecture with clear division of labor
    High-risk operations that are not easily reversible Strong permission control, approval, and auditing
    Long tasks with many external dependencies Persistent state, recovery, and timeout governance

    Real systems often adopt a hybrid architecture: an outer workflow manages business stages, agents are allowed to explore within a stage, critical operations go through approval, and final results are accepted by independent validation logic.

    This design preserves both flexibility and controllability without forcing a choice between “fully automatic” and “fully fixed.”

    6. Engineering Capabilities Required Before Deployment

    6.1 Turn completion conditions into verifiable criteria

    “Provide a report” is not a sufficient acceptance condition. A better definition includes coverage scope, evidence requirements, calculation rules, output structure, and prohibited items.

    Whether a task is complete should be judged by acceptance criteria, not declared by the model itself.

    6.2 Treat external content as untrusted input

    Retrieved documents, web page text, email content, and tool return information may contain instructions intended to change the task goal.

    The system needs to distinguish control instructions from business data. External materials can provide factual clues, but they must not expand permissions, demand disclosure of sensitive information, or change approval rules on their own. Permission boundaries must be enforced by the runtime environment, not merely by prompt text.

    6.3 Set execution budgets and termination conditions

    Autonomous loops should limit the number of calls, runtime, and resource consumption, and identify repeated actions, prolonged lack of progress, and persistent failures.

    When the budget is exhausted, the system should save completed work, explain the blocking reason, and specify what information or manual action is needed, rather than retrying indefinitely.

    6.4 Evaluate by business outcomes, not answer quality alone

    Evaluation should at least focus on:

    • Whether the task is truly completed;
    • Whether tool selection and parameters are correct;
    • Whether unauthorized operations occurred;
    • Whether conclusions are supported by evidence;
    • Whether failures can be located and recovered;
    • Whether the cost per successful task is acceptable.

    The test set should also cover missing data, tool timeouts, insufficient permissions, malicious content, and uncertain execution results. Testing only happy paths cannot assess real reliability.

    First, select tasks with clear boundaries, low risk, and verifiable results, and define inputs, outputs, and success conditions.

    Second, run the loop end to end with a minimal process. Prioritize a small number of necessary tools, and establish task records, parameter validation, and result checks.

    Third, use failure samples to locate bottlenecks. Only add dynamic planning or exploration capabilities when fixed processes genuinely limit task completion.

    Fourth, add permissions, approval, recovery, monitoring, and cost control before gradually expanding business coverage.

    Fifth, validate each architecture upgrade through continuous evaluation. After adding memory, collaborative roles, or autonomous steps, confirm that the gains come from improved task success rates, coverage, or maintenance costs, not merely from making execution look more complex.

    Conclusion

    The evolution of agent architecture is essentially a continuous adjustment of the boundary between the model and the software system: the model takes on more semantic understanding and dynamic decision-making, while the engineering system takes on state, permissions, execution, and validation.

    The basic loop, deterministic workflow, autonomous execution, and collaborative governance are not four generations of products that replace one another. They are design methods for different problems. Mature technical selection is not about pursuing the “newest” architecture, but about using the minimum necessary complexity to balance business outcomes, execution risk, operating cost, and maintainability.