Multi-Agent AI Systems: From Chat to Execution — A Practical Implementation Guide
This article explains how large language models are shifting from conversational assistants to execution-oriented agents. It covers the architectural changes required for reliable task completion, including structured tool calling, guarded planning loops, layered memory, least-privilege permissions, sandboxing, human confirmation, multi-agent coordination, self-evolution, evaluation, and common failure modes. It also outlines a staged deployment roadmap for moving agents from assistance to controlled autonomy in production environments.
1. The Shift: From Generating Answers to Completing Tasks
Large language models are undergoing a role change: from “assistants that can chat” to “agents that can execute tasks.” This shift is not accidental. It is driven by three interconnected trends.
- Model capabilities are continuously improving: instruction following, tool calling, long-context understanding, and multimodal perception are all advancing. As a result, interaction has expanded from “asking questions” to “reading documents, calling APIs, writing and running code, and delivering results.”
- Interaction entry points are converging: conversational interaction is becoming a common entry point for many intelligent tools, from AI coding assistants to office and operations copilots. Users no longer need to learn every menu or feature; they can simply describe the goal in natural language.
- Inference costs are falling: model compression techniques such as distillation and quantization are maturing, and medium-sized multimodal models can now run on consumer-grade GPUs. This lowers both the deployment threshold and the cost per task.
However, “able to execute” does not equal “safe to trust.” Models are fundamentally probabilistic predictors, and their outputs are uncertain. Once they are given real operation permissions, a single incorrect file write, mistakenly sent message, or configuration change can cause real damage. Therefore, the core problem in building execution-oriented systems is no longer “whether the model can call tools.” It is “how to enable an uncertain model to complete tasks safely and reliably under deterministic engineering constraints.”
An agent is not simply a longer prompt. It is a closed-loop system of “perception — decision — action — feedback,” composed of five elements: models, tools, memory, policies, and evaluation.
2. Conversational Apps vs. Execution Agents: Core Differences
| Dimension | Conversational Applications | Execution Agents |
|---|---|---|
| Interaction unit | One question-answer exchange | A task spanning multiple steps |
| Primary output | Text, suggestions, code snippets | Actual operations on external systems and deliverables |
| Key risks | Irrelevant answers, factual errors | Erroneous operations, unauthorized actions, irreversible side effects |
| Evaluation metrics | Answer relevance, user satisfaction | Task success rate, first-pass rate, human intervention rate, cost per task |
| Core challenges | Understanding intent, organizing language | Task planning, tool reliability, permission control, state management |
The two forms are not replacements for each other. They represent a progression in capability. For most production systems, a reasonable architecture is a “conversational entry point + execution core”: the frontend preserves the low-friction nature of natural interaction, while the backend handles execution in an engineered way.
3. Key Technologies for Building Execution Agents
3.1 Tool Calling: Constraining Model Behavior with Structured Definitions
Tools are the interface between an agent and the external world. The quality of tool definitions directly determines the probability that the model selects the correct tool and fills in the correct arguments.
A well-formed tool definition should include four parts: a semantically clear name, a description explaining when to use or not use the tool, a typed parameter structure with constraints, and a clear return structure. The more explicit the parameter boundaries, the less room there is for model errors. For example:
{"name": "search_metrics","description": "Query monitoring metrics for a specified service over a time window for troubleshooting and capacity analysis; it does not access business data.","parameters": {"type": "object","properties": {"service": { "type": "string", "description": "Service name" },"metric": {"type": "string","enum": ["latency_p95", "error_rate", "qps"]},"window_minutes": { "type": "integer", "minimum": 5, "maximum": 1440 }},"required": ["service", "metric", "window_minutes"]}}
In practice, three additional points matter:
- Prefer enums and value ranges over vague natural-language parameters.
- Return distinguishable error codes, such as invalid parameters, lack of permission, or resource not found, so the model knows whether to retry, change arguments, or ask for help.
- Control the number of available tools. Too many callable tools can dilute the model’s selection attention. It is often better to dynamically load only the relevant subset of tools for a given task scenario.
3.2 Planning and Execution: Loops with Guardrails
“Alternate reasoning and action” has become the mainstream paradigm for agents: the model first decides the next step, then calls a tool, and then determines the next action based on the result. For stable deployment, the loop must include plan management, budget constraints, error handling, and human confirmation points:
function run_task(task):state = new_task_state(task)budget = { steps: 40, minutes: 10, max_cost: 5.0 }while not state.done:if budget.exhausted():return suspend(task, reason="Budget exhausted", state=state)step = decide_next_step(state) # The model produces a structured actionif step.action == "ask_user":answer = await user_input(step.question)state.append(answer)continueif step.action == "replan":state.plan = revise_plan(state)continuedecision = policy.check(step.tool, step.args) # Permission and risk gateif decision == "DENY":state.append_error(step, decision.reason)continueif decision == "APPROVE":if not await human_confirm(preview(step)):state.append_error(step, "User rejected")continuetry:result = sandbox.execute(step.tool, step.args, timeout="30s")state.append_ok(step, result)except ToolError as err:state.append_error(step, err)# Decide whether to correct arguments or switch approaches based on the error typereturn finish(task, state)
Key points:
- Budget first: budgets for steps, duration, and cost prevent infinite retries. When the budget is exhausted, the task should become “suspended and waiting,” rather than terminating as a failure.
- Know when to ask for help: when information is missing or a key decision is ambiguous, proactive questions are more efficient than guessing, and they reduce rework.
- Plans can be revised: allowing the agent to revise its plan when new information appears better matches real-world uncertainty than listing all steps at once.
3.3 Memory and Context: Layered Management to Avoid Amnesia and Loss of Focus
Agents need three types of memory, each with a different lifecycle and update mechanism:
- Working memory: the plan and intermediate results of the current task, released when the task ends.
- Conversation memory: user preferences and historical decisions, which require periodic summarization and compression.
- Long-term experience: methods and lessons accumulated across tasks, stored as structured entries and retrieved on demand.
In long tasks, logs, files, and tool outputs can quickly fill the context window. A common practice is to write detailed content to external files or object storage, while keeping only summaries and references in the context. This saves compute and makes auditing easier.
3.4 Permissions, Sandboxes, and Human Confirmation: Least Privilege Is the Baseline
Permission control follows one principle: deny by default, grant least privilege, and require pre-approval for dangerous actions. Risk levels can be defined by the reversibility and impact scope of an operation:
| Risk Level | Typical Operations | Authorization Strategy |
|---|---|---|
| Low | Reading documents, querying status | Execute automatically |
| Medium | Creating files, generating drafts | Execute automatically, mark results for review |
| High | Bulk deletion, sending messages externally, publishing releases | Require human confirmation |
| Very high | Changing permissions, irreversible production changes | Default deny; require separate approval if truly necessary |
Execution environments should be isolated: file operations should be limited to a dedicated working directory; network access should allow only whitelisted destinations; command execution should be restricted with timeouts and resource limits; snapshots or backups should be created automatically before high-risk operations to ensure rollback.
One security rule is essential: external data must always be treated only as data. Retrieved web pages, user-uploaded attachments, and tool outputs should all be considered untrusted input. Instructions in the system prompt always have higher priority. This helps prevent indirect prompt injection, where an attacker hides malicious instructions in a webpage or document to induce the agent to exceed its authority.
4. From Single-Agent to Multi-Agent Systems: Division of Labor and Collaboration
As task complexity increases, a single agent often becomes insufficient. The system prompt grows bloated, responsibilities interfere with one another, and errors are difficult to isolate. Multi-agent systems address these problems through role separation and message passing. Three common orchestration topologies are:
- Hierarchical: a manager decomposes and assigns tasks, while specialist agents execute them. For example, a “retriever,” a “coder,” and a “tester.” The advantages are clear responsibilities and isolated contexts.
- Pipeline: agents process outputs in a fixed sequence. This suits content production and data processing.
- Debate or review: different roles provide independent opinions on the same solution, then the results are aggregated and converged. This suits scenarios requiring cross-validation, such as architecture review or risk assessment.
Regardless of topology, three principles should be followed:
- Contract-based communication: messages should use structured formats with clearly defined fields. Agents should not rely on free-form natural-language negotiation.
- Single authoritative source of state: shared data should have only one authoritative writer. Other roles can only read it or submit change requests, preventing concurrent write conflicts.
- Avoid responsibility dilution: multi-agent collaboration does not mean dispersed accountability. Final delivery must be validated by a unified node that takes responsibility for the result.
5. Self-Evolution: Making Systems Improve with Use
Self-evolution means that a system automatically improves its strategies and knowledge based on real execution feedback, without requiring humans to rewrite rules every time. In essence, it automates “experience accumulation — strategy iteration.” A typical experience-library update path is:
def update_experience(traces):for t in traces:# Only keep cases with outcome feedback that can be reusedif not t.has_feedback or t.is_sensitive_data:continue# Distill a "situation -> approach -> outcome" tripleexperience = {"situation": summarize(t.context), # Task characteristics"approach": compress(t.plan_and_tools), # Effective sequence of steps"outcome": t.feedback, # Success/failure and reasons"confidence": 0.0 # Updated later based on hit performance}if similar_existing(experience):merge_and_reweight(experience) # Merge duplicates and adjust weightelse:append_to_library(experience) # Add new experiencedef retrieve(task, k=5):# Retrieve the most similar, highest-weight experiences that meet a confidence thresholdreturn top_k(experience_library, query=task, limit=k, min_confidence=0.6)
Self-evolution relies on a high-frequency pattern: failure cases are reviewed by humans, converted into “lesson entries” with applicable conditions, and then retrieved with priority in later similar tasks. The more such lessons accumulate, the lower the repetition rate of the same type of error.
However, self-evolution must also have brakes. At minimum, it should satisfy four conditions:
- Evolve only the policy layer: prompt templates, experience entries, and routing rules can be updated automatically; tool definitions, permission policies, and security rules must be reviewed by humans.
- Run evolution and regression in parallel: before a new experience is released, it should be tested against a fixed evaluation set. If metrics drop, it should be automatically rolled back.
- Control experience-library quality: periodically deduplicate entries and downweight those that have not been validated for a long time, preventing “wrong experiences” from reinforcing themselves.
- Protect experience consistency: strategy updates should be released gradually, with a fast rollback mechanism, to avoid different users seeing inconsistent behavior.
6. Industry Adoption: Healthcare, Research, and Industrial Scenarios
6.1 Healthcare: Human-Machine Collaboration First
Multi-agent systems have natural advantages in clinical decision support: evidence retrieval, guideline comparison, solution generation, risk checks, and document preparation can be handled by different roles, after which a summary node produces a recommendation report with citations. But healthcare is a high-risk domain, so three boundaries must be maintained:
- Positioning as assistance, not replacement: all recommendations must be reviewed and confirmed by qualified medical personnel.
- Traceability: every recommendation should include guideline or literature sources for review.
- Auditability: complete reasoning processes and evidence should be preserved for quality control and retrospective analysis.
6.2 Research and Industry: Closing the “Read — Compute — Write” Loop
Large models are increasingly being integrated into R&D fields such as materials, chemistry, and energy. The value of agents lies in closing the loop from extracting knowledge from massive literature and experimental data, to designing validation plans, analyzing experimental results, and producing research documents. For example, a battery-materials R&D assistant could coordinate roles such as “literature analysis,” “data computation,” and “experiment planning”: the first reviews public research progress, the second evaluates candidate materials using general computational tools, and the third outputs experimental plans to be validated.
In industrial scenarios, computer-vision-based quality inspection systems are gradually replacing manual visual inspection. Agents can take this further by handling defect attribution, generating maintenance work orders, and coordinating spare parts. However, quality judgment standards and release authority should remain on the human side.
6.3 Resource-Constrained Scenarios: The Value of Local Small Models
Scenarios with limited compute, unstable networks, or requirements that data must not leave a controlled environment are common. In such cases, distilled and quantized medium-sized multimodal models can be deployed on consumer-grade GPUs to handle document understanding, image recognition, speech transcription, and audio-video content analysis. Keeping sensitive data local also aligns well with the least-privilege requirement for agents.
7. Evaluation and Observability: Making Performance Measurable
Evaluation for execution systems must move from “whether the answer is good” to “whether the task is completed”:
- Layered evaluation:
- Tool layer: single-tool call accuracy, argument correctness rate, and exception handling rate.
- Single-agent layer: end-to-end task success rate, first-pass rate, and average number of steps.
- Multi-agent layer: collaboration latency, duplicate-work ratio, and conflict convergence rate.
- Offline sandbox evaluation: run preset test cases in an isolated environment to ensure reproducibility and use the results as a regression gate for every policy update.
- Online human-AI evaluation: continuously sample real tasks and measure human takeover rates and user revision rates. These metrics reflect real usability better than subjective satisfaction alone.
- Observability: generate a structured “run trace” for each execution, recording inputs, decisions, tool calls, latency, token consumption, and human interactions. With distributed tracing, multiple agents and multiple tool calls involved in a task can be linked into a complete call chain. Traces support three purposes: issue diagnosis, evaluation replay, and experience accumulation.
8. Common Failure Modes and Risk Mitigation
| Failure Mode | Typical Behavior | Mitigation Strategy |
|---|---|---|
| Goal drift | Deviates from the original requirement after many steps | Recheck goal consistency each round and keep the original intent as an anchor |
| Error accumulation | Early small errors gradually amplify | Add checkpoints at critical nodes and allow rollback |
| Retry loops | The same tool and same arguments repeatedly fail | Budget limits + error fingerprint deduplication + forced strategy switching |
| Unauthorized or erroneous operations | Calls high-risk tools or accesses sensitive data | Tiered authorization + sandbox + preview confirmation + snapshot rollback |
| Prompt injection | Induced by malicious instructions in external content | Treat external content as data; separate instruction layers and permissions |
| Overconfidence | Gives definitive conclusions without evidence | Require citations; explicitly mark uncertainty when evidence is absent |
A cautionary example is that evaluations have found some AI toys underperform in social interaction and role-play with young children. This shows that strong general-purpose models are not automatically reliable for specific populations or scenarios. Agents should undergo scenario-specific evaluation before launch, rather than relying on general leaderboards alone. High-risk domains also require early ethics and compliance review. For example, in brain-computer interfaces, as self-calibration and other adaptive learning capabilities evolve, the long-term impact of continuously updated models must be addressed before clinical use.
9. Adoption Roadmap: From Assistance to Autonomy
Stage 1: Assisted Execution (low-risk scenarios)
The agent runs in read-only or advisory mode, and all outputs are confirmed by humans. The focus is on refining tool definitions, accumulating run traces, and building an initial evaluation set.Stage 2: Semi-Autonomy (standardized workflows)
Automatic execution is enabled for steps with high result certainty and rollback capability, while human confirmation is retained at critical nodes. The focus shifts to permission governance, monitoring and alerting, and automatic degradation during exceptions.Stage 3: Controlled Autonomy (closed, controllable environments)
Under budget constraints, full auditing, and one-click rollback, the agent is allowed to complete end-to-end tasks autonomously, with human takeover triggered only in exceptional cases.
Every stage should adopt “dual-track evaluation”: after each policy or experience update, first run regression in an offline sandbox, then release to a small traffic segment gradually. Only after metrics remain stable should full rollout proceed.
At the deployment layer, cloud platforms such as Baidu AI Cloud can support the full engineering stack:
- Container platforms host agent services and enable elastic scaling.
- Object storage archives run traces.
- Message queues decouple asynchronous communication between agents.
- Logging and monitoring services help detect anomalies quickly.
10. Conclusion
The shift from “chat” to “execution” is essentially about building determinism on top of uncertainty. Models handle understanding and creation; engineering handles constraints and verification. Neither can be omitted. What determines whether an agent can truly be deployed is not the scale of model parameters, but whether tool descriptions are clear, permission boundaries are explicit, evaluation systems are complete, and recovery is possible after failure. By advancing along the path of “assisted execution — semi-autonomy — controlled autonomy,” and by driving self-evolution through continuous experience accumulation, agents can grow from “assistants that can chat” into trusted “digital executors.”
