What Is an AI Agent? The Evolution from Model to Agent

    This article explains what an AI agent is and why a stronger model does not automatically produce a more capable system. It defines the three core properties of agents—agency, persistency, and interactivity—outlines a practical six-layer architecture with pseudocode, and compares the main paradigms: ReAct, plan-and-execute, and multi-agent collaboration. It also covers engineering essentials such as tool contracts, memory governance, least-privilege permissions and auditing, task-level evaluation, and cost and latency control, plus common pitfalls to avoid when moving from a demo to production.

    1. Starting Point: Why “Being Able to Chat” Is Not “Being Able to Get Things Done”

    Before discussing AI agents, it helps to clear up a common misconception: many people treat “a more capable model” as “a more intelligent system.” In reality, a model that performs sequence mapping based on statistical probabilities is essentially a stateless function. Given an input, it produces an output; unless you feed the history back into the context, it does not “remember” you. It has no clock, does not know what time it is, and cannot proactively modify any external system. It is closer to a “brain in a vat” trapped inside a server—smart, but with its hands and feet tied.

    This is exactly the point of an agent: it does not replace the model, but places the model inside a cognitive architecture, upgrading “being able to reason” into “being able to accomplish a goal.” This is the paradigm shift from Model to Agent.

    2. Definition and Core Properties: The Three Pillars of an Agent

    2.1 Agency: From Following Instructions to Pursuing Goals

    An ordinary conversation is one question and one answer; an agent is given a goal and decomposes the steps itself. Agency shows up in its ability to do multi-step planning, retry after failures, and proactively launch subtasks when information is missing, rather than waiting for a human to feed it instructions one by one. A practical test for whether a system has agency: hand it the final goal and see whether it can produce an acceptable result without step-by-step instructions.

    2.2 Persistency: State and Memory That Carry Across Turns

    Persistency has two layers: short-term working memory (intermediate conclusions of the current task, returns from tools already called) and long-term semantic/episodic memory (user preferences, past conclusions, reusable experience). In engineering, this is usually layered: “hot data” lives in the context window, “warm/cold data” lives in external storage, and it is loaded on demand through retrieval. Without persistency, an agent starts from zero every time and cannot demonstrate “learning something from one interaction and using it in the next.”

    2.3 Interactivity: Breaking the Fourth Wall with “Hands”

    Tool calling is the agent’s interface to the real world: querying databases, reading and writing object storage, publishing to message queues, triggering jobs on a container platform, calling log services to troubleshoot issues. Interactivity turns output from “text suggestions” into “executable side effects,” and at the same time raises the risk level from “saying the wrong thing” to “doing the wrong thing.” This directly determines the need for the permission and audit design discussed later.

    3. A Reference Architecture: A Deployable Agent Loop

    A clear implementation skeleton can be abstracted into six layers:

    1. Access layer: receives human instructions or system events (scheduled triggers, message queue events).
    2. Orchestration layer: task decomposition, plan generation, step scheduling, failure retries, and termination conditions.
    3. Reasoning layer: the large model handles understanding, planning, and decision-making, outputting a structured “next action.”
    4. Tool layer: wraps external capabilities into constrained interfaces with parameter validation and timeout control.
    5. Memory layer: working memory + vector retrieval + structured storage, responsible for state persistency.
    6. Governance layer: identity and permissions, audit logs, monitoring and alerting, cost and quotas.

    Illustrative pseudocode (expressing control flow only, not any specific API):

    1. def agent_loop(goal, max_steps=12):
    2. state = memory.load_or_init(goal) # Persistency: restore or initialize state
    3. for step in range(max_steps):
    4. plan = llm.decide(goal, state) # Reasoning layer: produce a structured action
    5. if plan.type == "final":
    6. return plan.answer
    7. result = tools.run(plan.tool, plan.args, timeout=30) # Interactivity
    8. state = memory.update(state, plan, result) # Write back to memory
    9. if not result.ok:
    10. state = plan.retry_or_replan(state, result.error)
    11. return fallback_report(state)

    What matters in this code is not the syntax but three constraints: the maximum number of steps (prevents infinite loops), tool timeouts (prevents external dependencies from dragging down the whole system), and the failure branch (treats exceptions as first-class citizens).

    4. Comparing the Main Paradigms: ReAct, Plan-and-Execute, and Multi-Agent

    • ReAct style (alternating reasoning and acting): each step is “think—call—observe,” flexible and intuitive to debug, suited to exploratory tasks; the downside is many steps and fast context growth.
    • Plan-and-execute: produce a complete plan first, then carry it out step by step, with strong controllability, suited to batch processing with clear flows; the downside is the high cost of replanning when the environment changes.
    • Multi-agent collaboration: split retrieval, coding, and review into roles that collaborate through message passing, improving division of labor on complex tasks; the cost is communication overhead and the risk of error propagation, requiring strict role boundaries and an aggregation/arbitration mechanism.

    Selection guidance: use ReAct when task uncertainty is high; use plan-and-execute when the flow is stable; introduce multi-agent only when a single role’s context and responsibilities are clearly overloaded, avoiding “architecture for architecture’s sake.”

    5. Engineering Essentials

    5.1 Tool Design: Contract First

    Tools are the agent’s hands and feet and must be designed as rigorously as a public API: explicit input schemas, parameter validation, idempotency keys, timeout and retry limits, and semantic error codes. High-risk actions (deletion, transfers, publishing) should be off by default and go through a second confirmation or human approval.

    5.2 Memory Governance: Layered and Invalidatable

    Long-term memory brings privacy and contamination problems. In practice, memory should carry “source, time, confidence,” support isolation by user dimension and one-click invalidation; at retrieval time, prefer structured filtering first and then semantic similarity ranking, reducing the interference of irrelevant recalls on decisions.

    5.3 Permissions and Auditing: Least Privilege Plus Full-Chain Traceability

    Since an agent can “take action,” you must assume it will make mistakes. Bind an independent identity and least privilege to each tool, write all calls into audit logs (who, when, with what parameters, with what result), and connect monitoring and alerting with thresholds for abnormal frequency, failure rate, and sudden cost spikes.

    5.4 Evaluation: From “Does the Answer Sound Right” to “Does the Task Get Done”

    Dialogue quality can be assessed by humans or model review, but agents must use task-level metrics: task success rate, average number of steps, tool call failure rate, end-to-end latency, cost per task, and human takeover rate. It is advisable to build a replayable offline test set and turn real failure cases into regression tests.

    5.5 Cost and Latency: Write the Budget into the Control Flow

    Multi-step loops naturally amplify token and call overhead. Common measures include: using small models for routing and initial screening, context compression and summarization, result caching, parallel tool calls, and dual limits on steps and budget. Treating “budget exhausted” as a normal termination condition and returning partial results is better than retrying indefinitely.

    6. Cloud Implementation: Composing General-Purpose Capabilities

    In a cloud environment, an agent is usually assembled from several general-purpose capability categories: a container platform hosts the runtime and elastic scaling; object storage holds intermediate artifacts and datasets; a message queue decouples tasks and enables event-driven flows; log services and monitoring/alerting provide observability; key and permission management keeps credentials secure. Baidu AI Cloud provides exactly this kind of general cloud infrastructure capability, on top of which you can build an agent system that meets your own governance requirements without being tied to a proprietary framework.

    7. Common Pitfalls and Conclusion

    Three frequent pitfalls are worth watching: first, treating “a longer context” as memory while ignoring retrieval and invalidation mechanisms; second, treating “being able to call tools” as reliability while ignoring idempotency and rollback; third, treating “multi-agent” as advanced while ignoring communication costs and error accumulation.

    Back to the original question: what is an AI agent? It is a goal-oriented software system with the model as its reasoning core, tools as its interaction boundary, memory as its time dimension, and governance as its security foundation. Once you understand these four boundaries, you have grasped the key dividing line between moving from a demo to a production system.