Cognitive building is a pioneering topic envisioning the future of our built environment. The concept of "cognitive" provides a paradigm shift that steps from the static concept of the building as a container of human activities towards the modernist vision of "machine à habiter" of Le Corbusier, where the technological content adds the capability of learning from users' behavior and environmental variables to adapt itself to achieve major goals such as user comfort, energy-saving, flexible functionality, high durability, and good maintainability. The concept is based on digital frameworks and IoT networks towards the concept of a smart city.