AI Agents: From Answering Questions to Executing Tasks and Search Augmentation
This article explains the shift from conversational AI that only offers advice to AI agents that execute tasks and return results. It covers a four-layer capability architecture, key engineering concerns such as tool-call reliability, voice interaction, planning and memory, why general-purpose LLMs are unsuitable as search engines, and how retrieval-augmented generation with verifiable citations addresses factual hallucination. It also outlines a pipeline for turning source material into usable outputs and practical recommendations for safe deployment.
The core change described in the source material is not that models have become “better at chatting,” but that the interaction paradigm has shifted. Human-AI collaboration used to end with “getting advice”: users received the steps and still had to execute them themselves. Now the system is expected to turn advice directly into actions and return the results once those actions are complete. For developers, this moves the center of system design from prompt engineering toward an engineering discipline built around tool invocation, state management, and permission control. The discussion below is organized around three dimensions: capability layering, key technical components, and reliability design.
1. Capability Layers: From Content Generation to Transaction Execution
Such systems can be abstracted into four layers, decoupled from one another through explicit contracts so that “understanding” and “execution” are not mixed inside one giant prompt.
- Intent understanding layer: maps natural language to a structured intent, including the action type, target object, and constraints (time, budget, location, preferences).
- Planning layer: breaks a complex request into ordered subtasks to form an executable plan, with support for retry on failure and branch rollback.
- Tool execution layer: invokes external capabilities through standardized interfaces, such as common service categories for scheduling, orders, map routing, and payments.
- Result validation and feedback layer: performs consistency checks on execution results and presents the user with verifiable receipts and status.
The “order a coffee, book a flight, plan a trip in one sentence” examples from the original text all map to the same architectural pattern: intent slot filling + multi-turn clarification + tool orchestration. The only differences lie in the complexity of the slot structure and of the external dependencies.
{"intent": "book_table","slots": {"date": "2026-01-08T19:00:00+08:00","party_size": 4,"location": "user_current_city","constraints": ["quiet_area", "window_seat"]},"required_confirmation": true}
2. Key Technical Components
2.1 Reliability of Tool Invocation
Tool descriptions must clearly state the input and output schemas, side effects, and idempotency. Any operation involving funds or irreversible changes must introduce a second confirmation and an idempotency key to prevent duplicate orders.
POST /task/executeIdempotency-Key: <uuid>{"tool": "create_order","args": { "sku": "...", "qty": 1 },"confirm_token": "<short_lived_token>"}
2.2 Voice Interaction Pipeline
“Imitating a real person’s voice to make a phone call” is technically a combination of speech synthesis and dialogue state tracking. The real engineering difficulty is latency and interruption handling: time to first audio packet, silence detection, and state rollback when the user interjects. On the compliance side, the other party must be clearly informed that the interaction is automated, which is an indispensable part of product design.
2.3 Planning and Memory
Long-running tasks need externalized memory that writes intermediate state into structured storage rather than stuffing it into the context. A common approach is to maintain a state machine per task, where nodes contain pending items, completed items, failure reasons, and retry counts.
3. Factual Hallucination: Why General-Purpose LLMs Are Not Search Engines
Using a general conversational model directly as a retrieval tool fails at the root because its training objective is to generate fluent text, not to verify facts. It has no real-time index, no source constraints, and no way to know “I don’t know.” The engineering solution is to fully separate generation from retrieval.
- Retrieval-augmented generation: first recall document fragments, then have the model answer based on those fragments, with citations required in the output.
- A dedicated retrieval pipeline: query rewriting, multi-way recall, reranking, deduplication, and freshness filtering.
- Verifiable citations: bind each conclusion to a source fragment identifier, with one-click tracing in the frontend.
- Refusal mechanism: when recall confidence falls below a threshold, return “insufficient material” instead of fabricating an answer.
def answer(query, top_k=8, threshold=0.35):rewritten = rewrite(query)docs = hybrid_recall(rewritten, top_k=top_k) # keyword + vectordocs = [d for d in docs if d.score >= threshold]if not docs:return {"text": "Insufficient material; consider broadening the retrieval scope", "citations": []}resp = generate(query, context=docs, require_citation=True)return {"text": resp.text, "citations": [d.id for d in docs]}
The value of an authoritative corpus lies in traceability and versioning. At the infrastructure level, this typically involves object storage for original documents, a logging service to record the retrieval pipeline, and monitoring and alerting to track changes in recall rate and refusal rate.
4. Turning Material into Usable Output
Converting material into a finished product is essentially a templated generation pipeline: first perform structure extraction (sections, concepts, entity relations), then render in the target format. Mind maps correspond to hierarchical structures, briefings to summary compression, quiz questions to entity and relation extraction, and posters or illustrated posts to layout templates plus content filling. The engineering point is to decouple templates from content, so the same structured intermediate result can be reused across multiple output types instead of writing separate generation logic for each format.
In related practice at Baidu AI Cloud, such systems are typically composed of three parts—model services, retrieval services, and task orchestration—combined with permission and audit capabilities to control the safety boundary of automated actions.
5. Deployment Recommendations
- Start with read-only tools, then open write operations, gradually expanding the scope of automation.
- Keep human confirmation and a withdrawal window for all irreversible actions.
- Build an offline evaluation set to continuously measure intent accuracy, task completion rate, and citation correctness.
- Treat refusal as a normal capability rather than a defect.
Summary: in the move from answering questions to executing tasks, the competitive point has shifted from model fluency to engineering reliability; and the key to getting “search” right is separating the responsibilities of retrieval and generation while keeping sources verifiable.
