Agentic Data Transfer Optimizer
Tuning bulk data transfers from live TCP telemetry, with the agent's actions kept inside hard limits.
- Status
- In progress · first results in
- Built with
- Python, Zero-copy sendfile(), Multiprocessing, Ollama, Hugging Face, Pydantic

The problem
Bulk data movers usually run with a hand-tuned, static concurrency setting. The right number of parallel streams depends on the network path, competing traffic, and host load, and all of them change during a long transfer.
Why it is hard
- A decision has to be made every probing interval, from noisy signals.
- Language models reason well about patterns but are unreliable at arithmetic.
- An agent that changes concurrency too far or too often can do more damage than a fixed setting.
- The model should run close to the transfer, on modest hardware, without depending on an outside service.
Try it
The toy below shows the problem in miniature: the best number of streams depends on the path, and the only way to find it is to measure.
Pick a network, then move the slider to try a number of parallel streams. Each setting you try is one measurement, and you only see what you measure. Then let the agent take over from your setting.
The best number of streams moves with the path: about 9 on a nearby, quiet link, about 21 on a long-distance link, about 5 on a busy shared link. A setting tuned for one path is wrong on the next, which is why the optimizer keeps measuring.
My role
I am building the system: the transfer runtime, the telemetry, the two agents, and the guardrails around them.
The approach
A sender and receiver move data over TCP through a multiprocessing worker pool with zero-copy sendfile() transfers. At each probing interval the system observes the transfer, two agents reason about it, and the runtime acts on a bounded recommendation.
- ObserveRead TCP socket statistics, congestion window, retransmissions, RTT variance, and host load.
- DiagnoseThe Diagnostic agent turns observations and recent history into a structured assessment.
- DecideThe Decision agent recommends a concurrency change or holds the current setting.
- EnforceHard limits, bounded deltas, graduated ramping, and oscillation damping shape the action.
↻ Each action is evaluated at the next interval, closing an observe, reason, act, evaluate loop.
Results
I evaluated the optimizer on CloudLab with 10 Gbps links and on an InfiniBand HPC cluster. Each round, the local Diagnostic and Decision agents tuned concurrency from TCP, host, and throughput telemetry. Across these runs the optimizer reached 94–98% of the throughput objective of the best fixed concurrency setting, and averaged up to 84.5 Gbps.
The comparison is deliberately hard. The best fixed setting is only known after trying every option on that path; a static mover gets its throughput only if someone has already done that tuning. The agents were never told the answer and got within a few percent of it on their own.
Decisions
- Small local models instead of tool-calling agents. The agents are designed around small models that can run on a CPU, so the optimizer needs no external API. Tool-calling agents were ruled out because they need large models.
- Keep the model out of arithmetic. Telemetry reaches the model already computed, so it reasons about values instead of calculating them. If the model's output is invalid, the system keeps the previous decision.
- The model recommends; the system enforces. No agent output can push concurrency outside the permitted range, repeated reversals are damped, and large changes are ramped in steps.
- Make every decision inspectable. Structured memory and a decision journal record what each agent saw and chose. The model layer is pluggable across local Ollama models, fine-tuned Hugging Face checkpoints, OpenAI, and Google Gemini.
What comes next
The next evaluations stress the agent in the situations a static setting handles worst:
- several transfers running at the same time;
- a transfer that joins while another runs at a fixed concurrency;
- congested disk I/O;
- packet loss on the nodes in between.