A Human-in-the-Loop Autonomous Agent for Industry Time Series Forecasting
This paper introduces CastClaw, a human-in-the-loop autonomous agent that integrates natural language task specification, specialized forecasting models, and iterative evidence-based refinement to outperform 16 baselines in electricity price and load forecasting while providing transparent execution reports.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Predicting the future of numbers that change over time—like the price of electricity or the load on a power grid—is a task that rarely succeeds with a single, isolated calculation. In the real world, accurate forecasting is not merely about feeding historical data into a computer program and waiting for an answer. It is a complex, iterative process where a human expert must define the goal, connect the right data sources, apply specific knowledge about how the world works, and then carefully judge whether the computer's guess makes sense. If the prediction looks strange, the expert must find missing information, adjust the approach, or decide to stop and try something else. For years, the field has been divided between specialized computer models that are excellent at crunching numbers but rigid in their thinking, and general-purpose artificial intelligence agents that can reason and talk but often lack the strict rules and checks needed for reliable numerical prediction.
Researchers at the University of Science and Technology of China have built a new system called CastClaw to bridge this gap. It is an autonomous agent designed to work alongside a human, acting as a tireless assistant that handles the heavy lifting of data analysis while leaving the final judgment and oversight to the person in charge. The system does not replace the human; instead, it creates a loop where the computer proposes a forecast, checks it against known patterns and user rules, and only changes its mind if it finds solid evidence to support a revision. If the evidence is missing, the system knows to ask the human for help or to look for more context, rather than guessing blindly. This approach turns forecasting from a one-shot calculation into a documented, inspectable workflow where every step, from the initial question to the final number, is recorded and can be reviewed.
The core of CastClaw is a framework the researchers call a "harness," which acts as the central nervous system connecting different tools. When a user asks a question in plain English, such as predicting electricity prices for the next day, the system first identifies what data is needed and what rules must be followed. It then pulls in a forecast from a specialized model or uses one the user provides. Before accepting this number, the system runs a series of checks. It looks at recent patterns to see if the prediction fits, compares it against domain knowledge like weather effects or supply and demand dynamics, and verifies that it meets any hard constraints the user set. If the forecast passes these tests, it is kept. If it fails, the system does not simply discard it; it investigates why. It might search for missing context, run a different type of analysis, or consult another model to see if a better candidate exists.
Crucially, the system is designed to know when to stop. It will not keep changing its mind indefinitely. It halts the process when the forecast is supported by evidence, when further changes are unlikely to help, when a budget for computation is spent, or when a human expert is needed to make a final call. Every action the system takes, every piece of evidence it finds, and every version of the forecast it considers is saved in a detailed report. This report allows a human to see exactly how the final number was reached, including any warnings or unresolved questions that remain. The system treats the human input not as a final command to be ignored, but as a vital part of the evidence chain that can correct the task, add new hypotheses, or stop the run at any time.
To test if this approach actually works, the researchers applied CastClaw to five different public datasets of electricity prices from Belgium, Germany, France, the Nordic Pool, and PJM in the United States. They compared the system's performance against sixteen other methods, ranging from traditional statistical tools to advanced artificial intelligence models. In every single case, CastClaw produced the most accurate predictions, measured by how close the numbers were to the actual future values. It outperformed the best existing methods by significant margins, reducing errors by up to thirty percent in some regions. The researchers also demonstrated the system in a live setting using data from the Nordic electricity market. In this demonstration, a user supplied an initial forecast, and the system checked it against market conditions. When the system found that a proposed adjustment would actually make the prediction worse, it rejected the change and kept the original forecast, documenting the entire decision process. This showed that the system is capable of critical thinking, knowing when to say "no" to a bad idea just as often as it knows when to say "yes" to a good one, and that the workflow itself is fully inspectable.
The researchers also ran the system on offline data representing electricity loads in North China for the first half of 2026. This exercise was designed to validate the offline workflow execution using the same task specifications, models, and tools, but it was not intended to demonstrate online deployment, production use, or comparative accuracy against other models. The results confirmed that the system could execute the complete workflow from start to finish in an offline environment, managing data, tools, and decisions according to its rules and recording detailed reports. The study makes it clear that while the system is highly capable, it is not a magic box that solves every problem instantly. It is a tool that requires a human to define the goals and provide the final oversight, ensuring that the predictions remain grounded in reality and useful for decision-making. By combining the speed of machines with the judgment of humans, CastClaw offers a new way to tackle the difficult problem of predicting the future, turning a chaotic process into a clear, reliable, and transparent journey.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.