Micromobility has become a pillar of smart cities. Shared bike systems, scooters and light vehicles offer a sustainable alternative, but their operation depends on a difficult variable to anticipate: demand at each station. An accurate forecasting model makes it possible to optimise fleet distribution, reduce waiting times and increase profitability. In this context, STAGformer, a graph transformer aimed at micromobility demand forecasting, represents a relevant advance for both public operators and technology companies.
The challenge is not trivial. Demand at one station does not depend only on local history; it is influenced by the time of day, weather, urban events, points of interest and the behaviour of neighbouring stations. Spatio-temporal dependencies form a complex network that traditional statistical models cannot capture with sufficient accuracy. Deep learning models have improved the situation, but many are limited by computational cost and by the difficulty of representing global relationships without ignoring the geographical structure of the system.
To deal with this complexity, graph representation is especially useful. Each station becomes a node, and edges can represent distance, historical connectivity or travel flows between stations. Demand forecasting is then formulated as a problem over a dynamic graph, where each node has an associated time series. This formulation makes it possible to apply graph neural network models that learn spatial propagation patterns, although it adds scaling difficulties when the system has thousands of stations and a fine temporal resolution.
STAGformer addresses these limitations through a graph architecture with agent-based attention. Instead of computing attention among all pairs of stations and time steps, it introduces a reduced set of learnable tokens. These spatial and temporal agents first aggregate global information from the system and then broadcast it back to each station and time step. This two-phase mechanism maintains long-range modelling capacity, but reduces the quadratic complexity of classical self-attention to a linear cost in the number of stations and time steps. It is an elegant idea with very concrete practical implications.
The complete architecture integrates four modules. The spatio-temporal encoder combines dynamic node features with external contextual factors, such as weather, calendar or density of commercial venues. The graph propagation module aggregates information from neighbouring stations, capturing local influence. Temporal convolution extracts short-term patterns, such as morning or evening peak hours. And the agent attention module models global dependencies, both spatial and temporal. The combination of these components allows the model to understand each station as part of an urban ecosystem, not as an isolated series.
The separation between spatial and temporal agents is one of the most interesting points. Spatial agents can specialise in city areas with similar behaviour, even if they are not contiguous. Temporal agents can capture recurring seasonalities, such as weekends or holiday periods. By sharing information among agents, the model creates a global memory of the system that it later returns to each node and instant. This mechanism is reminiscent of recommendation systems based on latent representations, but applied to a spatio-temporal graph.
From a business perspective, accuracy in demand forecasting translates directly into operational efficiency. A bike-sharing operator can reposition bicycles before an imbalance occurs, allocate maintenance resources in advance and design dynamic pricing. In cities with service contracts, meeting availability indicators is essential to avoid penalties. Therefore, every improvement in metrics such as RMSE or MAE has a measurable economic impact.
At Q2BSTUDIO, as a software and technology development company, we see STAGformer as a clear example of how applied research can become a competitive advantage. Our team works with mobility operators to design custom software that integrates predictive models, monitoring systems and dashboards. It is not just about training an algorithm: it is necessary to build the infrastructure that feeds it and the product that makes it usable for the operations team.
Implementing a demand forecasting system requires a robust platform. Positioning, weather and operations data arrive in real time and must be processed securely. This is where services such as cloud AWS/Azure come into play, providing scalability and high availability for production environments. The combination of a well-designed cloud architecture with AI libraries makes it possible to run complex models such as STAGformer without compromising latency or cost.
Moreover, the results of a predictive model gain value when they reach the right people. A Business Intelligence layer, for example with Power BI, can turn predictions into visual alerts for the control centre. The operations team does not need to understand the internal workings of the transformer; it needs to know which stations are going to run out of bicycles in the next 30 minutes. This product vision is what Q2BSTUDIO brings to its software development projects, together with cybersecurity practices that protect mobility data and service continuity.
A growing trend is to combine forecasting models with AI agents that autonomously execute actions: rebalancing fleet, adjusting prices or sending maintenance alerts. These agents use STAGformer predictions as input to make decisions, under human supervision. This type of automation is especially useful when the network has hundreds of stations and teams cannot handle every incident manually.
Experiments conducted with data from New York and Chicago show that this architecture outperforms other baseline models across different prediction horizons, with consistent improvements in RMSE and MAE. Beyond the numbers, the study suggests that agent attention is a critical mechanism for capturing global dependencies. For a technology company, this evidence is useful when deciding which R&D investments will deliver a clearer return.
Bringing a model such as STAGformer into production poses additional challenges. Data quality is the first one: if the sensor network fails or if trip records are incomplete, predictions degrade quickly. Therefore, digital transformation projects must include data cleaning, validation and enrichment processes. It is also necessary to monitor model performance over time, because urban mobility changes with seasonalities, public works or new expansion areas. Well-governed AI systems incorporate automatic retraining mechanisms and drift alerts.
For such a solution to be sustainable, it should be integrated with the rest of the company systems. A predictions API can feed the mobile application, the route planning system or the control centre. The resulting data can be displayed in a dashboard with accuracy and usage metrics. At this point, Q2BSTUDIO experience in Business Intelligence and Power BI helps turn technical data into business decisions, and the cybersecurity layer ensures that sensitive information is protected.
In short, STAGformer demonstrates that agent attention can offer accuracy and efficiency in modelling spatio-temporal data. For micromobility, this represents a real opportunity to improve service and reduce costs. For Q2BSTUDIO, it is also a reminder that the value of an algorithm is not on paper, but in its integration with processes, people and technology. Demand forecasting is not an end in itself; it is a piece of a broader system that includes software development, cloud, artificial intelligence, cybersecurity and analytics. Whoever manages to unite those pieces with a clear strategy will have a sustainable advantage in the mobility market.





