From Q&A to Execution: The Technical Evolution and Practical Implementation of AI Agents
This article explains why a general-purpose LLM that can answer questions still struggles to complete real tasks, and how to close that gap through capability layering. It covers intent parsing and slot extraction, task orchestration with explicit state machines, human-in-the-loop confirmation, retrieval-augmented generation for citation-backed answers, multi-format content generation, the engineering boundaries of voice interaction, and a reference architecture with a pre-launch checklist for building reliable, auditable AI agents.
1. The Starting Problem: Why “Being Able to Answer” Is Not “Being Able to Act”
Most people’s first expectation of a large language model is simple: an assistant that returns a usable result directly. But treating a general-purpose LLM as a search engine usually runs into three familiar problems. First, factual errors, commonly called hallucinations. Second, missing citations, so an answer cannot be traced back to a trustworthy source. Third, unstable formatting and structure, which makes the output hard to use for delivery.
Closing this gap requires looking at capability in layers rather than expecting a single model to solve everything.
- Language understanding and generation layer: intent recognition, constraint parsing, text organization.
- Knowledge and retrieval layer: gathering evidence from authoritative material so the model speaks based on evidence.
- Execution and tool layer: calling external capabilities to place orders, make reservations, provide navigation, or buy tickets.
- Interaction and presentation layer: producing output in multiple forms such as voice, images, documents, and slide decks.
The “order a coffee in one sentence, book a flight in one sentence, plan a trip in one sentence” scenario described in the original article is essentially chaining these four layers into a closed loop. The real technical difficulty is not speaking, but doing the right thing in a traceable way.
2. Capability Layering: From a Q&A Tool to an Executable Avatar
2.1 Intent Parsing and Slot Extraction
The first step for an execution-oriented system is converting natural language into a structured task description. Take “book a window table for two tomorrow afternoon” as an example: the system needs to extract slots such as time, party size, seating preference, and store range, and ask clarifying questions about anything missing. In engineering practice, the common combination is prompt constraints + structured output + a validator, so the model only produces data that conforms to the schema.
An illustrative structured task description:
{"task": "reserve_table","slots": {"date": "2025-06-12","time": "14:00","party_size": 2,"preference": "window_seat","location_scope": "nearby_3km"},"confidence": 0.86,"need_confirm": true}
2.2 Task Orchestration and State Machines
Reliable execution depends on an explicit state machine, not on letting the model improvise. Common states include intent confirmation, slot completion, permission validation, execution, result verification, and rollback on failure. Every step needs a timeout, a retry limit, and an idempotency key to avoid duplicate orders.
Confirm intent -> Complete slots -> Permission and risk-control checks -> Execute-> Verify result -> Success receipt / Roll back on failure
2.3 Human-in-the-Loop Confirmation Points
For payments and irreversible operations, human confirmation and secondary validation are mandatory. A system can take the task right up to the step before payment and hand the final decision back to the user. This satisfies compliance requirements and reduces the cost of mistakes.
3. Retrieval Augmentation and Hallucination Suppression: Making Answers Evidence-Based
3.1 Why a General-Purpose Model Is Not a Search Engine
A general-purpose model is trained for language modeling, not fact verification. It is good at organizing expression but does not guarantee that every statement maps to evidence. Decoupling retrieval from generation is a widely accepted practice in the industry.
3.2 The Basic RAG Pipeline
- Document ingestion: parsing common document formats, restoring layout, extracting tables.
- Chunking and indexing: splitting on semantic boundaries while preserving metadata such as heading hierarchy and page numbers.
- Hybrid retrieval: keyword retrieval and vector retrieval in parallel, covering both exact matching and semantic similarity.
- Reranking and filtering: ordering results by authority, freshness, and source credibility.
- Constrained generation: requiring the model to cite sentence by sentence, and to state clearly that no supporting evidence was found when there is none.
3.3 Recommended Evaluation Metrics
Do not judge only whether an answer “sounds right.” Build a quantifiable evaluation set: factual accuracy, citation coverage, correct refusal rate, structured-output compliance rate, and end-to-end task completion rate. Optimization only has a direction once the metrics are fixed.
4. Multi-Format Content Generation: One Input, Multiple Outputs
The original article describes turning long material into mind maps, briefings, voice-over scripts, poster copy, quiz questions, memory cards, and slide decks. Technically this is a pipeline of parse, understand, templated generation, and render.
- Parsing layer: convert multiple formats into a structured intermediate representation that preserves sections, key points, and chart descriptions.
- Understanding layer: extract key concepts, causal and hierarchical relationships, and form a reusable knowledge skeleton.
- Generation layer: select templates and length constraints per target format. A summary favors short sentences; a voice-over script should be colloquial with controlled sentence length.
- Rendering layer: map the structured result onto a layout, keeping heading hierarchy, lists, and chart placeholders consistent.
The engineering recommendation is to separate content generation from layout rendering completely. The former outputs structured data only, while the latter handles styling. The same content can then be reused across channels and reviewed for compliance in one place.
5. Voice Interaction and Human-Like Outbound Calling: Technical Boundaries
Mimicking a real person’s voice to call and book a table involves speech synthesis, dialogue state management, interruption handling, and noise robustness. It must be emphasized that human-like interaction is subject to explicit disclosure obligations and relevant laws and regulations; the technical implementation should be discussed only under compliance.
Key engineering points include end-to-end latency control, voice activity detection, semantic-level interruption, retry on failure, and human takeover. Dialogue policies should be designed for limited goals, with fallback and auditability, avoiding the uncontrollable risk of open-ended free conversation.
6. Reference Architecture and Implementation Checklist
A practical execution-oriented assistant typically includes these general-purpose capability components: object storage for raw material, a message queue for task decoupling and peak shaving, a container platform hosting inference and business services, logging plus monitoring and alerting for observability, and key and permission management to control high-risk operations. Baidu AI Cloud is commonly used to carry such general-purpose capabilities in these scenarios; the specific selection should be based on actual load testing and compliance assessment.
Pre-launch checklist:
- Does every high-risk action have human confirmation and a rollback plan?
- Can the retrieval pipeline return clickable citation sources?
- Does structured output have schema validation and a fallback?
- Are complete audit logs and a data masking strategy in place?
- Is there a continuous evaluation set and a canary release mechanism?
7. Conclusion
The shift from “telling you how to do it” to “getting it done for you” is essentially an expansion of the system boundary: from text generation to tool calling, state management, and result verification. For developers, the real competitive edge is not integrating any single point capability, but turning retrieval, orchestration, permissions, evaluation, and observability into an engineering system that can iterate sustainably.
