AI Agents: Concepts, Types, and Implementation Practice
AI agents are goal-driven systems that perceive context, break work into steps, call external tools, and revise their course from feedback. This article explains how they differ from chatbots and scripts, how language models, tools, and control loops fit together, and how to choose autonomy levels, design a runtime, evaluate results, and roll out actions from read-only to irreversible.
AI agents are not a simple upgrade of “programs that chat.” They are execution systems built around an explicit goal: they perceive the environment, decompose tasks, call external capabilities, and keep correcting themselves from feedback. A conversational model is strong at explanation and generation. An agent connects language understanding to an observable action loop. For enterprises and developers, the key question is not which product is “the strongest.” It is whether a task should be given to an agent, where the boundaries sit, and how failures are detected and corrected.
1. Definition and boundaries
A working agent needs at least four capabilities at the same time. It can understand the goal and constraints, break the goal into executable steps, change external state through tools, and decide from results whether to continue, retry, or stop. Without action and feedback, it is still a question-answering system. Without a goal and stopping conditions, it becomes an endless sequence of tool calls.
The difference from a chatbot shows up on the same request. If a user asks, “How should I arrange next week’s business trip?”, a conversational system returns a checklist and advice. If the user says, “Complete next week’s trip within budget and calendar constraints,” an agent should search candidate itineraries, check conflicts, produce a plan awaiting confirmation, and submit an order or send a confirmation only within its authorization. The difference is not writing quality. It is whether the system creates a traceable change in the outside world.
An agent is also not an automation script. A script follows fixed branches and fails when input falls outside those presets. An agent uses a language model to plan under uncertainty, so it is more flexible and also more likely to drift from the goal. Engineering controls—permissions, budgets, step limits, and human confirmation—have to keep that flexibility inside a cage.
2. Technical sources: language, tools, and the loop
Current agent capability comes from combining three general technologies, not from a proprietary label on one model.
The first is language understanding and initial reasoning from a large language model. It turns a natural-language goal into structured intent: what must be achieved, which constraints are hard, and which information is missing. It does not automatically possess live facts. External knowledge has to come from retrieval or tool results.
The second is tool calling. The model emits a structured tool name and arguments. The runtime then searches, reads or writes files, queries a database, calls an internal interface, or operates office documents, and injects the result back into context. Tools define the capability boundary. Without a booking interface, the system must not claim that a booking is complete. Without a code-execution environment, a patch that “looks correct” must not be treated as a verified fix.
The third is the plan–act–reflect loop. The system remembers completed steps, failure causes, and user preferences, and continues while the goal is unmet and stopping conditions have not been hit. Retries must differ from the failed attempt. Calling the same bad arguments again only wastes resources. The system should change the search criteria, narrow the scope, or escalate to a person.
A complete architecture is usually described in four layers:
- Perception: collect user input, files, page summaries, interface responses, and system events, then denoise them and filter by permission.
- Reasoning: form a plan, choose tools, estimate risk, and separate what may run automatically from what requires confirmation.
- Action: call tools with least privilege and record inputs, outputs, and elapsed time.
- Memory: keep the current trajectory in short-term memory, and store in long-term memory only preferences and facts that have been confirmed. One hallucination must not be written into a user profile.
3. Types by autonomy and collaboration
By degree of autonomy, agents fall into three types rather than a brand ranking.
Assistant agents show the plan at every step, and critical writes require human confirmation. They fit expenses, contract drafts, data queries, and similar work where responsibility is clear and the cost of error is moderate.
Workflow agents have the goal, tools, and success criteria defined in advance. The model judges only at branches. They fit ticket triage, report generation, and fixed checklists. They are predictable and are often the right first deployment.
Goal-driven agents receive only a goal and constraints, then decompose the work themselves. They fit open research and prototype exploration, but they need limits on steps, cost, and side effects. Otherwise they tend to over-call tools.
By collaboration style, there are single-agent and multi-agent systems. A single agent keeps one context and is easier to debug, which suits most business work. Multiple agents can split retrieval, execution, and review, which reduces overload in one context but adds lost messages, overlapping duties, and duplicate calls. Splitting pays off only when role boundaries are stable and the reviewer does not share the executor’s assumptions. A review agent should judge from test results, rules, and original evidence, not from the executor’s self-assessment.
Software development is a high-value setting, but there is no “automatically write the entire system” capability detached from an engineering environment. Useful work includes reading repository structure, locating failing tests, proposing small changes, running checks in an isolated environment, and generating a change description. The reliable part is repeatable feedback—builds, tests, and static checks—not a model claim that something is “fixed.” Bulk edits must stay inside explicit paths and a review process. Automatic commits should happen only on branches allowed by policy, with a rollback record retained.
General business tasks follow the same rule. When arranging travel, the agent should output candidates, price ranges, time conflicts, and unconfirmed items. Payment, ticket changes, and messages sent outside the organization are high-risk actions and should require human confirmation by default. A search result is evidence, not a completed booking.
4. Runtime design
A maintainable agent runtime should fix the following objects.
Task contract: the goal, success criteria, prohibited actions, deadline, maximum steps, and cost ceiling. Without success criteria, the loop cannot tell when to end.
Tool catalog: for each tool, state its purpose, parameters, whether it is read-only or a write, idempotency, and failure semantics. Register write tools separately from read-only tools. The model should not see descriptions of interfaces it is not allowed to call, or it will plan actions it cannot execute or is not authorized to perform.
Context policy: summarize raw pages and long logs before they enter reasoning, and keep citations and locations so results can be checked. A very long context is not a substitute for retrieval. Irrelevant history dilutes constraints.
State machine: at least distinguish planning, awaiting confirmation, execution, observation, completion, failure, and human takeover. Write an audit log on every transition. Classify failures: bad arguments may be retried, permission errors should stop the run, and an uncertain result must not be assumed successful.
A vendor-neutral sketch of one control loop is:
while not success and steps < limit and cost < budget:observation = perceive(inputs, tool_results)plan = reason(goal, constraints, observation, memory)if plan.needs_human:return wait_for_confirmation(plan)result = act(plan.tool, plan.args) # allowlisted tools onlymemory.record(plan, result)success = evaluate(result, acceptance)return report(success, evidence, open_questions)
The logic stresses three points: stopping conditions come before cleverness, the tool allowlist comes before action, and acceptance depends on evidence rather than the model’s own account.
5. Choosing how to apply agents
Start with task structure, then model capability.
If steps are stable and inputs and outputs can be checked, prefer a workflow agent. Use the model for classification, extraction, and explaining exceptions, and keep core state in the program. If the task is open but side effects are reversible, a goal-driven agent can draft work for a person to confirm before execution. If side effects are irreversible—payment, data deletion, or an external commitment—the agent should only prepare the plan and a description of the differences.
Software teams can place an agent inside the existing development loop: collect logs from an issue, propose a hypothesis, generate a minimal patch, and run the tests already in place. It replaces repetitive localization work. It does not replace design review or release responsibility. General office work fits a retrieve–draft–check pattern: summarize action items from meeting notes, fill a template, or list missing materials against policy. The policy itself should come from the enterprise knowledge base, not from model memory.
If the organization already has cloud foundations, object storage can hold source materials and audit trails, a message queue can decouple long-running tasks, a container platform can isolate code execution, and logs and monitoring can show step counts, failure rates, and tool latency. These are category-level supports. On Baidu AI Cloud, permissions and observability should still follow the same general runtime design. Business correctness should not be entrusted to an unpublished proprietary interface. Quotas, billing, and parameters follow the documentation of the services actually enabled and should not be invented in the design.
6. Evaluation, risk, and cost
Evaluate capability and safety separately. Capability covers task completion rate, step count, human takeover rate, and completeness of evidence. Safety covers unauthorized calls, false completion, leakage of sensitive information, and repeated charges. Public question-answering scores used in place of a business task set will overstate usefulness. Prepare cases with known answers or automatic checks: given constraints, can the agent find a conflict; after a bad tool response, can it stop; when permission is missing, does it honestly say the work is unfinished.
Risk concentrates in four places. Hallucinations written down as facts: every external claim needs a tool receipt. Goal drift: when a later user message conflicts with the initial constraints, merge the constraints explicitly instead of quietly replacing them. Memory pollution: unconfirmed inferences must not enter long-term memory. Prompt injection: instructions inside web pages, email, and files must not override system policy, and tool results must be treated as data, not as a new highest-priority command.
Cost is the sum of tokens, tool calls, and human review. Long loops need a budget. Substeps that retrieval or rules can handle do not all need the model. Parallel subtasks should start only when they do not depend on each other; otherwise duplicate retrieval multiplies. Observability should at least include the goal, the tool used at each step, elapsed time, failure type, and whether a person confirmed the outcome. Without that, the run cannot be reviewed, and it is impossible to decide whether to tighten autonomy or add tools.
7. Implementation order
Advance in three stages: read-only, reversible, then irreversible. In the first stage, only perceive and generate plans, and measure deviation against human results. In the second, allow writes that can be rolled back, such as drafts, code changes on a branch, and internal comments. Only in the third stage consider external actions, and keep confirmation points, limits, and a full audit trail. Regress each stage on the same task set instead of judging from demo cases alone.
Responsibility should also be explicit. The business owner defines success criteria. The platform team provides tools, isolation, and logs. The user is responsible for actions after confirmation. An agent amplifies execution. It does not transfer accountability.
Conclusion
The value of an AI agent is connecting language reasoning to controlled tools and results that can be accepted. Perception, reasoning, action, and memory describe structure. Assistant, workflow, and goal-driven agents, and single-agent versus multi-agent setups, describe autonomy and collaboration. General business work and software development can both benefit, but only when the goal is decidable, tools can be authorized, failure can stop the run, and the process can be audited. Narrow the action scope first, then expand autonomy on evidence. That is closer to maintainable engineering practice than a list of “products most worth using.”
