AI Agents for Batch File Processing: Can They Improve Through Iteration?
A hands-on comparison of two open-source agent frameworks tests whether AI agents can reliably download, rename, and organize 176 verification videos. The results highlight the importance of model quality, explicit delivery requirements, and automated validation—and distinguish task-level self-correction from lasting improvement across tasks.
1. The Task: Simple Requirements, Hidden Failure Modes
Batch file processing is common in data preparation and delivery workflows. It rarely requires complex reasoning, but it demands careful execution.
Consider a dataset containing 237 user verification records, 176 of which include download URLs for facial verification videos. The task is to download all 176 videos and archive them using the naming convention name-ID_number.extension.
This sounds like routine work, but it has at least three potential failure modes:
- Missing files: When records are processed individually, failed downloads can go unnoticed, leaving the final file count short.
- Extension handling: The source videos use both
.mp4and.MOV. Lowercasing every extension would violate the requirement to preserve the original extension casing. - Unwanted delivery artifacts: Scripts, logs, and temporary files can end up in the delivery directory alongside the finished files.
Structured, rule-based, repetitive work is well suited to AI agents. They can interpret requirements, generate code, execute it, inspect the results, and make corrections when something goes wrong.
2. Test Design: One Task, Two Frameworks
I tested two open-source agent frameworks attracting community attention, referred to here as Framework A and Framework B. Both received the same task.
The comparison focused on four criteria:
- Completeness: Were all 176 videos downloaded successfully?
- Naming compliance and preservation of extension casing.
- Cleanliness of the delivery directory.
- Execution approach, including code-based automation, and cost.
2.1 Framework A: Complete Downloads and a Clean Delivery
Framework A independently wrote and executed a Python script. Its core approach was approximately equivalent to the following:
import csv, os, requests, urllib.parsewith open("user_videos.csv", encoding="utf-8") as f:rows = [r for r in csv.DictReader(f) if r["video_url"]]for r in rows:ext = os.path.splitext(urllib.parse.urlparse(r["video_url"]).path)[1]filename = f"{r['name']}-{r['id_number']}{ext}" # Preserve original casingdownload(r["video_url"], os.path.join("output", filename))
The result met all delivery requirements:
- Completeness: All 176 videos were downloaded successfully.
- Naming compliance: Every filename followed the
name-ID_numberconvention. The original.MOVand.mp4extension casing was preserved. - Directory cleanliness: The output directory contained only the 176 videos, with no scripts, logs, or temporary files. It was ready for downstream use without additional cleanup.
The task ran on a lightweight open-source reasoning model, with a total inference cost of approximately RMB 1. In this test, both completeness and delivery quality met the requirements.
2.2 Framework B: Core Task Completed, Cleanup Still Needed
Framework B also generated and executed code. It successfully downloaded all 176 videos, with correct filenames and extension casing.
However, inspection of the delivery directory revealed two extra artifacts:
- The download script,
download.py. - A copy of the source CSV file.
These files did not affect the videos themselves, but they made the delivery directory noncompliant with the expected output standard. A formal handoff would still require manual cleanup.
Using the same lightweight open-source model, the inference cost was also approximately RMB 1.
3. Model Quality Sets the Execution Floor
An additional test exposed an important limitation. When the underlying model was replaced with a smaller locally deployed model, the task failed in almost every attempt. Failures included incorrect download logic, confusion over extension casing, and stopping before completion.
This suggests that an agent’s minimum level of reliability depends heavily on the quality of its underlying reasoning model. The framework provides scaffolding, but the model’s ability to understand code and follow instructions remains a decisive factor.
For batch tasks with many explicit rules, investing in a model with at least moderate reasoning capability can be more cost-effective than choosing the smallest available model.
4. Can Agents Really Improve Through Iteration?
Based on this test, the answer is a qualified yes. Three different capabilities need to be distinguished.
Self-Correction: Already Available
Agents can respond to errors within a task—for example, by regenerating a script after an execution failure or retrying failed downloads.
Both frameworks demonstrated reliable task-level feedback loops in this test.
Self-Optimization: Partially Available
Framework A kept intermediate artifacts out of the delivery directory, satisfying an implicit expectation that the folder should contain only finished files.
This behavior suggests an ability to interpret task context beyond literal instructions. It is a useful form of task-level optimization, although it does not establish that the agent learned a persistent new strategy.
Self-Evolution: Not Yet Mature
A stronger form of improvement would mean retaining lessons from one task as reusable strategies and applying them proactively to a later, different task.
Today, this generally depends on external memory mechanisms and manually maintained prompts rather than autonomous behavior within the framework itself.
The more precise conclusion is that current AI agents can repeatedly correct errors and move toward a goal within a single task. Retaining experience and improving strategies across tasks still requires engineering support, such as task templates, experience repositories, and pipeline orchestration.
For enterprise use, the most dependable approach is to place agents inside standardized workflows supported by cloud infrastructure such as object storage, logging services, monitoring, and alerts.
5. Practical Recommendations
Teams planning to delegate batch processing to AI agents should focus on four practices:
- Make requirements explicit. State constraints such as “preserve extension casing” and “leave no intermediate artifacts in the delivery directory.” Requirements that seem obvious to a person should still be written down.
- Automate output validation. Have the agent report file counts and perform sample filename checks after execution, closing the loop between processing and verification.
- Do not choose models on price alone. If a lightweight local model passes a small trial, still run a full-volume test with a mid-sized model before relying on it.
- Separate working and delivery directories. Keep scripts, logs, and temporary files away from finished outputs. This prevents delivery contamination even if the agent forgets to clean up.
There is no silver bullet for batch processing. But with a suitable framework, explicit constraints, and a capable model, AI agents can turn an afternoon of repetitive work into a task completed in minutes—with greater consistency than manual processing.
