Can AI Agents Really Self-Improve? Lessons from Batch File Tasks
Completing a batch download is not the same as an agent evolving on its own. This article separates task automation, runtime recovery, experience reuse, and verifiable strategy improvement, then walks through input, naming, and delivery contracts, deterministic pipelines, acceptance checks, regression tests with rollback, and privacy controls for sensitive identity data.
1. Completing a task automatically is not the same as self-evolution
An agent can interpret natural-language requirements, break them into steps, generate programs, and call an execution environment. That easily creates the impression that it not only works, but also grows as it works.
From an engineering view, at least four layers should be distinguished:
Layer one is task automation. The agent turns requests such as “read a spreadsheet, download videos, organize files” into executable flows and reduces manual work.
Layer two is runtime recovery. After timeouts, file conflicts, or format errors, the agent adjusts the current operation from error feedback and continues.
Layer three is experience reuse. The system stores effective rules and applies them on later similar tasks. For example, if acceptance once failed because leftover scripts remained in the target directory, the next run actively isolates the work directory from the delivery directory.
Layer four is stronger continuous improvement: the system updates policy through a controlled mechanism and, on independent evaluation, shows that the new policy outperforms the old one on a class of tasks without unacceptable regressions.
The first three layers can be implemented without changing model weights. Seeing an agent rerun a program or tweak a flow is therefore not proof that “the model evolved by itself.” The real questions are: where is the improvement stored, when is it invoked, was it validated, and can it be rolled back if it fails?
2. Turn a batch-download request into an acceptably specified task contract
In the reference scenario there are 237 user records, 176 of which include a face-verification video URL. The need is to download those videos, name them as name-id-number.extension, and keep the original extension casing.
On the surface this is a loop of downloads. In practice it mixes data interpretation, network access, filesystem operations, and handling of sensitive information.
If the description is only “download the videos,” the agent may treat file generation as done. To avoid that mismatch, define a clear task contract first.
2.1 Input contract
Confirm table encoding, field meaning, null representation, and types. ID numbers should be read as text so they are not converted to numbers, losing leading zeros or changing representation.
“An address is present” is not “the address is reachable.” Empty values, illegal formats, access denied, missing resources, and transient network failures must be distinguished; they must not all be labeled “download failed.”
2.2 Naming contract
Extensions should come from an agreed source. If the filename in the URL path is authoritative, separate path from query string before taking the suffix, so signature parameters are not written into the filename.
Keeping .MOV versus .mp4 is a string-fidelity requirement. It does not mean the suffix proves actual encoding or container type.
Name fields may contain path separators, control characters, or characters illegal on the target filesystem. Handling rules must be set in advance. If cleaning changes the expected name, keep an auditable mapping instead of silent edits.
2.3 Output contract
At minimum specify:
- Every valid input record has a processing result.
- Successfully downloaded files correspond one-to-one with expected records.
- Names and extensions follow the rules.
- There are no unexplained overwrites, gaps, or duplicates.
- Incomplete files are not treated as finished products.
- The delivery directory contains only agreed deliverables.
- Logs, source-data copies, and execution scripts stay in a controlled workspace.
“Download finished” and “delivery finished” are different states. Scripts and data copies may not affect video playback, but they can violate delivery rules and widen exposure of sensitive data.
3. Reliable execution should use a deterministic pipeline, not improvisation
Agents are useful for interpreting requirements, planning, and handling exceptions. For hundreds of repeated downloads, core execution is better given to a program with explicit rules.
A more robust flow is:
Read and validate data → generate a task list → check naming conflicts → download → verify files → summarize results → publish the delivery directory.
3.1 Generate the list before side effects
Before network access and file writes, create a task item for each valid record: internal record ID, target filename, address reference, and status.
That surfaces two problems early:
Input duplication: the same user may appear more than once, and URLs may differ.
Output collision: different records may map to the same filename. Blind overwrite can produce a file count close to the expected total without proving completeness.
Conflict policy is a business rule: duplicate records may be merged; versioned files may go to a review queue. Do not quietly change naming rules to hide the issue.
3.2 Separate temporary download from official publish
Write to a temp file, run required checks, then publish as the official file. Keeping temp and target on the same filesystem helps atomic rename; guarantees still depend on OS and filesystem semantics.
This avoids leaving a correctly named but incomplete “product” after a network drop.
Sketch:
for each validated task:if an existing file already meets completion criteria:mark completedcontinuedownload to an isolated temp pathcheck response status and file contentif verification passes:publish as official fileupdate the task listelse:clean up the temp filerecord the failure type
“Meets completion criteria” is not merely “file exists.” Combine the task list, size, and prior verification; if a trusted checksum exists, check content integrity as well.
3.3 Retry by error type
Transient network faults can usually be retried. Invalid URLs, explicit permission denials, or missing fields usually need input correction or re-authorization.
Retries need a count and time budget and an appropriate backoff. Unlimited retries waste resources and can cause duplicate requests or rate limits.
If URLs expire, retry will not fix a dead address. Move to a controlled URL-refresh process instead of hunting other sources.
3.4 More concurrency is not always better
Higher concurrency can shorten wall time and also raise connection failures, disk contention, and server throttling. Set an adjustable cap and tune from error rate and throughput.
Without environment data, do not claim a fixed concurrency number is optimal. Scale, bandwidth, file size, and server limits all matter.
4. Acceptance must check content and correspondence, not only file count
For 176 valid download items, 176 files in a directory is necessary but not sufficient.
Possible failures: one file downloaded twice and another missing; an error page saved as a video; a correct name whose content belongs to another record.
Acceptance should cover four dimensions.
4.1 Count and set consistency
Compare the expected filename set with the actual set. List missing and extra names; do not compare two integers only.
4.2 File validity
Check emptiness, obvious truncation, and whether content matches the expected media type. Response headers are clues, not the only evidence; structural checks are usually more reliable.
If the upstream provides no trusted length or checksum, “it opens” does not prove a complete original file. State the verification boundary.
4.3 Record mapping
The task list should show which input record produced each file. Keep mapping in the controlled workspace, not mixed into the final delivery directory.
4.4 Delivery-directory purity
Before delivery, keep only allowed files. Cleanup should use this run’s file list or a clear directory boundary, not overly broad deletes.
The better design is not guessing what to delete after download, but separating workspace, temp, and delivery from the start.
5. How to show that an agent is actually improving
Batch file work is a useful window: errors are clear, acceptance is explicit, and scenes repeat, so an improvement loop can be built.
Writing a failure reason into “memory” is only a start; it does not guarantee better later performance.
5.1 Turn failures into concrete rules
If leftover source data is found in the target directory, form an executable rule:
“Source data may enter the controlled workspace only; delivery publishes only verified target files.”
That is clearer than “clean up next time” and easier to test automatically.
5.2 Store rules with scope
Experience needs trigger conditions, applicable scenes, validation method, and version—not only a natural-language summary.
“Delivery directory may contain only video files” applies only when the task requires a pure video drop. If the next task also requires a manifest, do not apply the old rule mechanically.
Reuse must obey the current task contract. Historical preference must not override new authorization.
5.3 Adopt only after regression tests
Build a set covering empty URLs, duplicate records, mixed extension case, network interruption, invalid responses, and filename collisions. New flows must pass these tests, then be compared with the old flow.
Metrics can include task success rate, missed-processing rate, invalid-file rate, human interventions, delivery violations, and resource use. Keep definitions stable; do not change the statistical frame to highlight improvement.
5.4 Keep held-out samples and rollback
Improvement only on errors already seen may be memorization. Also test tasks that did not participate in rule revision.
Version rules and execution flows. If a new policy raises failure rates, roll back. Unvalidated automatic change is uncontrolled drift, not reliable evolution.
6. Evaluate model capability and system engineering separately
The reference material gives only undeveloped clues about a locally executed model. That is not enough to conclude that “a class of models cannot complete the task.”
Agent performance depends on several links: whether the model understands constraints, whether the runtime is complete, whether network and file permissions work, whether tool feedback is clear, and whether acceptance rules are sufficient.
When a task fails, locate the layer. Path access denied is a permission issue; extensions forced to lowercase is a rule-implementation issue; download finished with no directory check is a missing delivery process.
A cheap one-off success also does not prove overall economy. Human review, reruns, compute, storage, and governance are part of total cost. Observe stability across multiple same-definition runs, not a single result.
7. Sensitive-data scenarios must encode security boundaries in the flow
This scene involves names, ID numbers, and face video. Convenience is not enough.
First, confirm a lawful basis and necessary authorization for processing and download. Execution accounts should use least privilege: only the source data and target directories this task needs.
Second, download URLs are untrusted input. Restrict reachable address ranges so the task is not steered toward internal admin resources; re-check URLs after redirects.
Third, filenames themselves contain sensitive identity data. Even if video access is controlled, directory screenshots, file lists, and error logs can leak identity. If this naming scheme is required, restrict directory visibility and redact logs.
Finally, workspace copies, temp files, and failure leftovers need retention and cleanup. Experience should store rules, not raw ID numbers, full video URLs, or personal data in long-term memory.
8. Conclusion: real iteration is a verifiable engineering loop
One successful batch download shows planning and execution ability. Repairing the current flow after errors shows use of feedback. Actively avoiding the same issue next time starts to show reuse.
None of that automatically equals model self-evolution.
A more reliable standard is whether the system can abstract failures into rules, persist them in a defined scope, prove benefit on independent tests, and roll back on regression.
For enterprise practice, the asset worth building is not a story that “the agent grows by itself,” but an auditable loop: explicit task contracts, stable execution, independent delivery acceptance, controlled experience updates, and permissions that do not overreach. Only then can agent improvement move from occasional performance to sustainable engineering capability.
