What is an AI Agent? Core Concepts and Engineering Practices Explained

    This article explains the core concepts of AI Agents, clarifying the boundaries between Large Language Models (LLMs), Agents, and workflows. It covers the fundamental components, common working modes, and distinctions between tool calling, access protocols, and skill encapsulation. Finally, it provides engineering best practices for building and deploying robust Agent systems.

    In AI technology discussions, “Agent” has evolved from an academic concept to a frequent term in engineering practices. However, when developers first encounter it, they often mistake Agents for “better chatbots” or label any automated process as an Agent. To accurately define an Agent, we must first understand the capability boundaries of Large Language Models (LLMs) and how Agents complement them with planning, memory, tool execution, and feedback loops.

    1. LLM vs. Agent: From Generation to Task Completion

    The essence of an LLM is to predict the next token based on context. Trained on massive amounts of text, it acquires language patterns, knowledge associations, and reasoning abilities. It excels at generating text, code, summaries, translations, and explanations. However, by default, its capabilities remain at the level of “generating suggestions.” In other words, an LLM can tell you how to book a flight or fix code, but it cannot directly complete the booking, open an editor, or run tests.

    This brings two typical limitations: first, LLMs lack execution channels to interact with the external environment; second, they lack a task loop to continuously observe results and correct actions. Agents emerge in this context. We can define an Agent from an engineering perspective: An Agent is a goal-driven software system capable of perceiving inputs and environments, making or adjusting plans, calling tools to execute actions, observing execution results, and iterating under constraints until the task is complete. It typically uses an LLM as its reasoning and decision-making core, but an Agent is not just an LLM. The LLM is part of the “brain,” while the Agent is a complete system including the brain, tools, memory, executor, and evaluator.

    A simplified Agent running loop is as follows:

    1. while not done:
    2. plan = llm.plan(goal, memory, available_tools)
    3. action = select_next_action(plan)
    4. result = runtime.execute(action) # permission check, timeout, retry, audit
    5. memory.append(observation(result))
    6. done = evaluator.check(goal, memory)

    This pseudocode reveals the key to an Agent: it does not generate an answer in a single pass but advances the task in a “plan-act-observe-correct” loop. The autonomy brought by the loop expands task coverage but also introduces uncertainty, cost, latency, and security risks. Therefore, engineering must be paired with constraint mechanisms.

    2. Agent vs. Workflow: Different Boundaries, Not Replacements

    Agents and workflows are often confused. Workflows are predefined, orchestrated, and highly deterministic processes, such as “receive request, validate parameters, call Service A, write to database, send notification.” The sequence, branching conditions, and exception handling of each step are usually explicitly defined by developers. Agents, on the other hand, emphasize dynamic decision-making: facing open-ended goals, they can choose the next action based on current observations and even adjust plans.

    Dimension Workflow Agent
    Process Control Developer-predefined Dynamic selection by model or strategy
    Determinism High Low
    Applicable Tasks Stable, enumerable, strict compliance Open, exploratory, hard to enumerate steps
    Failure Handling Explicit branching and compensation Re-planning after observation, requires extra constraints
    Engineering Focus Orchestration, idempotency, rollback Evaluation, permissions, trajectories, cost control

    The two are not mutually exclusive. In production systems, a more common pattern is “workflow as the skeleton, Agent as the node”: the main process is still controlled by deterministic orchestration, while Agents are introduced into branches that require natural language understanding, tool selection, or exception handling. This retains controllability while gaining a certain degree of autonomous decision-making capability.

    3. Core Components and Common Working Modes of Agents

    A deployable Agent typically includes: goals and instructions, a planner, a memory module, a tool layer, an executor, an observer and evaluator, and security strategies. Memory can be divided into short-term context and long-term knowledge; the tool layer is responsible for encapsulating external capabilities into callable actions; the evaluator is used to determine whether the task is complete and whether the results are trustworthy; security strategies handle permissions, data isolation, and human approval.

    Common working modes include: Reasoning-Action loop, which involves reasoning while selecting tools and observing results; Plan-Execute-Reflect, which generates a multi-step plan first, then reviews and corrects after execution; Multi-Agent Collaboration, where different roles take on retrieval, analysis, execution, and review respectively; Human-in-the-loop Approval, which pauses for human confirmation before high-risk actions; and Event-driven Long-running Tasks, which advance cross-session tasks through asynchronous messaging and state storage. The choice of mode should follow the risk and determinism requirements of the task, rather than pursuing “more autonomy is better.”

    4. Tool Calling vs. Tool Access Protocols vs. Skill Encapsulation

    Tool calling (function calling) is the fundamental mechanism for an Agent to connect to the external world: the model outputs structured call intents, the runtime validates parameters, executes the real function, and feeds the results back to the model. An example is as follows:

    1. {
    2. "name": "query_order",
    3. "description": "Query order status",
    4. "parameters": {
    5. "type": "object",
    6. "properties": {
    7. "order_id": {"type": "string"}
    8. },
    9. "required": ["order_id"]
    10. }
    11. }

    Tool access protocols solve the problem of “how to uniformly describe and connect tools, data resources, permissions, and calling methods.” They reduce integration costs, but the protocol itself does not make business decisions. Skill encapsulation is more business-oriented: it packages a set of prompts, tools, knowledge, constraints, and evaluation logic into a reusable capability unit, such as a “contract summarization skill” or a “log diagnosis skill.” The relationship among the three can be summarized as: function calling is a single-action mechanism, tool access protocol is a connection and description standard, and skill encapsulation is a business-oriented capability package.

    Inter-agent collaboration protocols are used for task delegation, capability discovery, message exchange, state synchronization, and conflict resolution among multiple Agents. In a multi-Agent system, more Agents do not necessarily mean better; role boundaries, message formats, failure retries, and security isolation must be designed in advance.

    5. Engineering Landing Recommendations

    When landing an Agent, priority should be given to establishing an evaluation set and trajectory logs, recording every plan, tool call, observation result, and final output to facilitate replay and troubleshooting. For high-risk tools, implement least privilege, whitelisting, human approval, and idempotent design. For long tasks, use asynchronous messaging, state storage, and timeout compensation. For cost and latency, set budgets and fallback strategies. For example, when deploying on Baidu AI Cloud, general categories like object storage, message queues, log services, and monitoring alerts can be used to carry state, trajectories, and asynchronous tasks. However, these are only runtime support and do not change the core logic of the Agent.

    To summarize in one sentence: An Agent is a software system that uses an LLM as its decision-making core, combined with planning, memory, tool calling, and feedback evaluation, to autonomously advance a task loop under constraints. Its difference from workflows lies in determinism versus dynamic decision-making, and its difference from LLMs lies in whether it possesses an execution and observation loop. Understanding these boundaries is more important than memorizing concept names.