AI Agent Batch File Processing: Test Results and the Truth About Self-Evolution
This article examines whether AI Agents can truly self-evolve across tasks, using a real-world batch file processing test as a benchmark. It compares two general-purpose Agent approaches on a 237-record user authentication dataset, highlighting differences in delivery cleanliness and engineering discipline, and shows why locally deployed lightweight models struggle with long-context consistency and tool-call stability. Readers will learn how to turn "evolution" into measurable engineering practice through task contracts, reusable skill templates, isolated sandboxes, automated acceptance checks, and retry mechanisms.
1. The Core Question: Can an Agent Really “Self-Evolve”?
Discussion around AI Agents has heated up over the past two years. Many people equate “writing code, executing it, and fixing errors autonomously” with “self-iteration and evolution.” From an engineering perspective, however, these two concepts must be separated:
- Runtime adaptation: During a single task, the Agent adjusts its strategy based on errors, logs, and return codes. This is a feedback loop within the task.
- Cross-task self-evolution: After completing a task, the Agent distills experience into reusable capabilities and automatically invokes them the next time it encounters a similar task. This is what comes close to “evolution.”
Most currently available Agent frameworks have the former, not the latter. True “evolution” requires three things to hold simultaneously: persistent memory, a reusable skill library, and a measurable regression verification mechanism. Without any one of them, so-called evolution is just a demo effect.
To make this clear, I designed an engineering task that is realistic enough yet deliberately “trivial” for a controlled test.
2. Test Task Design: A Typical Piece of “Dirty Work”
The task closely mirrors a data governance scenario in enterprises: there is a user authentication spreadsheet with 237 records, 176 of which contain download URLs for face authentication videos.
There are only three requirements, but each one is a trap:
- Process only records with video URLs and skip the rest;
- Preserve the original case of file extensions—videos have both lowercase and uppercase suffixes, and they must not be uniformly rewritten;
- Rename files following the “Name-IDNumber.Extension” rule, ensuring uniqueness to avoid overwriting files with the same name.
The difficulty is not in “downloading” but in detail consistency: missing one record, getting one suffix wrong, or failing to retry after an interruption will cause delivery to fail. The real cost of batch tasks often arises in the final verification step, not in the main workflow.
3. Comparison of Two Execution Paths
I used two general-purpose Agent approaches that are currently drawing attention (referred to as Approach A and Approach B; both are common industry technical routes, and this article does not point to any specific product) to perform the same task. The model side uniformly used general-purpose large models of the same tier, with costs on the order of 1 yuan, making them comparable.
Approach A: Script-Based Execution, Ready for Delivery
Approach A automatically writes and executes a download script. The final results:
- All 176 videos downloaded successfully, with no omissions;
- Naming strictly follows the “Name-IDNumber” convention;
- Case-sensitive suffixes are fully preserved and were not “conveniently unified”;
- The target directory contains only 176 video files, with no leftover scripts, logs, or temporary files.
This is critical: the cleanliness of the delivery directory is itself part of delivery quality. Downstream processes typically consume the directory directly, and any extra files can trigger mishandling.
Approach B: Task Completed, but With “Loose Ends”
Approach B also follows the code execution route. The video count, naming, and suffix handling are all correct, but the target directory has two extra leftover files: the download script and a copy of the data source.
The result is not a failure, but it does not meet formal delivery standards and requires an additional cleanup step. In engineering terms, this is “functionally correct, but with an incomplete contract.”
A More Notable Phenomenon: Local Small Models Fail Across the Board
Under the same task, I tried several types of lightweight models that can be deployed locally, and the results were generally unsatisfactory, manifesting in three main types of problems:
- Instruction decay: Only two of the three constraints can be stably remembered, most commonly dropping “preserve case”;
- Long-process instability: Skipping steps mid-loop in batch processing, repeated downloads, and no retry on failure;
- Unreliable structured output: Errors in table parsing and field mapping, leading to incorrect name concatenation.
The conclusion is not that “local models are useless,” but rather: this type of task demands high long-context consistency + tool-call stability. Beyond their cost advantage, small-parameter models need additional engineering guardrails.
4. Why These Differences Occur: Three Engineering Dimensions
1. Task Planning Capability
Strong models tend to “read the data first, define the strategy, then execute,” proactively sampling fields for completeness and anomalies; weak models tend to jump straight in, lacking upfront validation.
2. Tool-Use Discipline
Whether to write temporary files, whether to place intermediate artifacts in the delivery directory, and whether to use idempotent writes—these are not about whether the model is “smart,” but about whether it has been constrained.
3. Self-Check and Rollback
Mature approaches perform a self-check at the end: count reconciliation, naming regex validation, suffix whitelist validation, and retry of failed items. Without self-checking, there is no closed loop.
5. Putting “Evolution” into Engineering: Reusable Practices
If you want an Agent to become more reliable on similar tasks, don’t expect it to “figure it out” on its own. Instead, solidify experience into external assets:
Task contract (clear inputs/outputs/acceptance criteria)↓Skill template (reusable script skeleton + parameter validation)↓Execution sandbox (isolated working directory, no pollution of the delivery directory)↓Automated acceptance (fourfold check: count/naming/suffix/uniqueness)↓Failure retry and human fallback
A minimal acceptance logic example:
import re, os, csvPATTERN = re.compile(r"^[\u4e00-\u9fa5A-Za-z·]+-\d{17}[\dXx]\.(mp4|MOV)$")def verify(deliver_dir, csv_path):files = [f for f in os.listdir(deliver_dir)]bad = [f for f in files if not PATTERN.match(f)]expected = sum(1 for r in csv.DictReader(open(csv_path, encoding="utf-8"))if r.get("video_url"))return {"expected": expected, "actual": len(files),"naming_errors": bad, "extra_files": len(files) - expected}
By integrating this validation into the pipeline, whether an Agent is “evolving” becomes measurable: when the same task is repeated, do the number of naming errors, omissions, and extra files in the directory decrease monotonically?
6. Practical Recommendations Checklist
- Define the contract before pursuing intelligence: Write acceptance criteria as executable checks, not natural-language wishes.
- Isolate the workspace: Write all intermediate artifacts to a temporary directory; allow only finished products in the delivery directory.
- Enforce idempotency: Support resumable downloads and overwrite policies for downloads and writes to avoid duplicates and partial products.
- Suffix whitelist: Perform enumerated validation on extensions rather than concatenating strings and writing directly to disk.
- Cost-controlled model tiering: Use general-purpose large models for the main workflow, and lightweight models or pure rules for repetitive validation.
- Observability: Log return codes and elapsed time for each step to help determine whether an issue is a model problem or a network problem.
- Prioritize data compliance: When handling sensitive information such as faces and ID numbers, use encrypted transmission, least-privilege access, and access auditing; when necessary, use object storage permission controls and logging services to maintain records.
7. Conclusion
Back to the original question: can an Agent self-iterate and evolve? The answer is—within a single task, it does self-correct; cross-task evolution must be provided by you through the trio of memory, skills, and verification. In this test, both approaches completed the task at the functional level; the gap was reflected in delivery cleanliness and engineering discipline. Meanwhile, the failure of local lightweight models reminds us: capability boundaries should be filled with guardrails, not with expectations. Engineering the acceptance criteria is the correct path to making an Agent more reliable with use.
