sRecent researches in IOT bring out smartness with the basis of machine learning techniques. IOT architecture describes the gateways or fog, an analysis engine and an insight layer. These layers are embedded between the cloud and the edge devices. The insight layer employs various learning modules onto the data in the cloud. The fog layer is the most significant layer that improves the efficiency of IOT architecture. Cloud computing and Fog computing is mutually operated. Fog based application should address the issue of the data to be kept in the fog device and to identify the data present in the nearest fog device with the relevant search query. Learning helps to identify the data that are referred frequently and predict the data requirements of the near future. Agents are introduced in the IOT architecture which reacts intelligently using its learning capability and its characteristics improve the system performance. © Springer Nature Switzerland AG 2020.