Abstract— The HVAC (Heating, Ventilation, and AirConditioning) system of commercial buildings is a complex system with a large number of dynamically interacting components. In particular, the thermal dynamics of each zone are coupled with those of its neighboring zones. In this paper, we study an agent-based approach to model and control commercial building HVAC system for providing ancillary services to the power grid. In the multi-agent-building-system (MABS), individual zones are modeled as agents that can communicate, interact, and negotiate with one another to achieve a common objective. We first propose a distributed characterization method on the aggregate airflow (and thus fan power) flexibility that the HVAC system can provide to the ancillary service market. A Nash-bargaining-based airflow allocation strategy is then proposed to track a dispatch signal while respecting the preference and flexibility of individual zones. Moreover, we devise a distributed algorithm to ob...