We propose e2-Diagnoser, a real-time data mining system for the energy management of smart, sensor-equipped buildings. The main features of e2-Diagnoser are: (i) fast extraction of a large portfolio of buildings' benchmarks at multiple places, and (ii) accurate prediction of buildings' energy usage down to sub meter level to detect and diagnose abnormal energy consumptions. Fundamentally, the e2-Diagnoser system is built on a novel statistical learning algorithm using the Generalized Additive Model (GAM) to simultaneously monitor the mean and variation of the energy usage as well as identify the influencing factors such as weather conditions. Its implementation is based on stream processing platform that integrates data from various sources using semantic web technologies and provides an interactive user interface to visualize results. The platform is scalable and can be easily adapted to other applications such as smart-grid networks. Here we describe the architecture, methodology, and show the web-interface to demonstrate the main functions in the e2-Diagnoser.