AI Agents: From Answering Questions to Executing Tasks
This article explains the shift of large language model applications from conversational Q&A to AI agents that can execute tasks. It covers the core architectural changes, four key capabilities—task planning, tool calling, memory management, and execution loops with self-verification—along with a reference architecture, engineering best practices, and common pitfalls for building reliable agents in real business environments.
1. From “Answering” to “Doing”: What the Paradigm Shift Really Means
Over the past two years, the mainstream form of LLM applications has been conversational Q&A: a user asks a question, and the model generates a piece of text. The value boundary of such applications is clear—what they output is “advice,” not a “result.” The core goal of the new generation of AI agents is to place the model inside a closed loop where it can perceive state, call tools, execute actions, and verify results, turning the output from “a paragraph” into “a completed task.”
This shift is not a simple prompt engineering upgrade; it is a restructuring at the system architecture level. It brings at least three changes:
- Evaluation criteria change: from text fluency and knowledge coverage to task completion rate, execution success rate, and rollback capability.
- Cost of failure changes: a wrong text answer can be ignored, but an execution error may produce side effects, making permission boundaries and auditing a hard requirement.
- Engineering complexity changes: it requires introducing traditional backend engineering capabilities such as state management, a tool gateway, retries and idempotency, and observability.
2. Four Key Capabilities That Enable “Doing”
2.1 Task Planning and Decomposition
An agent needs to break a vague goal into executable steps. Common approaches include generating a plan first and then executing it step by step, revising the plan while executing, and having an upper-layer scheduler divide work among multiple agents. From an engineering perspective, it is recommended to explicitly model the “plan” as a data structure to make persistence, replay, and human intervention easier.
{"goal": "Generate and archive the monthly data report","steps": [{"id": 1, "action": "query_data", "status": "done"},{"id": 2, "action": "render_report", "status": "running"},{"id": 3, "action": "upload_and_notify", "status": "pending"}],"rollback": ["clean_temp_files"]}
2.2 Tool Calling and Interface Governance
Tools are the hands through which an agent interacts with the real world. In practice, you should build a unified tool gateway that provides schema-based tool descriptions, parameter validation, timeout control, rate limiting, and auditing. The quality of tool descriptions directly determines calling accuracy; it is recommended to clearly specify input and output structures, side-effect descriptions, and applicable scenarios.
2.3 Memory and Context Management
The context window is limited, so long-running tasks must rely on external memory. This is usually divided into three layers: short-term session context, task-level intermediate artifacts (stored in object storage or a database), and retrievable long-term knowledge (recalled via vector retrieval). The key is to design proper write and eviction strategies to avoid context pollution.
2.4 Execution Loop and Self-Verification
The hallmark of “doing” is the ability to judge whether the task was actually completed. You can introduce rule-based validation, a second-pass model review, and automated regression based on monitoring metrics. On failure, retry or degrade according to predefined policies, and escalate to a human when necessary.
3. Reference Architecture and Engineering Practices
A deployable agent system typically includes an access layer (authentication and quotas), an orchestration layer (planning and scheduling), a capability layer (tools and retrieval), an execution layer (sandbox and container platform), a data layer (object storage, message queue, and logging service), and an observability layer (monitoring, alerting, and tracing).
Practical recommendations:
- Idempotency and retries: all operations with side effects must support idempotency keys to avoid duplicate execution.
- Sandbox isolation: place code execution and file operations in an isolated environment with restricted network and resources.
- Least privilege: grant the minimal tool set per task, and require secondary confirmation for sensitive operations.
- Full-chain traceability: record the plan, tool input and output, elapsed time, and results to facilitate review.
- Canary release and evaluation: establish an offline evaluation set and an online canary mechanism to continuously regress task success rate.
For a quick setup, you can leverage general cloud product capabilities such as the container platform, object storage, message queue, logging service, and monitoring and alerting offered by Baidu AI Cloud to build the infrastructure, focusing your effort on orchestration logic and the evaluation system.
4. Common Pitfalls
The first is over-pursuing autonomy while neglecting controllability; the second is rough tool descriptions that lead to incorrect calls; the third is the lack of rollback design, making recovery difficult after errors; the fourth is focusing only on demo effects while lacking quantitative evaluation. The solution is to design an agent as a distributed system, rather than as a longer prompt.
5. Conclusion
The shift from “answering” to “doing” is essentially the move of AI applications from content generation to process automation. Developers should focus on the four capabilities of planning, tools, memory, and closed loops, combined with sound engineering governance, to enable agents to reliably deliver results in real business environments.
