AI Agent Batch File Processing: Field Tests and Pitfalls to Avoid

    This article reports on a hands-on test of using AI agents for batch file processing, a repetitive task common in data compliance review, identity verification, and content moderation workflows. It explains how to turn a vague request into an acceptance-ready task card, compares two general-purpose agents that both completed 237 records (176 with face verification video links) but differed in delivery cleanliness, and shows why locally deployed small-parameter models failed on instruction following and state management. It closes with a reusable engineering checklist covering machine-executable verification, output directory purity, structured execution reports, retry and resume logic, and handling of sensitive fields.

    1. Background: Why Repetitive “Manual Labor” Fits Agents Well

    In business pipelines such as data compliance review, identity verification, and content moderation, one type of work keeps showing up: you hold a structured list of several hundred rows, each row carries a resource URL, and every entry has to be fetched, saved to disk, renamed according to fixed rules, and finally packaged for a downstream step. With 237 records, 176 of which contained face verification video links, clicking through each download and rename manually consumed an entire afternoon and was highly error-prone: missed downloads, duplicate names silently overwriting each other, extensions being normalized by accident, and no way to resume after an interrupted run.

    Tasks like this share three traits: the rules are explicit, the results can be validated automatically, and the work is highly repetitive. That places them squarely in the sweet spot of an AI agent, which can interpret natural-language constraints, write its own scripts, execute them, and self-correct. But there is still a gap between “getting it done” and “being able to deliver it,” and that gap is what this article is about.

    2. Test Design: Turning a Vague Request into an Acceptance-Ready Task Card

    To keep the comparison fair, the task card had to read like an engineering contract rather than a verbal request.

    The source data was a user verification table (CSV) with fields for name, phone number, ID number, and the video URL generated after face verification. Video extensions were a mix of .mp4 and .MOV, with inconsistent casing.

    Three core constraints:

    1. Process only rows with a valid video URL; skip and log empty values and dead links.
    2. Preserve the original extension casing exactly; do not normalize everything to lowercase.
    3. Target filenames must strictly follow “name-IDnumber.extension”.

    Implicit constraints had to be written into the task card too, otherwise acceptance would inevitably turn into an argument: only finished files may appear in the target directory; duplicate names must raise an explicit error instead of being silently overwritten; failed entries must be retryable; and the whole run must produce verifiable counts.

    A sample task card could look like this:

    1. Input: records.csv (fields: name, phone, id_no, video_url)
    2. Output directory: ./output
    3. Rules:
    4. - Skip rows where video_url is empty
    5. - Filename = "{name}-{id_no}{original extension}"
    6. - Keep extension casing identical to the URL
    7. - Fail immediately on duplicate name conflicts and list them
    8. - No scripts, logs, or copies of source data may remain in output
    9. Completion criteria: success count + skipped count + failure count == total valid rows

    3. Field Observations from Two Execution Paths

    Both systems under test were general-purpose agents in the form that draws the most attention right now, at iterations from around May 2025 and around v0.14 respectively, both running on the same low-cost general-purpose LLM, with a per-run cost on the order of 1 yuan. The differences therefore did not come from “model strength” but from the agents’ execution strategies and cleanup habits.

    The first path wrote its own download script, fetched files in concurrent batches, assembled filenames according to the rules, and ended with all 176 videos on disk, the count exact, .MOV and .mp4 casing fully preserved, and only the 176 finished files in the output directory, with no scripts, logs, or temporary leftovers. It was deliverable as-is.

    The second path also achieved the main goal: correct count, correct naming, correct extensions. But the output directory contained two extra files, the download script and a copy of the source data. That did not affect the videos themselves, yet it broke the “the directory is the deliverable” contract and would require an extra cleanup step in a production setting.

    Abstracting these two differences yields an important conclusion: the dividing line for agent capability is shifting from “can it finish the task” to “can it finish the task to delivery standards.” The former tests reasoning and tool use; the latter tests sensitivity to implicit contracts, which is engineering discipline.

    4. A Counterintuitive Finding: Why Local Small-Parameter Models All Failed

    When the same task was moved to locally deployed small-parameter models, the failures were uniform: either the downloads were incomplete, or the model “got clever” and normalized the extensions, or it lost task state midway and reprocessed the same row. The reasons are not mysterious:

    • Weak long-instruction adherence: with three hard constraints, it often retained only two.
    • Unstable tool calling and loop control: no retry strategy when hitting pagination, redirects, or timeouts.
    • No self-verification step: it never proactively performed a count reconciliation and “believed it had succeeded” even after failing.

    The practical recommendation is layered model selection: hand rule-following and multi-step tool orchestration to more capable cloud general-purpose models; where data residency is a hard requirement, a locally deployed option can be used, but the validation logic must be externalized into deterministic scripts rather than left to the model’s own diligence.

    5. A Reusable Engineering Checklist

    Regardless of which type of agent you use, a few things should be fixed in place.

    First, write acceptance criteria as machine-executable checks instead of relying on visual spot checks:

    1. import os, csv, re
    2. def verify(csv_path, out_dir, expected):
    3. rows = list(csv.DictReader(open(csv_path, encoding="utf-8")))
    4. valid = [r for r in rows if r.get("video_url")]
    5. files = os.listdir(out_dir)
    6. assert len(files) == expected, f"Count mismatch: {len(files)} != {expected}"
    7. for r in valid:
    8. ext = os.path.splitext(r["video_url"].split("?")[0])[1]
    9. name = f"{r['name']}-{r['id_no']}{ext}"
    10. assert name in files, f"Missing or misnamed: {name}"
    11. extra = set(files) - {f"{r['name']}-{r['id_no']}{os.path.splitext(r['video_url'].split('?')[0])[1]}" for r in valid}
    12. assert not extra, f"Unexpected files: {extra}"
    13. print("Verification passed")

    Second, state output directory purity explicitly in the task card: write scripts, logs, and temporary files to a separate working directory, and let the deliverable directory accept only final artifacts.

    Third, require the agent to emit a structured execution report: total, success count, skipped count, and a failure list with reasons, so reconciliation is fast.

    Fourth, add timeouts, retries, and resumable downloads to the fetching step; for object storage URLs, watch signature expiry and refresh them before batch fetching when necessary.

    Fifth, when sensitive fields such as ID numbers and phone numbers are involved, encrypt on write, transfer over encrypted channels, clean up intermediate copies promptly when the task ends, and keep only the minimum necessary audit logs.

    6. Conclusion: Grounding “Self-Iteration” in a Verifiable Loop

    Whether an agent is capable of self-improvement does not depend on demo quality but on whether it can close the loop of execute, verify, correct: errors can be detected, detection can be localized, and localization can be repaired automatically. In this test, both paths completed the main task and the gap showed up in engineering details such as delivery cleanliness, while the local small models exposed weaknesses in instruction following and state management.

    For developers and enterprise users, the pragmatic approach is to treat the agent as a capable executor that needs an explicit contract: constrain the input with a rigorous task card, guard acceptance with deterministic scripts, and control risk with directory and permission conventions. With those three in place, repetitive data organization work can genuinely be handed off with confidence.