AI Agents in Practice: From Beginner to Advanced

    This guide explains why a language model that can answer questions still cannot deliver finished work, and how an execution harness, tool plugins, and clear operating modes close that gap. It covers choosing between standard, pipeline, minimal, and creative modes, turning a pile of raw files into a verified report, keeping long tasks stable with externalized state, splitting work across multiple agents, and embedding security controls directly into the workflow. Readers will come away with a repeatable method for designing "propose task, check execution, correct delivery" loops rather than memorizing commands.

    1. Why “Being Able to Answer” Is Not “Being Able to Deliver”

    Over the past two years, the capability boundaries of large language models have been discussed repeatedly. Yet when teams move into production, they run into the same gap: a model can write a well-structured plan but cannot land that plan in files, spreadsheets, and code repositories. The problem is not the model itself. It is that the model lacks an execution scaffold.

    The industry usually calls this layer a harness. Its job is to turn the model’s decisions into action sequences that are observable, rollback-able, and reusable. The relationship can be summarized in one line:

    1. Agent = Model (decision brain) + Harness (execution scaffold) + Tools (tools and permissions)

    The model decides “what to do next.” The harness answers “how to do it, how far it has gotten, and what to do when it fails.” Understanding this division of labor is the first threshold on the way from beginner to advanced.

    2. The Architecture Philosophy of an Execution Harness: Everything Is a Plugin

    Mature harnesses generally adopt a plugin-based design, abstracting capabilities such as file read/write, terminal commands, retrieval, browser access, and code execution into a unified registered tool interface. This design yields three direct benefits:

    • Replaceable capabilities: adding a new storage backend or retrieval method requires no change to the decision logic.
    • Narrowable permissions: each tool declares the permissions it needs independently, which makes least-privilege authorization straightforward.
    • Auditable behavior: every tool call naturally produces a log, providing a basis for tracing.

    For users, this means you do not need to memorize where a button sits in some interface. Your effort should go into “how to break down the task” and “how to define acceptance criteria.” That methodology transfers across versions and does not break as interfaces iterate.

    3. How to Choose Among Four Operating Modes

    Different tasks place very different demands on determinism, cost, and flexibility. Common frameworks generally offer four modes:

    Mode Characteristics Suitable Scenarios
    Standard Fullest capabilities, interactive progress Exploratory development, difficult troubleshooting
    Pipeline Predefined steps, batch and unattended Batch conversion, scheduled reports
    Minimal Smallest toolset, fast responses Unit testing, behavior verification
    Creative Allows custom tools and flows Secondary framework development

    The practical recommendation: first use minimal mode to verify that prompts and acceptance criteria are stable, then switch to standard mode for the main work, and finally use pipeline mode to lock down the repetitive parts. Skipping verification and going straight to a pipeline is the most common root cause of long-task failure.

    4. Turning “A Pile of Material” Into “One Report”: An Office Scenario

    Take organizing source material as an example. Loose, open-ended prompting usually produces a generic summary. The reliable approach is to define a deliverable contract first, then let the agent execute:

    1. Task: consolidate 12 meeting notes under data/ in the workspace into a quarterly report
    2. Deliverables: report.md (three-level heading structure) + summary.csv (decisions, owners, due dates)
    3. Constraints: use only files inside data/; annotate the source filename for every conclusion; do not infer numbers that do not appear
    4. Acceptance: CSV row count equals the total number of decisions; spot-check 3 conclusions against the original text

    Three advanced techniques that are easy to overlook:

    1. Build the index before writing: have the agent first output a file list and a key-point mapping table, confirm it manually, and only then generate the body text. This significantly reduces hallucination.
    2. A template is a constraint: putting an existing report template into the workspace is more stable than describing the format in a prompt.
    3. Deliver in segments: produce output chapter by chapter and accept each segment, avoiding the structural drift caused by generating long text in one pass.

    5. Stability for Long Tasks: Resume Points and Externalized State

    Failures in complex tasks are often not capability problems but context loss. The general engineering solution is to separate state from the conversation and write it into an external checklist file:

    1. task: quarterly_report
    2. steps:
    3. - id: collect
    4. status: done
    5. - id: extract
    6. status: done
    7. - id: draft
    8. status: running
    9. - id: verify
    10. status: pending

    Write back the status and artifact paths after each step is completed. When a run is interrupted and restarted, it resumes only from the unfinished nodes. Combined with idempotent design (repeated execution produces no duplicate files), this delivers stable long-running behavior.

    6. Multi-Agent Collaboration and Division-of-Labor Boundaries

    When a task can be parallelized, splitting roles works better than stretching a single context. A common split is “researcher, writer, reviewer”: the researcher only collects material and annotates sources, the writer only produces the text, and the reviewer only performs consistency checks. The key constraint is that roles pass information through files rather than conversation, which prevents contexts from polluting each other. Also set up a consolidation node to arbitrate conflicting conclusions in one place.

    7. Security Controls Must Be Built Into the Flow

    The risk of an execution-type agent comes from the fact that actions really happen. Three bottom lines cannot be skipped:

    • Least-privilege file access: restrict writable directories and prohibit out-of-bounds access to system paths.
    • Human confirmation for high-risk actions: deletion, overwriting, external sending, and production environment changes require explicit confirmation.
    • Full-chain traceability: record the input, output, and elapsed time of every tool call to support retrospectives and clear accountability.

    8. Capability Transfer: From Tool User to Process Designer

    The capability with lasting value is not memorizing a startup command. It is mastering the closed-loop design method of “propose a task, check execution, correct the deliverable”: turning vague requirements into an acceptable contract, cutting a long flow into resumable segments, and moving risk control forward into permissions and confirmation mechanisms. Once you have this method, whether the work is office organization, industry research, data analysis, or coding and site building, you can quickly build stable, operable automation workflows on top of general capabilities from cloud platforms such as Baidu AI Cloud, including object storage, container platforms, logging services, and monitoring and alerting.