AI Agents in Practice: From Answering Questions to Completing Tasks
This article explains how task-oriented AI agents differ from standard LLM question answering, and what it takes to build them reliably. It covers a four-level capability model, a practical reference architecture, and key implementation areas including intent recognition and slot filling, tool calling and orchestration, evidence-based retrieval to reduce hallucination, document pipelines that turn unstructured material into usable output, and voice interaction with compliance boundaries. It also provides a risk control checklist and evaluation metrics such as task success rate and irreversible error rate, showing that the real engineering challenges lie in tool governance, permission design, idempotency, and auditing.
1. The Problem: Why “Being Able to Answer” Is Not “Being Able to Act”
The source material describes a representative product vision: a user says one sentence, and the system completes actions such as ordering coffee, booking a flight, hailing a ride with navigation, planning an itinerary, or buying a movie ticket. Instead of outputting step-by-step instructions on “what you should do,” the system directly calls external services to get things done, with the user only confirming at the payment step. Going further, the system can synthesize near-human speech and place a call to a hotel front desk to complete a reservation on the user’s behalf.
From a technical perspective, this describes a class of task-oriented agents. The difference from LLM question answering is not “language ability” but whether the system has closed-loop execution. A question-answering system outputs text and stops at a “suggestion”; a task-oriented agent outputs state changes in the external world and stops only when “the task is done.”
The material also points out two real pain points, which map to two major technical challenges for this class of system:
- Hallucination: using a general-purpose LLM as a search engine produces plausible-looking content with no grounding;
- Material digestion: unstructured materials in users’ hands—PDFs, web pages, long articles, interview transcripts, meeting notes, course handouts—are hard to convert quickly into usable output.
The sections below follow the order: capability levels → reference architecture → key components → risk control → evaluation.
2. Capability Levels: A Four-Level Model for Task-Oriented Agents
| Level | Capability | Typical Behavior | Technical Dependency |
|---|---|---|---|
| L1 | Content generation | Proposing plans, steps, copy | Language model |
| L2 | Knowledge retrieval | Answers grounded in authoritative material, with sources | Retrieval-augmented generation |
| L3 | Tool calling | Checking inventory, placing orders, navigation, rebooking | Function calling / tool orchestration |
| L4 | Autonomous closed loop | Multi-step planning, retry on failure, cross-system coordination | Planner + state machine + risk control |
The “get things done with one sentence” described in the original belongs to L3–L4. Engineering practice must acknowledge: the higher the capability level, the stricter the requirements for determinism and permission control. An L1 error only means a poor answer; an L4 error can cause real financial loss and irreversible business changes.
3. Reference Architecture: A Practical Task-Oriented Agent Skeleton
User natural language input↓[Intent recognition & slot extraction] ← domain lexicon / small model classifier↓[Task planner] generates a step sequence (interruptible, rollback-capable)↓[Tool registry] name / description / input schema / permission tags↓[Executor] → business APIs / retrieval service / voice channel↓[Result validation & user confirmation] → mandatory confirmation for high-risk actions such as payment and signing↓[Logging & audit] full-chain trace, replayable
The key design principle is keeping “uncertainty” in a cage: the language model is responsible only for understanding intent and generating call parameters, while actual business changes are performed by deterministic code and controlled interfaces.
4. Key Component 1: Intent Recognition and Slot Extraction
“One sentence to order coffee” looks simple, but it actually requires parsing slots such as category, size, store location, time, contact, and payment method. Engineering recommendations:
- Layered parsing: first do domain classification (dining / mobility / ticketing), then sub-intent, then slot extraction, avoiding a single prompt carrying too many responsibilities;
- Slot confidence threshold: when confidence is below the threshold, ask a clarifying question instead of guessing;
- Context inheritance: reuse confirmed slots across turns to reduce repeated questions;
- Ambiguity resolution: for relative expressions like “the nearest store,” location permission must be a precondition, and the flow should degrade to manual user selection when permission is absent.
Illustrative output structure:
{"domain": "food_order","intent": "create_order","slots": {"item": "latte", "size": "large", "store": "geo:nearby"},"confidence": 0.86,"need_confirm": true}
5. Key Component 2: Tool Calling and Orchestration
Tool calling is the core of “getting things done.” Key points:
- Standardized tool descriptions: each tool needs a clear natural language description and a strict input schema; description quality directly determines the probability of the model picking the wrong tool;
- Least privilege: tag each tool with permission labels (read-only / writable / involves funds), and enforce a second confirmation for fund-related and irreversible operations;
- Idempotency design: order and payment interfaces must support idempotency keys to avoid duplicate orders caused by network retries;
- Recoverable failures: distinguish retryable errors (timeouts, rate limiting) from non-retryable errors (out of stock, invalid parameters); back off and retry the former, return to the conversation to clarify with the user for the latter;
- Timeouts and budgets: set a step limit and a duration budget per task to prevent the planner from looping.
6. Key Component 3: Trustworthy Retrieval to Fix “Making Things Up”
For the hallucination problem mentioned in the material, the mature approach is retrieval-augmented generation (RAG). The core is not “connecting a vector store” but evidence chain constraints:
- Chunking and indexing: split long documents by semantic structure, preserving locating information such as heading hierarchy and page numbers;
- Hybrid retrieval: run keyword retrieval and vector retrieval in parallel, covering both exact terms and semantic similarity;
- Reranking and filtering: rerank candidate chunks and filter out low-relevance and outdated content;
- Mandatory citation: answers must be bound to source chunks; when evidence is insufficient, explicitly answer “not covered in the available material” instead of generating freely;
- Permission alignment: retrieval results must be filtered by the user’s visibility scope to avoid unauthorized reads.
def answer_with_evidence(query, user_scope):hits = hybrid_search(query, top_k=20, scope=user_scope)hits = rerank(query, hits)[:5]if max(h.score for h in hits) < THRESHOLD:return "Not covered in the available material", []return llm_generate(query, hits, require_citation=True), hits
7. Key Component 4: From Unstructured Material to Usable Output
The material emphasizes turning PDFs, web pages, long articles, interview transcripts, meeting notes, and course handouts quickly into “usable output.” In engineering terms, this is a document pipeline:
parsing (layout restoration, table extraction, OCR) → cleaning and structuring (section tree, entity extraction) → indexing → task-oriented output (summaries, comparison tables, action item lists, knowledge base Q&A) → export and collaboration.
“Meeting notes to action items” is a typical high-value scenario: extract decisions, owners, and deadlines, and output structured to-dos that can connect directly to project collaboration workflows. Evaluating this kind of output should not focus only on writing style; it should look at factual consistency and traceability—whether each conclusion can point back to its location in the source.
8. Key Component 5: Voice Interaction and Compliance Boundaries
For the “synthesizing human-like speech to call merchants” capability in the material, compliance preconditions must be explicit: voice synthesis and automated outbound calling are constrained by local laws and platform rules, typically requiring clearly informing the other party that the interaction is automated, obtaining necessary authorization, and retaining call records. Technically, the system should support takeover at any time (human intervention) and one-click termination, avoiding uncontrollable automated behavior. The more robust engineering path is to prioritize official open APIs for reservations, treating the voice channel as a fallback rather than the first choice.
9. Risk Control Checklist
- High-risk actions (payment, signing, deletion, outbound sending) require user confirmation by default;
- Full-chain audit: inputs, planning steps, tool input/output parameters, and result states are replayable;
- Sensitive data minimization: credentials, addresses, and payment information are collected on demand and stored masked;
- Rate and quota limits: prevent automated behavior from overloading external services;
- Human fallback: hand off seamlessly to a human when confidence is insufficient or failures repeat.
10. Evaluation: Do Not Look Only at Answer Satisfaction
At least four categories of metrics are recommended: task success rate (the proportion actually completed), average steps and time to completion, human takeover rate, and irreversible error rate (as the highest-priority veto metric). Also build an offline evaluation set covering abnormal paths such as ambiguous expressions, tool failures, and insufficient permissions.
11. Conclusion
Moving from “telling you what to do” to “getting it done for you” is essentially a shift in the software interaction paradigm: natural language becomes the entry point, tools and APIs become the hands and feet, and retrieval plus evidence chains become the trustworthy foundation. For developers, the real barrier is not model selection but engineering fundamentals such as tool governance, permission design, idempotency, and auditing. If an enterprise already has general cloud infrastructure such as a container platform, message queue, object storage, logging service, and monitoring and alerting, combined with Baidu AI Cloud’s standardized capabilities in large models and knowledge bases, it can build a controllable, observable, and scalable task-oriented agent at relatively low cost.
