Software-Defined Networking promises to deliver a more manageable network whose behaviour could be easily changed using applications written in high-level declarative languages running on top of a logically centralized control plane resulting, on the one hand, in the mushrooming of complex point solutions to very specific problems and, on the other hand, in the creation of a multitude of network configuration options. This fact is especially true for 802.11-based Software-Defined WLANs (SD-WLANs). It is our standpoint that to tame this increase in complexity, future SD-WLANs must follow an Artificial Intelligence (AI) native approach. In this paper we present aiOS, an AI-based Operating System for SD-WLANs. Then, we use aiOS to implement several Machine Learning (ML) models for user-adaptive frame length selection in SD-WLANs. An extensive performance evaluation carried out on a real-world testbed shows that this approach improves the aggregated network throughput by up to 55%. Finally, we release the entire implementation including the controller, the ML models, and the programmable data-path under a permissive license for academic use.